软件
- VPN
- Chrome
- 豆包 / Ollama
- Word / Excel / PowerPoint(App Store 下载的需要激活)
- Adobe Acrobat / PDFgear
- 微信 / 飞书
- 腾讯会议
- 百度网盘 / 阿里云盘
- VS Code
- Zotero(配置)
- Spotify
- Snipaste
- Logi Options+(使用罗技设备需要)
VPN
cd
echo 'export http_proxy="http://127.0.0.1:7890"' >> .zprofile
echo 'export https_proxy="http://127.0.0.1:7890"' >> .zprofile
echo 'export all_proxy="socks5://127.0.0.1:7890"' >> .zprofile
echo "export GIT_SSH_COMMAND=\"ssh -o ProxyCommand='nc -x 127.0.0.1:7890 %h %p'\"" >> .zprofile
Homebrew
参考 https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/ 安装 Homebrew 。
cd
echo 'export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"' >> .zprofile
echo 'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"' >> .zprofile
echo 'export HOMEBREW_PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"' >> .zprofile
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"' >> .zprofile
source .zprofile
bash -c "$(curl -fsSL https://github.com/Homebrew/install/raw/master/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> .zprofile
source .zprofile
通过 Homebrew 安装 wget 、 tmux 等软件。
brew install wget
brew install openssh # 解决 sftp 不能用 tab 补全的 bug
brew install tmux
oh-my-zsh、oh-my-tmux、awesome-vimrc 的配置方法可以参考 Ubuntu 新用户创建与环境配置(oh-my-zsh / oh-my-tmux / awesome-vimrc)。
其他 Mac 上常用的命令行工具
brew install 7zip
brew install rar
Git
brew install git-lfs
Python
brew install pipx
pipx ensurepath
关闭当前终端,重启终端使路径修改生效。继续配置 pipx
pipx install argcomplete
autoload -U compinit && compinit
eval "$(register-python-argcomplete pipx)"
安装所需命令
pipx install pipenv
Docker
安装 Docker Desktop。
在【Settings - General - Configure shell completions - Automatically (edits your shell configuration)】点击【Install】。
在阿里云 容器镜像服务中,选择【镜像工具 - 镜像加速器】,依照【操作文档】进行配置。
安装 Open WebUI。
LaTeX
从 TUNA 下载并安装 MacTeX.pkg
。
参考 Perlbrew 安装
curl -L https://install.perlbrew.pl | bash
perlbrew install perl-5.41.9
perlbrew switch perl-5.41.9
安装依赖项
cpan YAML::Tiny
cpan File::HomeDir
参考 macOS 配置 LaTeX (MacTeX + VScode + Skim),在 VS Code 中安装并配置 latex-workshop
插件。
常见问题
-
Recipe terminated with fatal error: spawn latexmk ENOENT
可尝试重启 VS Code 或 MacOS。 -
Package minted Error: You must have 'pygmentize' installed to use this package
pipx install Pygments
aria2
brew install aria2
mkdir ~/.aria2
创建 ~/.aria2/aria2.conf
bt-enable-lpd=true
bt-save-metadata=true
bt-tracker=
continue=true
dht-file-path=${HOME}/.aria2/dht.dat
dht-file-path6=${HOME}/.aria2/dht6.dat
enable-dht=true
enable-dht6=true
log=${HOME}/.aria2/aria2.log
在 ~/.zshrc
中新建一个函数
aria2_update() {
sed -i '' "s@^bt-tracker=.*@bt-tracker=$(curl -fsSL https://trackerslist.com/all_aria2.txt)@" ~/.aria2/aria2.conf
}
其他
配置 Internet Accounts。
常见问题
禁止程序开机自动启动
Mac 上安装的一些软件总是擅自自动启动,在“设置”中也不能关闭,这时就需要在命令行中关闭。
Mac 使用 launchctl
管理程序。可以先执行 launchctl list
列出所有程序,从中找到相关的 Label
。例如,找到“小航”对应的程序
$ launchctl list
PID Status Label
...
719 0 cn.edu.buaa.xiaohang.launcher
...
然后需要查找程序的 plist
文件
$ locate cn.edu.buaa.xiaohang.launcher.plist
/Applications/buaa_xiaohang.app/Contents/Library/LaunchAgents/cn.edu.buaa.xiaohang.launcher.plist
/Applications/buaa_xiaohang.app/Contents/Resources/cn.edu.buaa.xiaohang.launcher.plist.old
/Library/LaunchAgents/cn.edu.buaa.xiaohang.launcher.plist
/Applications/
目录下的是程序内部文件,/Library/LaunchAgents/cn.edu.buaa.xiaohang.launcher.plist
才是我们要找的文件。根据安装方式的不同,这个 plist
文件可能出现在不同的位置,具体可以参考 https://zhuanlan.zhihu.com/p/596324385。
要禁止“小航”自动启动,可以执行
sudo mv /Library/LaunchAgents/cn.edu.buaa.xiaohang.launcher.plist /Library/LaunchAgents/cn.edu.buaa.xiaohang.launcher.plist.bak
无法打开应用
Mac 会禁止用户打开一些程序。为了绕开这种限制,可以执行
xattr -dr com.apple.quarantine /Applications/buaa_xiaohang.app