Mac
允许任意来源
sudo spctl --master-disable
隐藏/显示 Mac 文件夹
chflags hidden /path/
chflags nohidden /path/
Finder 显示/隐藏 隐藏文件
command shift .
创建启动盘
1.格盘 名称:Sierra 格式:OS X 扩展(日志式) 方案:GUID 分区图
2.命令
sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Sierra --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction
时间很长,感觉要半个小时的样子
修改 Mac 默认截图文件名
https://apple.stackexchange.com/questions/53422/save-screenshot-with-my-own-name http://www.mycode.net.cn/platform/linux-unix/1398.html
/System/Library/CoreServices/SystemUIServer.app/Contents/Resources/zh_CN.lproj/ScreenCapture.strings
修改
<key>%@ %@ at %@</key>
<string>%@ %@ at %@</string>
重新转换为二进制文件
sudo plutil -convert binary1 ScreenCapture.strings
但文件受系统保护需要关闭保护
csrutil disable
reboot
没有执行操作
因为找到了更好的替代品 Monosnap
不过修改前面的文字很简单
defaults write com.apple.screencapture name $name
提示软件损坏
macOS 里面默认禁用了允许任意来源,通过这个命令重新启用
https://www.imore.com/how-open-apps-unidentified-developers-mac
sudo spctl --master-disable
重置 launchpad
http://osxdaily.com/2015/05/05/reset-launchpad-layout-mac-os-x/
defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock
会将所有 App 的位置和文件夹分组复原!!(本以为只是清除缓存)
移除 mac launchpad app
https://superuser.com/questions/372736/uninstalled-program-icon-stuck-on-launchpad-in-mac-os-x-lion
While in Launchpad hold down Ctrl+⌥ then click on the icon you wish to delete until a question mark appears over the icon. Drag to the trash. Empty Trash.
禁用触摸板
2018-01-22 10:07:34 MacBook 触摸板被摔坏了,用这个命令禁用
sudo kextunload /System/Library/Extensions/AppleUSBMultitouch.kext/
https://superuser.com/questions/606338/how-to-disable-trackpad-mouse-via-the-mac-os-x-command-line
Terminal 设置 proxy
https://askubuntu.com/questions/583797/how-to-set-a-proxy-for-terminal
.zprofile 配置文件
https://dmorgan.info/posts/mac-network-proxy-terminal
export http_proxy=`scutil --proxy | awk '\
/HTTPEnable/ { enabled = $3; } \
/HTTPProxy/ { server = $3; } \
/HTTPPort/ { port = $3; } \
END { if (enabled == "1") { print "http://"; server ":" port; } }'`
export https_proxy="${http_proxy}"
或者直接
export http_proxy='http://localhost:9999'
export https_proxy='http://localhost:9999'
sudo 使用 touch id
打开 /etc/pam.d/sudo
看起来像这样
# sudo: auth account password session
auth required pam_opendirectory.so
account required pam_permit.so
password required pam_deny.so
session required pam_permit.so
在顶部加上这个
auth sufficient pam_tid.so
修改文件创建时间/修改时间
touch -mt 201405181505 /Users/yangjunwei/Downloads/1.png
http://yangjunwei.com/a/1439.html
Mac 查看 proxy 信息
scutil --proxy
创建全局快捷键
How to create keyboard shortcuts to launch apps in macOS using Automator
开启 mac 重复按键
defaults write -g ApplePressAndHoldEnabled -bool false
Disable Mac typing Accent Menu
好像没什么用 Key repeat broken in macOS Sierra #687
修复蓝牙耳机有时断断续续的问题
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool Min (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 58
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 58
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
修改之后重启电脑,公司电脑跑完这些之后好像得到了改善
查看设置
defaults read com.apple.BluetoothAudioAgent
查看 CPU 型号
sysctl -n machdep.cpu.brand_string
查看 windows 的共享文件夹
- 在 windows 里启用共享
- 打开 Finder, cmd + k 输入
smb:192.168.x.x - 输入 windows 账号和密码
reset SMC
When and How to Reset Mac SMC (System Management Controller) 解决了内置声音消失的问题