Mac使用小技巧

解决brew无法下载安装包的问题

$ brew --cache

显示的是 /Library/Caches/Homebrew ,这是 brew 下载安装包的存放位置。

打开浏览器用梯子下载好包,复制到/Library/Caches/Homebrew下。

之前有下载到一半文件的替换掉,如果下载的包名称和brew安装过程显示包的名字的不一样再手动改成一样的。


删除 【系统偏好设置】->【通知】左侧的栏目

有时候通知左侧的栏目中会出现重复的图标,强迫症患者可以为此而疯狂。

# 打开终端输入
cd `getconf DARWIN_USER_DIR`
rm -rf com.apple.notificationcenter
killall usernoted; killall NotificationCenter

# 删除下面目录内所有文件.(可能没有)
~/Library/Application Support/NotificationCenter

# 重启电脑 (可能不需要)

Fix Google Chrome Update Failed (error 11) Issue on Mac OSX

If you’ve tried to update your Google Chrome and the update failed because of the error 11 issue, Then here’s a simple and easy solution that’ll let you update your Google Chrome again and fix the issue once & for all.

First try fixing with the following instructions on this page:

https://support.google.com/chrome/answer/111996?hl=en&rd=1

If it fails, try below:

  1. Close Google Chrome.
  2. Open Terminal window and fire the following command:
    $ sudo rm -rf /Library/Google && sudo rm -rf ~/Library/Google
  3. Open Google Chrome and It’ll show a yellow bar on top which would have a button to turn on the automatic updates, press that and it’ll ask for password to enter, once you’re done with that. You can now go to the about page of the browser and it’ll automatically start the update process.

What this does is, It simply removes all the Google Software Updater files which due to whatever reasons could’ve gotten corrupt or having issues with the automatic updater.

禁用仪表盘

defaults write com.apple.dashboard mcx-disabled -boolean YES && killall Dock

重新开启

defaults write com.apple.dashboard mcx-disabled -boolean NO && killall Dock

重置 Launchpad

defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock

重置会恢复 Launchpad 至出厂设置(苹果自家应用在第一页)

删除系统默认输入法

# 备份
cp ~/Library/Preferences/com.apple.HIToolbox.plist ~/Library/Preferences/com.apple.HIToolbox.plist.bak
# 在终端执行指令打开文件进行编辑(Xcode打开)
open ~/Library/Preferences/com.apple.HIToolbox.plist

AppleEnabledInputSources 项中找到系统自带输入法的节点,删除之。 重启Mac即可。

未完待续 ...