本博客采用创作共用版权协议, 要求署名、非商业用途和保持一致. 转载本博客文章必须也遵循
署名-非商业用途-保持一致的创作共用协议.
很久没有更新博客了, 前段时间迷上了王者农药, 戒了农药后又重新入了暴雪爸爸暗黑3的大坑, 呵呵.
除此之外, 公司离职回来一直准备毕业论文、毕业答辩、毕业相关材料, 真是焦头烂额.
不过想想十九年求学生涯就要结束了, 即将AFK了, 简直幸福.
为什么要重装? Mac系统的乱七八糟的东西已经占据了90%的磁盘空间, 无法减少文件保持一定空闲磁盘空间, 这种情况已经严重影响了我的日常工作.
重装方案严格按照 Apple 官方文档 如何重新安装 macOS 执行.
系统偏好设置
1 2 3 4 5 6
| /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin /bin /sbin
|
软件安装
若不需要Xcode可直接跳过该步骤, 安装Homebrew时同样会自动安装Command Line Tools
- 通过App Store 安装Xcode
- 安装Command Line Tools
1
| $ xcode-select --install
|
1
| $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
安装Git
1 2 3 4 5 6 7
| $$ brew install git # SSH-KeyGen, 设置SSH密钥 $ ssh-keygen -t rsa -C "your_email@youremail.com" # 在Github中添加新生成的公钥, 验证是否成功请执行以下命令 $ ssh -T git@github.com
|
安装nodejs
1 2 3 4 5 6
| $ brew install nodejs # 安装nvm或者n作为nodejs版本控制工具 $ (sudo) npm install -g n # 如果不行, 则使用nvm进行版本控制 $ n 4.2.4
|
安装 Ruby
1 2 3 4 5 6
| $ brew install ruby $ rbenv install -l # list all available versions $ rbenv install 2.2.1 # install a Ruby version $ rbenv global 2.2.1 # set the global version $ rbenv versions # list all installed Ruby versions
|
1 2 3 4
| $ gem sources --add https: $ gem sources -l https: # 确保只有 gems.ruby-china.org
|
安装vim和MacVim
1 2 3 4 5
| Step 1. Install homebrew from here: http://brew.sh Step 1.1. Run export PATH=/usr/local/bin:$PATH Step 2. Run brew update Step 3. Run brew install vim && brew install macvim Step 4. Run brew link macvim
|
1 2 3
| $ brew install zsh # 安装oh-my-zsh $ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
- 更换oh my zsh主题在
~/.oh-my-zsh/themes/路径下, 在zshthem网站进行主题预览
- 安装autojump, 一键跳转到目的目录, 不再不停的cd
- 安装trash, 不再用rm命令.
1 2 3 4
| # 安装autojump $ brew install autojump # 安装trash $ npm install --global trash
|
持久化SSH连接, 安装mosh
1
| $ brew install mobile-shell
|
安装python
1 2 3 4 5 6 7 8 9 10 11 12
| $ brew install python Pip and setuptools have been installed. To update them pip install --upgrade pip setuptools You can install Python packages with pip install <package> They will install into the site-package directory /usr/local/lib/python2.7/site-packages See: http:
|
安装安装 MongoDB, MySQL
1
| $ brew install mongodb mysql
|
设置开机自启动「可选」:
1 2 3
| $ mkdir -p ~/Library/LaunchAgents $ ln -sfv /usr/local/opt/mongodb $ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
|
.zshrc文件配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| alias zshconfig="vim ~/.zshrc" alias rezsh="source ~/.zshrc" alias ohmyzsh="cd ~/.oh-my-zsh" # The default command paramters alias vi='vim' alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias bc='bc -l' alias wget='wget -c' alias chown='chown --preserve-root' alias chgrp='chgrp --preserve-root' alias rm='rm -I --preserve-root' alias ln='ln -i' # Colorful grep output alias grep='grep --color=auto' export GREP_COLOR='1;33' # Colorful ls export LSCOLORS='Gxfxcxdxdxegedabagacad' ls='ls --color=auto' # autojump [[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
|
安装Sublime Text
- 安装Sublime Text 3
- 安装Package Control
- 自定义配置Settings
Sublime Text 3 安装Package Control的程序
1
| import urllib.request,os;pf = 'Package Control.sublime-package';ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) );open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
|
常用收费软件
- Alfred 2(效率神器)
- Dash 3(程序员专用-文档查询)
- CleanMyMac 3(电脑清理软件)
- PopClip(选中即复制)
- Near Lock(靠近解锁软件)
- Bartender 2(状态栏图标管理器)
- Manico(更方便的软件切换软件)
常用免费软件
命令行管理Wifi
Managing WIFI connections using the Mac OSX terminal command line
参考链接