<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                [TOC] # 一些mac需要的軟件 https://blog.skk.moe/post/mac-software/ # brew **倉庫** [https://docs.brew.sh/Interesting-Taps-and-Forks.html](https://docs.brew.sh/Interesting-Taps-and-Forks.html) --- https://mp.weixin.qq.com/s/L3IPXZae10FswOhmSDQoLg https://zhuanlan.zhihu.com/p/22598799 --- 關閉自帶httpd ~~~ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist ~~~ ## 安裝 mac 安裝 brew Homebrew brew 全稱Homebrew 是Mac OSX上的軟件包管理工具 Homebrew 安裝和卸載工具 只用一行命令就能完成 brew官網網址:https://brew.sh/index.html 安裝 輸入: ruby -version 安裝命令: ~~~ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ~~~ 假如已經安裝了,輸入如下命令 ~~~ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ~~~ 默認oh-my-zsh是不支持HomeBrew的,所以我們需要這樣做: ~~~ brew install zsh-completions ~~~ ## 使用方法 命令行 輸入: brew ## 安裝工具 舉個栗子: wget 這個工具 輸入命令: ~~~ brew install wget ~~~ ## 日志 ~~~ /Users/jdxia/Library/Caches/Homebrew/Cask /Users/jdxia/Library/Logs/Homebrew ~~~ ## 降級 ~~~ git clone https://github.com/Homebrew/homebrew-core.git git log ./Formula/thrift.rb 找到0.9.2 commit git checkout 56d8c1eba1e5ac30290dd0c486f4bba37f821e42 brew install ./Formula/thrift.rb ~~~ 原理是,從github上下載homebrew,homebrew中記錄了各個時期的軟件版本,checkout homebrew的低版本分治,把thrift低版本rb找到,然后安裝。 其實,也可以直接使用別人分享的thrift-0.9.2.rb文件直接安裝。 ## 卸載 拿上面的栗子: wget 工具 輸入命令 ~~~ brew uninstall wget ~~~ 工具安裝的目錄 Homebrew 會將套件安裝到獨立目錄,并將文件軟鏈接至/usr/local ~~~ $ cd /usr/local $ find Cellar Cellar/wget/1.16.1 Cellar/wget/1.16.1/bin/wget Cellar/wget/1.16.1/share/man/man1/wget.1 $ ls -l bin bin/wget -> ../Cellar/wget/1.16.1/bin/wget ~~~ ## 鎖定不想更新的包 如果經常更新的話,brew update 一次更新所有的包是非常方便的。但我們有時候會擔心自動升級把一些不希望更新的包更新了。數據庫就屬于這一類,尤其是 PostgreSQL 跨 minor 版本升級都要遷移數據庫的。我們更希望找個時間單獨處理它。這時可用 brew pin 去鎖定這個包,然后 brew update 就會略過它了。 ~~~ brew pin $FORMULA # 鎖定某個包 brew unpin $FORMULA # 取消鎖定 ~~~ ## 其他命令 http://blog.csdn.net/crper/article/details/78520575 ~~~ brew list 列出已安裝的軟件 brew list 軟件名 //列出指定安裝軟件的文件 brew services list :顯示安裝的服務 brew reinstall vim 重新安裝vim,比如升級系統vim無法使用 brew link xx 添加鏈接過去 brew swift xx 版本號 切換版本 brew update 更新brew brew home 用瀏覽器打開brew的官方網站 brew doctor檢查是否存在沖突 brew info 顯示軟件信息 brew uninstall wget # 卸載軟件,很爽,一鍵靜默卸載 brew search git # 模糊搜索brew 支持的軟件。如果不加軟件名,就會列出所有它支持的軟件。多的很。 brew deps 顯示包依賴 brew outdated # 看一下哪些軟件可以升級 brew upgrade <xxx> # 如果不是所有的都要升級,那就這樣升級指定的 brew --cache 下載之后的文件夾 brew upgrade; brew cleanup # 如果都要升級,直接升級完然后清理干凈 brew services restart php71 #重啟php71 會安裝到這個文件下 /usr/local/Cellar 會同步一份到 /usr/local/opt 任何的增刪改都會保持這2個目錄的同步。并且已經軟鏈好各種命令到/usr/local/bin下。 /usr/local/etc/ 這里也有 brew edit nginx 更改編譯參數,在 args 段最后加上,--with-,brew install nginx --build-from-source從源碼開始安裝 nginx , 默認情況下會采用 bottle 方式安裝,bottle 方式就是安裝已編譯好的二進制包 ~~~ homebrew本身就是一個git倉庫。使用homebrew安裝軟件包時,會自動先下載軟件包,然后解壓安裝,但有時候下載會卡住,或者很慢,這個時候你可以通過其他工具先將所需的軟件包下載 下來,注意版本一定要對應,homebrew放置軟件包源碼的路徑為/Library/Caches/Homebrew/,只要你將所需要的軟件包下載正 確的版本,放置在此目錄下,那么再使用brew install xxx的時候,brew就能直接安裝了,有時候brew install xxx卡在下載界面,這招很管用 ~~~ Making a formula is easy. Just brew create URL and then brew install $FORMULA (perhaps with --debug --verbose). Basically, a formula is a Ruby file. You can place it anywhere you want (local or remote) and install it by pointing to the file or URL. formula文件位置:/usr/local/Library/Formula/foo.rb 存放安裝工具的rb文件 Packages are installed according to their formulae, which live in $(brew --repository)/Library/Formula. Check some out. You can view any formula at anytime; e.g. brew edit wget. ~~~ ## 注意 數據存放目錄為/usr/local/var 如果一些軟件升級,可能要把這個目錄下對應程序的文件夾刪除,重新創建才可以 比如mongo3升級到4 日志存放位置/usr/local/var/log,出問題可以到這邊看 # LaunchRocket https://github.com/jimbojsb/launchrocket 這是用來管理brew安裝的軟件的圖形界面 ## 注意 在Mac OS X 10.11系統以后,/usr/local/等系統目錄下的文件讀寫是需要系統root權限的,以往的Homebrew安裝如果沒有指定安裝路徑,會默認安裝在這些需要系統root用戶讀寫權限的目錄下,導致有些指令需要添加sudo前綴來執行,比如升級Homebrew需要: ~~~ $ sudo brew update ~~~ 如果你不想每次都使用sudo指令,你有兩種方法可以選擇: 1. 對/usr/local 目錄下的文件讀寫進行root用戶授權 ~~~ $ sudo chown -R $USER /usr/local 示例: $ sudo chown -R wentianen /usr/local ~~~ 2. 安裝Homebrew時對安裝路徑進行指定,直接安裝在不需要系統root用戶授權就可以自由讀寫的目錄下 ~~~ <install path> -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ~~~ # tap 可以關注的Taps ~~~ homebrew/php:和php關聯的formulae denji/nginx: nginx modules 的tap InstantClientTap/instantclient: Oracle客戶端實例的tap petere/postgresql: 允許同時安裝多個PostgreSQL版本的tap dunn/emacs: Emacs package的tap sidaf/pentest: 滲透測試工具的tap osrf/simulation: 機器仿真的tap ~~~ # brew更換源 ~~~ https://lug.ustc.edu.cn/wiki/mirrors/help/brew.git ~~~ # brew cask ## 簡介 brew cask 是在brew 的基礎上一個增強的工具,用來安裝Mac上的Gui程序應用包(.dmg/.pkg), 比如qq、chrome、xun lei等。它先下載解壓到統一的目錄中(/opt/homebrew-cask/Caskroom),省掉了自己去下載、解壓、拖拽(安裝)等蛋疼步驟,同樣,卸載相當容易與干凈。然后再軟鏈到~/Applications/ 目錄下, 一氣呵成。非常方便,而且還包含很多在 AppStore 里沒有的常用軟件 好,我們來來下一個iTerm來看看: ## 安裝 ~~~ brew cask install iTerm ~~~ 簡單的2條命令就可以了,非常之快,它會講軟件安裝到/opt/homebrew-cask/Caskroom目錄下,并且軟鏈到~/Applications了,這樣就能在應用程序里找到它。就能方便的使用。 ## 常用軟件 [https://www.jianshu.com/p/f8444a7658a3](https://www.jianshu.com/p/f8444a7658a3) ## 常用命令 下面說一些常用到的各種命令。 ~~~ brew cask install qq # 下載安裝軟件 brew cask uninstall qq # 卸載軟件 brew cask search qq # 模糊搜索軟件,如果不加軟件名,就列出所有它支持的軟件 brew cask info qq # 顯示這個軟件的詳細信息,如果已經用cask安裝了,也會顯示其安裝目錄信息等 brew cask list # 列出本機按照過的軟件列表 brew cask cleanup # 清除下載的緩存以及各種鏈接信息 brew update && brew upgrade brew-cask # 更新cask自身 ~~~ 或許你已經注意到了,好像并沒有提供更新用cask安裝軟件命令啊。的確是沒有。是的。目前 homebrew-cask 并沒有命令直接更新所有已安裝的軟件,軟件更新主要是通過軟件自身的更新流程,不過也可以通過以下所示命令先刪除 APP,再重新安裝。 ~~~ brew cask uninstall APP && brew cask install APP ~~~ 軟件同樣也會安裝到/opt/homebrew-cask/Caskroom目錄下。 對過時的升級 ~~~ https://github.com/buo/homebrew-cask-upgrade ~~~ 大多數通過 Cask 安裝的軟件都自帶更新選項,如果沒有該選項,用戶依舊可以通過終端進行更新,在終端中輸入brew tap buo/cask-upgrade,然后再輸入下段命令即可更新全部應用: ~~~ brew cu ~~~ ## LaunchRocket 安裝LaunchRocket就要用到我剛剛提的brew cask,用如下命令即可: ~~~ brew tap jimbojsb/launchrocket brew cask install launchrocket ~~~ 之后LauchRocket設置頁面找到(如下圖所示),它的啟動項同時也保存在/opt/homebrew-cask/Caskroom/launchrocket目錄中。 ![](https://box.kancloud.cn/4559e993fd1318d0753541132cd791e5_1200x1190.jpg) # 需要github的token 去這個網站 https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew 把勾勾全部勾上,然后生成 然后終端 export HOMEBREW_GITHUB_API_TOKEN=你copy的token字符串 就好了 # 安裝php 新版本 https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions ~~~ // 更新brew $ brew update // 添加三方倉庫 $ brew tap homebrew/dupes $ brew tap homebrew/versions $ brew tap homebrew/homebrew-php //卸載倉庫 brew untap homebrew/nginx // 如果沒有該目錄,則創建 $ sudo mkdir /usr/local/var $ sudo chmod 777 /usr/local/var $ sudo mkdir /usr/local/sbin/ $ sudo chown -R <username>:<group> /usr/local/sbin/ // 安裝php7前,先關閉老版本的PHP55,并解除/usr/local/bin/php軟鏈接 $ brew unlink php55 // 我們可以通過brew options命令來查看安裝選項 $ brew options php70 // 開始安裝PHP7 $ brew install php70 (--with-apache 假如需要生成apache的libphp7.so,則添加該安裝選項) // 查看php版本 $ php -v PHP 7.0.13 (cli) (built: Dec 5 2016 14:49:24) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies ~~~ https://laravel-china.org/topics/3373/mac-install-lnmp-environment ## php多版本管理 看這個就行了phpbrew http://rmingwang.com/php-version-management-phpenv.html # mac上nginx nginx設置開機啟動 ~~~ ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist ~~~ nginx默認監聽80端口,而mac系統,只有root用戶才可以打開<1024的監聽端口,所以,這里得設置額外的權限: ~~~ sudo chown root:wheel /usr/local/Cellar/nginx/1.6.0_1/bin/nginx // 這里的版本號換成你自己的 sudo chmod u+s /usr/local/Cellar/nginx/1.6.0_1/bin/nginx // 這里的版本號換成你自己的 ~~~ 如果你遇到了這樣的問題 ~~~ 2018/02/21 11:45:55 [emerg] 5931#0: open() "/usr/local/var/run/nginx.pid" failed (13: Permission denied) ~~~ 那么就要按照上面說的做了 ~~~ sudo cp -v /usr/local/opt/nginx/*.plist /Library/LaunchDaemons/ sudo chown root:wheel /Library/LaunchDaemons/homebrew.mxcl.nginx.plist ~~~ ~~~ sudo chown :staff /var/www sudo chmod 775 /var/www ~~~ # 一鍵腳本安裝 這個是mac的 https://php-osx.liip.ch 題外話 php72被替換成php 以前啟動命令是 ~~~ /usr/local/opt/php72/sbin/php-fpm --nodaemonize --fpm-config /usr/local/etc/php/7.2/php-fpm.conf ~~~ 變成了 ~~~ /usr/local/opt/php/sbin/php-fpm --nodaemonize ~~~ # linux安裝brew ~~~ git clone https://github.com/Linuxbrew/brew.git ~/.linuxbrew ~~~ 還得把homebrew-core克隆下來,里面有一些核心的軟件安裝formula,比如gcc。 ~~~ git clone https://github.com/Linuxbrew/homebrew-core ~/.linuxbrew/Library/Taps/homebrew ~~~ 配置一下bash_profile文件 ~~~ export PATH="$HOME/.linuxbrew/bin:$PATH" export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH" export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH" ~~~ 然后source一下就可以用了。 裝軟件 裝一個oracle的jdk ~~~ brew install jdk ~~~ 我還找到一個倉庫里面有很多開發工具,比如smartgit, idea等等軟件https://github.com/athrunsun/homebrew-linuxbinary ~~~ brew tap athrunsun/linuxbinary ~~~ 把要裝的都給裝了一個遍 ~~~ brew install smartgit brew install intellij-idea-ce brew install lantern brew install proxychains-ng brew install skype brew install telegram brew install android-studio brew install pycharm-ce brew install sublime-text brew install telegram brew install unetbootin brew install shadowsocks-go-local brew install smart-synchronize ~~~ 可惜沒有看到leanote、atom、firefox等軟件。 linuxbrew相關的網址 https://github.com/Linuxbrew/brew https://linuxbrew.sh/ https://github.com/Linuxbrew/brew/tree/master/docs#readme https://www.digitalocean.com/community/tutorials/how-to-install-and-use-linuxbrew-on-a-linux-vps # homebrew-bundle 1. Mac 上非常常用的包管理器 Homebrew, 我們經常用它來安裝其他的軟件包 2. 還有 Homebrew-cask, 可以用來安裝圖形界面的 App 3. homebrew-bundle 類似 node 中的 package.json 或者 Cocoapods 中的 Podfile 4. 我們將需要的包和 App, 聲明在一個 Brewfile 中, 然后執行 brew bundle 即可安裝所有包 備份列表包含: 1. brew tap中的軟件庫 2. brew 安裝的命令行工具 3. brew cask 安裝的 App 4. Mac App Store 安裝的 App ~~~ # 執行brew bundle dump備份命令 brew bundle dump --describe --force --file="~/Desktop/Brewfile" # 參數說明 --describe:為列表中的命令行工具加上說明性文字。 --force:直接覆蓋之前生成的Brewfile文件。如果沒有該參數,則詢問你是否覆蓋。 --file="~/Desktop/Brewfile":在指定位置生成文件。如果沒有該參數,則在當前目錄生成 Brewfile 文件。 # 該命令會在桌面上生成Brewfile文件,雙擊打開查看,其內容類似于 ## 該部分是 brew 中的 tap,相當于一個個軟件庫 tap "homebrew/bundle" tap "homebrew/cask" ## 該部分是 brew 安裝的命令行工具 # Mac App Store command-line interface brew "mas" # UNIX shell (command interpreter) brew "zsh" # Fish shell like syntax highlighting for zsh brew "zsh-syntax-highlighting" ## 該部分是 brew cask 安裝的 app cask "mounty" cask "dteoh/sqa/slowquitapps" ## 該部分是 Mac App Store 安裝的 app mas "ting_en", id: 734383760 mas "Xcode", id: 497799835 ~~~ **homebrew-bundle 如何恢復** > 通過備份的軟件列表文件批量安裝軟件 ~~~ # 安裝 Homebrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # 安裝 mas brew install mas # 批量安裝軟件 brew bundle --file="~/Desktop/Brewfile" # 這里分享一份自己的真實備份文件 wangao@wangao-MAC ~/Desktop # cat Brewfile tap "buo/cask-upgrade" tap "dteoh/sqa" tap "homebrew/bundle" tap "homebrew/cask" tap "homebrew/core" tap "homebrew/services" # GNU compiler collection brew "gcc" # Distributed revision control system brew "git", link: false # Improved top (interactive process viewer) brew "htop" # Mac App Store command-line interface brew "mas" # MySQL database connector for C applications brew "mysql-connector-c" # Platform built on V8 to build network applications brew "node" # Perl compatible regular expressions library brew "pcre" # Password generator brew "pwgen" # Interpreted, interactive, object-oriented programming language brew "python" # Interpreted, interactive, object-oriented programming language brew "python@2" brew "sshpass" # User interface to the TELNET protocol (built from macOS Sierra sources) brew "telnet" # Display directories as trees (with optional color/HTML output) brew "tree" # Internet file retriever brew "wget" # UNIX shell (command interpreter) brew "zsh" # Fish shell like syntax highlighting for zsh brew "zsh-syntax-highlighting" cask "java" cask "mounty" cask "xquartz" cask "dteoh/sqa/slowquitapps" mas "GarageBand", id: 682658836 mas "iMovie", id: 408981434 mas "Keynote", id: 409183694 mas "Microsoft Remote Desktop", id: 1295203466 mas "Numbers", id: 409203825 mas "Pages", id: 409201541 mas "ting_en", id: 734383760 mas "Xcode", id: 497799835 ~~~ # brew安裝指定版本es **查看軟件包安裝來源** ~~~ $?brew info ffmpeg ~~~ 執行上述命令您會得到如下信息: ~~~ $?From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ffmpeg.rb ~~~ 你看到了什么?github(版本控制) 還有 \*.rb(安裝文件) **Github中查看rb文件歷史提價(版本)信息** 復制鏈接到地址欄:[https://github.com/Homebrew/h...](https://github.com/Homebrew/homebrew-core/blob/master/Formula/ffmpeg.rb) 可以看到如下信息: ~~~ url "https://ffmpeg.org/releases/ffmpeg-4.0.1.tar.xz" sha256 "605f5c01c60db35d3b617a79cabb2c7032412be243554602eeed1b628125c0ee" ~~~ 可以看到當前版本就是: ffmpeg-4.0.1 **接著,在Github上查看歷史提交信息,按照如下操作依次點擊(熟悉github的同學應該已經看透了秘密):** 1. **點擊 History**: 查看歷史提交列表 2. **查找 FFmpeg: 3.4.2,并點擊**: 找到我們需要的版本 3. **點擊 View**:查看當前版本下的ffmpeg.rb完整文件 4. **點擊 Raw**: 查看ffmpeg.rb源文件,復制地址欄網址(這一步是不是不需要了,3中的網址應該也可以?我沒有嘗試) **安裝 ffmpeg-3.4.2 版本軟件包** > ffmpeg:3.4.2 對應的ffmpeg.rb文件網址:[https://raw.githubusercontent...](https://raw.githubusercontent.com/Homebrew/homebrew-core/18b47ee7e250f4e0447dc6454d9189d1fae0c6a5/Formula/ffmpeg.rb) **執行安裝** ~~~ $?brew install https://.../ffmpeg.rb(上面復制的網址) ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看