修改hosts文件能够使用 SwitchHosts
13.249.146.118 d3mw3wlkjdkqc9.cloudfront.net fastdl.mongodb.org
13.249.146.66 www.mongodb.org
199.232.68.133 raw.githubusercontent.com
13.249.146.118 d3mw3wlkjdkqc9.cloudfront.net fastdl.mongodb.org
185.199.110.154 githubassets.com
13.229.188.59 github.com
140.82.114.3 github.com
185.199.109.153 github.iohtml
以上修改是为了 防止域名解析混淆,在安装Homebrew等时能够直接访问,下载MongoDB时能够更快下载。前端
能够经过 ipaddress 和 ping.cn 网站查询对应域名的IP地址。git
安装命令:github
下面这种安装方式下载会很慢很慢,能够使用上面提到的修改hosts方法修改相关用到的域名的IP指向加速下载。mongodb
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
替换brew默认源为国内源:shell
# 替换brew.git: $ cd "$(brew --repo)" # 中国科大: $ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git # 清华大学: $ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git # 替换homebrew-core.git: $ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" # 中国科大: $ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git # 清华大学: $ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git # 替换homebrew-bottles: # 中国科大: $ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile $ source ~/.bash_profile # 清华大学: $ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile $ source ~/.bash_profile # 应用生效: $ brew update
重置源:express
重置brew.git: $ cd "$(brew --repo)" $ git remote set-url origin https://github.com/Homebrew/brew.git 重置homebrew-core.git: $ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" $ git remote set-url origin https://github.com/Homebrew/homebrew-core.git 应用生效: $ brew update
简单使用:vim
搜索:brew search
安装:brew install 软件名
卸载:brew uninstall 软件名
更新:brew upgrade 软件名
列出已安装的软件包:brew list
查看软件包信息:brew info 软件名
列出能够更新的软件包:brew outdated
$ brew install wget
官网下载:http://www.gnu.org/software/w...sass
安装完成!ruby
mac自带zsh
,但不是最新的,查看版本zsh --version
经过brew
更新最新版,brew install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo $SHELL
chsh -s /bin/zsh
安装完成后会自带一些主题,能够到 ~/.oh-my-zsh/themes
目录下查看能够使用的主题。
也能够经过下面的地址下载主题放到 ~/.oh-my-zsh/themes
下
https://github.com/robbyrusse...
修改主题
1. 打开配置文件:open ~/.zshrc 2. 修改配置文件:ZSH_THEME=你想要的主题,默认为robbyrussell 3. 让配置文件生效:source ~/.zshrc 4. 主题推荐:ys,ys是安装时自带的,无需额外下载
.oh-my-zsh
默认提供了上百种插件,能够在 ~/.oh-my-zsh/plugins
目录下查看。
自动补全插件
执行如下命令安装插件,插件会被安装到 ~/.oh-my-zsh/custom/plugins
目录下:
$ git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
修改 .zshrc
配置:
1. 编辑 vim .zshrc 2. 找到 `plugins=(git)` 这一行并增长 plugins=(git zsh-autosuggestions) 3. 从新加载配置 source .zshrc
命令高亮插件
安装:
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
修改 .zshrc
配置:
1. 编辑 vim .zshrc 2. 找到 `plugins=(git)` 这一行并增长 plugins=(git zsh-syntax-highlighting) 3. 从新加载配置 source .zshrc
首先安装RVM
,RVM 是一个便捷的多版本 Ruby 环境的管理和切换工具。
$ curl -sSL https://get.rvm.io | bash -s stable
更新RVM
$ rvm get stable
列出全部可安装的ruby
$ rvm list known
安装一个ruby
$ rvm install 2.6 --default
检查ruby版本:
$ ruby -v ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin19]
查看gem版本
$ gem --version
安装sass
$ sudo gem install sass
官网下载:navivat
相关破解连接:
虽然Mac下的scp命令能够完成文件的上传和下载功能,但若是开发机的登录须要通过跳板机时,scp命令就没有办法正常使用了。
$ brew install lrzsz
若是须要sudo
权限,命令前添加sudo
。
cd /usr/local/bin wget https://raw.github.com/mmastrac/iterm2-zmodem/master/iterm2-send-zmodem.sh wget https://raw.github.com/mmastrac/iterm2-zmodem/master/iterm2-recv-zmodem.sh chmod 777 /usr/local/bin/iterm2-*
打开iterm2终端设置。Profiles > Default > Advanced,找到triggers。编辑配置后重启iterm2。
Regular expression | Action | Parameters |
---|---|---|
rz waiting to receive.**B0100 | Run Silent Coprocess | /usr/local/bin/iterm2-send-zmodem.sh |
**B00000000000000 | Run Silent Coprocess | /usr/local/bin/iterm2-recv-zmodem.sh |
发送本地文件到远程服务器,在远端服务器上执行下面的命令:
$ rz -b
下载远端服务器的文件到本地:
$ sz 文件1 文件2 文件n
rar命令行解压工具
$ brew install unrar
解压:x表示解压
unrar x 压缩包
另外:rar压缩工具。
图形化界面。免费。