我每年在 Mac 大版本系统更新 2 到 3 个小版本后,会重新安装一次系统。Time Machine 全盘备份只用来恢复个人文件,软件以及相关的 Preference 都会重新配置。
为了配置尽量高效不遗漏,在这里记录一份,方便以后查阅。
终端配置(iTerm2)
- 导入提前备份的 iterm2 配置文件;
- 安装 DejaVu Sans Mono for Powerline 字体,字号14;
- 安装 brew 软件包管理系统:
1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- 安装 oh-my-zsh 命令行工具:
1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- brew 安装 auto-suggestions 插件,在 .zshrc 中启用插件:
1
brew install auto-suggestions
- brew 安装 zsh-syntax-highlighting 插件,在 .zshrc 中启用插件:
1
brew install auto-suggestions
- 在 .zshrc 中更改主题为 agnoster。
博客部署
- 克隆到本地:
1
git clone git@github.com:ricmarlene/ricmarlene.github.io.git
- 安装 node:
brew install node
- 安装 hexo 博客框架:
npm install hexo-cli -g
- 进入博客目录,安装 node 依赖包:
1
cd ricmarlene.github.io && npm install
- 查看 hexo 运行是否正常
hexo clean && hexo g && hexo s
- 可以安装 npm-check 和 npm-upgrade,升级 hexo 及相关组件,升级过后删除
node_modules
文件夹和package-lock.json
文件,重新运行npm install
命令:1
2
3npm install -g npm-check
npm install -g npm-upgrade
npm install - 配置 Git:
1
2git config --global user.email "mr.myric@gmail.com"
git config --global user.name "ricmarlene" - 配置 Deploy Key,上传公钥到Repository 的 Deploy Key 页面:
1
ssh-keygen -t rsa -b 4096 -C "mr.myric@gmail.com"
- 备份博客:
1
2
3git add .
git commit -m "..."
git push origin backup - 部署博客:
hexo clean && hexo g && hexo d
免密码ssh登陆另一台mac
1 | ssh-keygen //生成公钥私钥 |