Mac terminal tricks

语音

say whatever you want to say

网络

traceroute www.example.com // 显示路由

dig 
www.example.com // 显示dns leave hhmm // 设定提示

touchID

echo "auth sufficient 
pam_tid.so" >> /etc/pam.d/sudo // 激活终端 sudo touchID

代理

# 需要手动配置 client 的路由,且把
sudo sysctl -w net.inet.ip.forwarding=1

mas

terminal 管理 appstore
mas list
mas outdated
mas upgrade <app_uuid>

# 
Homebrew integration # If mas is installed, and you run: brew bundle dump --global --force --describe # brew install brew bundle install

asciinema & agg

通过ASCII-nema创建终端操作的GIF展示文件,实现简单分享和展示。
# Record and share terminal sessions
asciinema
# some other commands
# Ctrl+D: quit and save record

# 重放
asciinema play /some/path/tmpxxxxx-ascii.cast

# Asciicast to GIF converter
agg chunk.cast yes.gif

sips

scriptable image processing system[1].
sips -s format png image.webp --out image.png

hyperfine

cli benchmark tools
hyperfine --shell zsh 'for i in {1..10000}; do echo test; done'

hyperfine --warmup 1 -i \
-n "biome" "npx @biomejs/biome lint" \
-n "eslint" "npx eslint ." \
-n "oxlint" "npx oxlint@latest"

Date:
Words:
309
Time to read:
1 min