1, iterm2 配色方案html
http://iterm2colorschemes.com/ python
a, 下載iTerm2
mysql
http://iterm2.com/downloads.htmllinux
Preferences --> Colors --> Load Presets ( 導入下載的配色方案)ios
b, 設置.bash_profilegit
#enables colorin the terminal bash shell export export CLICOLOR=1 #sets up thecolor scheme for list export export LSCOLORS=gxfxcxdxbxegedabagacad #sets up theprompt color (currently a green similar to linux terminal) export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ ' #enables colorfor iTerm export TERM=xterm-256color
c, vim 配置github
syntax enable set background=dark "set ruler "colorscheme solarized " 自動縮進 "set autoindent "set cindent " Tab鍵的寬度 set tabstop=4 set ts=4 set expandtab set history=100 " keep 100 lines of history set viminfo='20,\"200 " keep a .viminfo file set hlsearch " highlight the last searched term set fileencodings=utf-8,gb2312,gbk,gb18030
d, 經常使用快捷鍵sql
1. +數字在各 tab標籤直接來回切換docker
2.選擇即複製 + 鼠標中鍵粘貼,這個很實用shell
3. + f所查找的內容會被自動複製
4. + d 橫着分屏 / + shift + d 豎着分屏
5. + r = clear,並且只是換到新一屏,不會想 clear同樣建立一個空屏
6.ctrl + u 清空當前行,不管光標在什麼位置
7.輸入開頭命令後 按 + ;會自動列出輸入過的命令
8. + shift + h 會列出剪切板歷史
9.能夠在 Preferences > keys設置全局快捷鍵調出 iterm,這個也能夠用過 Alfred實現
10.← / → 到一行命令最左邊/最右邊 ,這個功能同 C+a / C+e
11.← /→按單詞前移/後移,至關與 C+f / C+b,其實這個功能在Iterm中已經預約義好了,f /b,看我的習慣了
再來些linux上也通用的快捷鍵:
C+a / C+e 這個幾乎在哪均可以使用
C+p / !! 上一條命令
C+k 從光標處刪至命令行尾 (原本 C+u是刪至命令行首,但iterm中是刪掉整行)
C+w A+d 從光標處刪至字首/尾
C+h C+d 刪掉光標先後的自負
C+y 粘貼至光標後
C+r 搜索命令歷史,這個較經常使用
2, 部署vagrant開發環境
Note: 對於vagrant 開發環境的建立,可使用在線的virtualbox(下載時間是個問題), 也能夠下載到的box文件
1, 下載安裝vagrant
2, 配置 vagrant
a, Discover Download Vagrant Boxes
b, 加載本地文件(若是使用在線box skip this step)
$ vagrant box add homestead .vagrant/ubuntu_trusty64_virtualbox.box
Note: homestead 是定義的本地vagrant box 的名稱
c, 檢出vagrant示例
$ git clone https://github.com/colynn/homestead.git homestead
d, 修改配置、啓動主機, 參照 github
Refer to:http://www.cnblogs.com/wangkongming/p/4301021.html
3, 配置Dnsmasq
Note: 配置dnsmasq,緩存dns, 自定義域名使用的dns服務器.
1, Download dnsmasq
$ wget http://www.thekelleys.org.uk/dnsmasq/dnsmasq-2.75.tar.gz
2, Install dnsmasq
$ tar -zxf dnsmasq-2.75.tar.gz $ cd dnsmasq-2.75 $ sudo make $ sudo make install
3, Configure
$ sudo cp dnsmasq.conf.example /etc/dnsmasq.conf
server=/163.com/114.114.114.114 server=/126.net/114.114.114.114 #server=/netease.com/114.114.114.114 server=/xiami.com/114.114.114.114 server=/xiami.net/114.114.114.114 server=/baidu.com/114.114.114.114 server=8.8.8.8
4, Start Dnsmasq
Note: dnsmasq-2.75/contrib/MacOSX-launchd/launchd-README.txt get more infomation
$ cd contrib/MacOSX-launchd
sudo cp uk.org.thekelleys.dnsmasq.plist /Library/LaunchDaemons/
sudo chown root:admin /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist
sudo chmod 644 /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist
# enabled dnsmasq
sudo launchctl load /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist
# start/stop dnsmasq
sudo launchctl stop uk.org.thekelleys.dnsmasq
sudo launchctl start uk.org.thekelleys.dnsmasq
5, Reconnection *** and modified DNS record
Refer to http://passingcuriosity.com/2013/dnsmasq-dev-osx/
### disabled dnsmasq ??
# sudo launchctl unload /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist
### disable dnsmasq.
step1 check pid base on listen port
# sudo lsof -i udp:53
step2 base on pid get the service name
# sudo launchctl list
step3 disable specific service
# sudo launchctl disable service-name
FAQ
1, pasting multiline chunks of text info iTerm2 causes overlaps, broken lines and whatnot(iTerm2 多行粘貼,輸出錯誤,不包含換行符)
調整爲這個 Edit --> Paste Special --> Paster Slowly //這種粘貼速度很慢,仍是建議使用其餘方式避免這種多行粘貼的操做。
2, mac disable SIP
3, mac modified docker daemon.json file.
Under mac the daemon.json is kinda hidden.
1. goto ~/Library/Containers/com.docker.docker/Data/database
there is an .git repository (.git)
2. reset to HEAD git reset --hard
3. now you have com.docker.driver.amd64-linux
4. go into ~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/etc/docker there is your daemon.json
don't forget to commit your changes otherwise it might be lost
4, pip install python-ldap, mysql-python
mysql-python 依賴的環境:
1) Install Xcode;
2) Install
xcode-select --install
3) Install mysql
brew install mysql
python-ldap 依賴的環境:
1)
/usr/include appears to have moved
$ xcrun --show-sdk-path $ sudo ln -s <the_path_from_above_command>/usr/include /usr/include