網路已經有很多大大寫很多的參考資料,這一篇純筆記,用過 Linux 再用 Mac 覺得
Linux 其實很不錯了,除了 User Interface 差一點,真的非常自由,自由無價

系統調教

mount with noatime on SSD.

http://blog.philippklaus.de/2011/04/ssd-optimizations-on-mac-os-x/


請參考這一個 gist 調整成您要的 ,如果不喜歡這麼麻煩,有一個軟體,有幫你做這些工作,Chameleon SSD optimizer

個人是比較偏好,自己調整

https://gist.github.com/pklaus/931579#file-movetemporaryfolderstoramdisk_macosx-sh

設定好後, /tmp 應該是 Ram Disk 了,可以加大一點,到 1 ~ 2 GB ,把 Chrome 的 Cache 資料夾連結到 tmp

下面小改的 RamFS,用 1G RAM 當 /tmp ,並且加 /tmp/Chrome 來放 Google Chrome 的 Cache
到自己的資料夾 ~/Library/Cache/Google ,把 Chrome 砍了,製作 soft link 到 /tmp/Chrome
另外,我用 pmset 把 hibernatemode 設成 0 後,也就是不再使用 suspend to disk 的方式休眠,我另外把 sleepimage 砍了,用指令另 touch 一個新的sleepimage
再 sudo chflags uchg sleepimage ,看起來會像是這樣,這樣你的 SSD 就可以多出和記憶體一樣的容量


terry@terrytekiMacBook-Air ~ $ ls -al /private/var/vm/sleepimage
-rw-r–r– 1 root wheel 0 9 9 22:19 /private/var/vm/sleepimage




#!/bin/sh
# Create a RAM disk with same perms as mountpoint

RAMDisk() {
mntpt=$1
rdsize=$(($210241024/512))
echo “Creating RamFS for $mntpt”
# Create the RAM disk.
dev=hdik -drivekey system-image=yes -nomount ram://$rdsize
# Successfull creation…
if [ $? -eq 0 ] ; then
# Create HFS on the RAM volume.
newfs_hfs $dev
# Store permissions from old mount point.
eval /usr/bin/stat -s $mntpt
# Mount the RAM disk to the target mount point.
mount -t hfs -o union -o nobrowse $dev $mntpt
# Restore permissions like they were on old volume.
chown $st_uid:$st_gid $mntpt
chmod $st_mode $mntpt
fi
}

# Test for arguments.
if [ -z $1 ]; then
echo “Usage: $0 [start|stop|restart] “
exit 1
fi

# Source the common setup functions for startup scripts
test -r /etc/rc.common || exit 1
. /etc/rc.common

StartService () {
ConsoleMessage “Starting RamFS disks…"
RAMDisk /private/tmp 1024
RAMDisk /var/run 64
mkdir -m 1777 /tmp/Chrome
#RAMDisk /var/db 1024
#mkdir -m 1777 /var/db/mds
}
StopService () {
ConsoleMessage “Stopping RamFS disks, nothing will be done here…"
# diskutil unmount /private/tmp /private/var/run
# diskutil unmount /private/var/run
}

RestartService () {
ConsoleMessage “Restarting RamFS disks, nothing will be done here…"
}



解決外接螢幕,字糊掉的問題

http://ireckon.net/2013/03/force-rgb-mode-in-mac-os-x-to-fix-the-picture-quality-of-an-external-monitor

Bash ~/.bash_profile 設定參考
http://natelandau.com/my-mac-osx-bash_profile/

開發所需軟體套件,先安裝 Xcode 後,及他的 Command Line tools 後,再裝 homebrew

工具軟體

http://www.freemacsoft.net/appcleaner/ Application 移除安裝的程式

http://osxfuse.github.io/ Mac Fuse file system ,在裝一下他們家的 sshfs ,可以直接 mount sftp,這一個軟體可以不裝,後面一樣可以用 homebrew 安裝 sshfs

https://github.com/rowanj/gitx git 的圖形化介面,都用 Mac 了,有時候可以離開一下 terminal 了

http://www.sourcetreeapp.com/ 這是另一個 git gui ,功能有點多,個人喜歡簡單的東西

https://github.com/eczarny/spectacle 分割視窗螢幕,看看 Linux 多幸福,預設就有了,不用另外裝

ThinkerTool 調整系統預設字體大小的問題,如果你跟我一樣龜毛,有堅持的字體及大小

JDK

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Golang , brew install go

MySQL, mongodb 請用 brew 安裝

PostgreSQL 建議直接用 http://postgresapp.com/ 是 heroku 包好的 app,plv8 已經包進去了,不用再自己編譯,算是懶人法

ImageMagick 還是建議用 homebrew 安裝

brew install imagemagick

http://cactuslab.com/imagemagick/

另外像是 pdftotext 的小工具,可以安裝 poppler,這一些工具,都和 Linux 上面一樣

brew install poppler

VIM 環境

也是用 homebrew 安裝,可以先 brew info vim 一下,看一下可以下的 options,系統預設的 vim 不是很好

https://github.com/spf13/spf13-vim

iTerm , open source 在 Mac 上面的 terminal,使用起來,預設的熱鍵,及行為和 Linux 上面的比較接近,不錯用

http://www.iterm2.com/#/section/home


其他大多的開發套件用 homebrew 來安裝,python , mysql, mongodb, node.js , memcached , redis 等等

https://github.com/mxcl/homebrew

舉例,安裝完,homebrew 後,可以下指令,看看 node.js 有哪些版可以安裝,先 git checkout 後再安裝


terry@terrytekiMacBook-Air ~ $ brew versions node
0.10.17 git checkout d996e02 /usr/local/Library/Formula/node.rb
0.10.16 git checkout 1782834 /usr/local/Library/Formula/node.rb
0.10.15 git checkout 89e0a43 /usr/local/Library/Formula/node.rb





git checkout d996e02 /usr/local/Library/Formula/node.rb




brew install node


PS: 看起來,返樸歸真,只要有 Terminal 就可以了,感覺我不是在用 Mac,只是把 Mac 當 Linux 用,下指令用 brew 安裝套件的時候,有點回到許久前使用 FreeBSD 的年代,到 ports套件庫下面,打 make install 的感覺,只是現在電腦和網路都快了不少,這時候,還是覺得 Debian 的套件管理,強到一個不像話