網頁

2017年7月29日 星期六

重灌Mac


1. 安裝HomeBrew
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. 安裝iterm2
http://iterm2.com

設定
Preference -> Keys -> Show/hide iTerm2 with a system-wide hotkey
Preferences -> Profiles -> Window -> Top of Screen

Mac已經有內建zsh (zsh --version 查版本)
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

設置主題powerLine
$ git clone git://github.com/jeremyFreeAgent/oh-my-zsh-powerline-theme ~/.ohmyzsh-powerline
$ cd .ohmyzsh-powerline/
$ ./install_in_omz.sh
$ cd ~
$ vim .zshrc
將ZSH_THEME=”robbyrussell”修改成ZSH_THEME=”powerline”

安裝Powerline專屬字型
$ git clone git://github.com/powerline/fonts ~/.powerline_fonts
$ cd ~/.powerline_fonts
$ ./install.sh

設定iterm2字型(原始是Monaco)
iTerm -> Preferences -> Profile -> Text
Font -> Change Font


設定提示字元

Powerline主題預設會顯示username、hostname與日期,並且只顯示目前路徑。

若不想顯示這些資訊,且想顯示完整路徑的話,請依照以下方式設定。

取消hostname與日期
$ vim ~/.zshrc
在第一行加上
POWERLINE_HIDE_HOST_NAME="true"
POWERLINE_DISABLE_RPOMPT="true"
POWERLINE_FULL_CURRENT_PATH="true"

取消username
$ vim ~/.ohmyzsh-powerline/powerline.zsh-theme
將此行改成
PROMPT="%k%f%F{white}%K{blue}"$POWERLINE_CURRENT_PATH"%F{blue}"$POWERLINE_GIT_INFO_LEFT" %k"$'\ue0b0'"%f "








4. 安裝fira code font
download 
到ttf資料夾選擇要安裝的形式

5. 安裝終端機自動命令提示
$ brew install zsh-autosuggestions

確認是否有zsh-autosuggestions.zsh (路徑要確認是否為0.4.0版本)
$ cd /usr/local/Cellar/zsh-autosuggestions/0.4.0/share/zsh-autosuggestions

zsh-autosuggestions.zsh放入~/.zshrc文件中
$ source /usr/local/Cellar/zsh-autosuggestions/0.4.0/share/zsh-autosuggestions/zsh-autosuggestions.zsh
$ source ~/.zshrc

6. 安裝OpenMP和MPI
Installing OpenMP
如果還沒安裝gcc
$ brew install gcc --without-multilib
如果已經安裝gcc
$ brew reinstall gcc --without-multilib
compile指令
$ gcc-7 -fopenmp
Installing MPI (https://shawnliu.me/post/configuring-openmp-and-mpi-on-mac/)
$ brew install openmpi --build-from-source --cc=gcc-7
compile指令
$ mpicc <your source code>

7. 安裝 Homebrew Cask
$ brew install brew-cask-completion
$ brew cask install google-chrome

8. 更新
$ brew update && brew upgrade brew-cask && brew cleanup

9. 安裝Anaconda
https://www.continuum.io/downloads

啟動 Jupyter Notebook
$ jupyter notebook

10.安裝FileZilla
$ brew cask install filezilla

11. 安裝The Unarchiver
https://itunes.apple.com/app/the-unarchiver/id425424353

12. Sublime Text 3
https://www.sublimetext.com/3