macOS 奇技淫巧

预览添加 webp 支持,视频导出一帧图片,重装系统,终端代理,快捷键,解决 VeraCrypt 字体模糊问题...

# 预览添加 webp 支持

复制插件到 ~/Library/QuickLook 没用,需要复制到 /Library/QuickLook 才行

# 视频导出一帧图片

一般的视频编辑软件没法紧精确到每一帧,所以只能借助 ffmpeg 命令行工具了。 使用 brew install ffmpeg 直接安装,使用 ffmpeg -i path/to/video.mp4 path/to/op%04d.jpg 转换成一帧一张 jpg 文件,也可以是无损的 png 文件。

# 重装系统

  1. 移动硬盘搞一个分区
  2. App Store 下载 Install OS X El Capitan.app
  3. sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/File --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction
  4. 重启按住 option 从刚才的分区启动
  5. 一系列设置

# 安装 homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# 安装 wget

brew install wget

# 安装 oh-my-zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

# 终端设置

## ~/.zshrc
export ZSH=/Users/keng42/.oh-my-zsh
ZSH_THEME="robbyrussell"
plugins=(git)

## adb
export PATH="/Users/keng42/library/android/sdk/platform-tools/:$PATH"
export PATH="/usr/local/sbin:$PATH"
## nvm
export NVM_DIR="/Users/keng42/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

## 终端代理
export ALL_PROXY=socks5://127.0.0.1:1080
alias setproxy='export ALL_PROXY=socks5://127.0.0.1:1080'
alias unsetproxy='unset ALL_PROXY'

## 快捷键
alias lean80='sudo lean up -P 80'
alias checkwifi='/Users/keng42/Code/Shell/wifi.sh'
alias toredis='cd /Users/keng42/Applications/redis'

source $ZSH/oh-my-zsh.sh

# 解决 VeraCrypt 字体模糊问题

右键软件图标,Get Info,取消勾选 Open In Low Resolution Open In Low Resolution 这时候是勾选上并且不可改变的 这时候就要:进入终端,进入软件包内,sudo 修改 info.plist 文件,添加

<key>NSHighResolutionCapable</key>
<string>True</string>

然后又有3个神奇的命令要输入:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /Applications/VeraCrypt.app
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -seed

问题解决 https://apple.stackexchange.com/questions/69038/open-in-low-resolution-checkbox-on-retina-macbook-pro-checked-and-disabled https://stackoverflow.com/questions/20426140/how-to-enable-use-low-resolution-on-retina-display-for-an-application-when-shi