http://brew.sh/index_zh-cn.html
清华大学镜像:
参考 https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
安装 brew cask
cd /usr/local
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/brew.git
cd /usr/local/Library/Taps/homebrew/homebrew-core
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-core.git
brew update
新系统可能没有 wget 可以 homebrew 安装一下 wget
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
修改 oh-my-zsh theme dst
vi ~/.zshrc
===
ZSH_THEME="dst"
配置 plugins .zshrc
plugins=(git autojump) [[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
create new profile for work:
libo@localhost: ~
$ cat /usr/local/bin/login.exp [11:10:14]
#!/usr/bin/expect
# 参数1:远程host;参数2:远程password
#if { $argc != 2 } {
# send_user "Usage: host password\n"
# exit
#}
#set host [lindex $argv 0]
#set pw [lindex $argv 1]
set TERMSERV 123.59.122.11
set TERMSERVPORT 50022
set USER libo17
set PASSWORD {$password}
set VMHOST 10.185.30.240
set ROOTPASSWD {$password}
# 登录跳板机
catch {spawn ssh -l $USER $TERMSERV -p $TERMSERVPORT}
expect "*assword:*" { send "$PASSWORD\r";}
expect "*Type*" {send ":";}
expect ":" {send "ssh root@$VMHOST\r";}
expect "*assword:*" { send "$ROOTPASSWD\r";}
expect "*$VMHOST*" { send "cd ~; ./itmux.sh; cd /home/wwwroot\r"; interact }
chmod +x /usr/local/bin/login.exp
set iterm2 with new profile:

可以配置一下 window的默认打开 size
set iTerm2 lrzsz
brew install lrzsz
vi iterm2-recv-zmodem.sh
#!/bin/bash
#Author: Matt Mastracci ([email protected])
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domain
FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
if [[ $FILE = "" ]]; then
echo Cancelled.
# Send ZModem cancel
echo -e \\x18\\x18\\x18\\x18\\x18
echo \# Cancelled transfer
echo
else
echo $FILE
cd "$FILE"
/usr/local/bin/lrz
echo \# Received $FILE
echo
fi
vi itemr2-send-zmodem.sh
#!/bin/bash
#Author: Matt Mastracci ([email protected])
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domain
FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose file with prompt "Choose a file to send"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
if [[ $FILE = "" ]]; then
echo Cancelled.
# Send ZModem cancel
echo -e \\x18\\x18\\x18\\x18\\x18
echo \# Cancelled transfer
echo
else
echo $FILE
/usr/local/bin/lsz "$FILE"
echo \# Received $FILE
echo
fi
chmod +x iterm2-recv-zmodem.sh iterm2-send-zmodem.sh
configuration iTerm2 default trigger default trigger(iTerm偏好设置-> Profiles –> Default –> Advanced –> Triggers的Edit按钮
Regular expression: \*\*B0100
Action: Run Silent Coprocess
Parameters: /usr/local/bin/iterm2-send-zmodem.sh
Regular expression: \*\*B00000000000000
Action: Run Silent Coprocess
Parameters: /usr/local/bin/iterm2-recv-zmodem.sh
set iTerm2 session clone iTerm2也支持类似secureCRT所提供的克隆会话的问题,对服务端码龙而言是很方便的,可以避免输入密码。 通过下面步骤就可以实现该功能。
1) 配置Mac所在机器的ssh。 vi ~/.ssh/config 输入下面三行 host * ControlMaster auto ControlPath ~/.ssh/master-%r@%h:%p
2)第一次远程服务器,还是需要输入密码 例如:ssh server00_name
- ssh成功后,使用快捷键command + t 产生一个新的窗口 然后再次 ssh 你的远程服务器。 就不用输入密码了,达到克隆会话的效果。
参考「sublime text 3 configuration notes」
brew cask install marp