brew

参考:https://zhuanlan.zhihu.com/p/111014448


## 更新 homebrew-cask
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask

# 更换源
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

# 更新,由于已经 cd 到相应文件夹了,因此不需要通过 -C 指定路径了
git fetch --unshallow 

## 更新 homebrew-core
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-core

# 更换源
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
# 更新
git fetch --unshallow

记录: homebrew-core is a shallow clone

参考:https://zhuanlan.zhihu.com/p/351199589

Mac更新完系统后使用homebrew就报错:

lideMacBook-Pro:~ li$ brew update

Error: 
  homebrew-core is a shallow clone.

To `brew update`, first run:

  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!

解决办法:

cd /usr/local/Homebrew/Library/Taps/homebrew
rm -rf homebrew-core
rm -rf homebrew-cask
brew upgrade

使用脚本实现SSH免密


新建一个 .ssh 文件
vim pi4.ssh

添加如下内容
#!/usr/bin/expect -f
set user ABC
set host 123.123.123.123
set password 112233
set port 5000
set timeout -1

spawn ssh $user@$host -oPort=$port
expect "password:*"
send "$password\r"
interact

终端中运行一下命令即可
expect pi4.ssh