Skip to content

Instantly share code, notes, and snippets.

@BB9z
Last active July 2, 2020 03:43
Show Gist options
  • Save BB9z/8080138 to your computer and use it in GitHub Desktop.
Save BB9z/8080138 to your computer and use it in GitHub Desktop.
Mac OS X 系统重置后,参考配置恢复笔记

迁移文件,powertoys,system,config

顺序安装,恢复环境

终端

  • 首先安装 brew,中间可能会提示安装 Command line tool,必须先安装。命令
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

恢复之前安装的 package,如:

brew install autojump cloc ruby23 cpulimit wget
brew install chisel
brew install zsh
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
# 还原我的配置
echo "\nsource \"\$HOME/.config/zsh/my.sh\"" >> ~/.zshrc
brew install python
pip install shadowsocks
brew openssl swig libevent
pip install m2crypto gevent
~/bin/cfw.command

输入设备

  • 触控板更多手势,只留前三个
  • 导入BTT预设

等待安装下载可以做的

brew install highlight
defaults write com.apple.finder QLEnableTextSelection -bool true;
  • zsh 后续配置
brew install zsh-completions zsh-history-substring-search zsh-navigation-tools zsh-syntax-highlighting
# 修改开启的插件:autojump brew colored-man forklift gem history-substring-search pod
  • polipo 配置
brew install polipo

# 修改日志权限
sudo touch /var/log/polipo
sudo chown $USER /var/log/polipo

# 检查配置
polipo -v -c ~/.config/polipo/conf
  • 恢复文件关联
m ~/Library/Preferences/com.apple.LaunchServices.plist

添加

{	LSHandlerContentType = "public.folder";
	LSHandlerRoleAll = "com.binarynights.forklift2";
},
{	LSHandlerContentType = "public.unix-executable";
	LSHandlerRoleShell = "com.googlecode.iterm2";
},
{	LSHandlerContentType = "com.apple.terminal.shell-script";
	LSHandlerRoleViewer = "com.googlecode.iterm2";
},
{	LSHandlerContentType = "public.plain-text";
	LSHandlerRoleAll = "com.macromates.textmate.preview";
},
{	LSHandlerContentType = "net.daringfireball.markdown";
	LSHandlerRoleAll = "com.mouapp.mou";
},
{	LSHandlerContentTag = "mk";
	LSHandlerContentTagClass = "public.filename-extension";
	LSHandlerRoleAll = "com.mouapp.mou";
},

重启生效,想要立即生效可以使用下面的命令

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

系统类型列表可见: https://developer.apple.com/library/mac/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html

系统设置

Time Machine 忽略路径

打开配置文件:

open /Library/Preferences/com.apple.TimeMachine.plist

恢复:

/Applications
~BB9z/.cocoapods
~BB9z/Downloads
~BB9z/Music/iTunes/iTunes Media/Downloads
~BB9z/Music/iTunes/iTunes Media/iTunes U
~BB9z/Music/iTunes/iTunes Media/Mobile Applications
~BB9z/Library/Saved Application State
~BB9z/Library/Developer/Xcode/DerivedData
~BB9z/Library/Developer/Xcode/iOS Device Logs
~BB9z/Library/Developer/Xcode/iOS DeviceSupport
~BB9z/Library/Developer/Shared/Documentation/DocSets
~BB9z/Library/Containers/com.tencent.qq/Data/Library/Application Support/QQ/Logs

另参: http://apple.stackexchange.com/questions/25779/on-lion-what-files-are-excluded-by-rule-from-a-time-machine-backup

语音设置

Accessibility > Speech

可用的语音:

  • English(UK), Daniel
  • English(US female), Samantha
  • English(US male), Tom

到 /System/Library/Speech/Voices 删除不用的语音

Command

安装 shadowsocks

apt-get update
apt-get install python-pip
pip install shadowsocks

创建配置文件

cat /etc/shadowsocks.json

粘贴入:

{
    "server":"服务器IP",
    "server_port":443,
    "local_address": "127.0.0.1",
    "local_port":9050,
    "password":"密码",
    "timeout":120,
    "method":"aes-256-cfb",
    "fast_open": false,
    "workers": 300
}

启动:

ssserver -c /etc/shadowsocks.json -d start

停止:

sudo ssserver -d stop

优化系统 https://github.com/shadowsocks/shadowsocks/wiki/Optimizing-Shadowsocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment