星期六, 11月 03, 2007

Hibernate on OSX

As on Tiger, we have already had the hibernate functionality. Apple call it "Safe Sleep". Some people might use "Deep Sleep" for it.

Safe Sleep is to use /var/vm/sleepimage for saving data in the RAM to disk (by default). And once you lost your power of Mac, Tiger will read the sleepimage and restore your working stage. But in Energy Saver, there's no option about this Safe Sleep functionality. Many people said that you can input root#pmset hibernatemode 3/0  to switch safe sleep on/off. What if I want to safe sleep then power off ( just like Linux and MS' system doing ) ? The answer is unclear. Until....

I saw the article about new options of Leopard's Hibernate and a "Hibernate Bear".
Now I understand, the Evil Apple just hide the power manager's functions again.
So, if you aren't interested in HOW TO CUSTOMIZE YOUR SLEEP MODE. Just try the Bear above first. The bear support 3 sleep modes. That may satisfy your need.
##CONTINUE##
For further tuning about energy saving, I tried to man pmset
It said that 
  • hibernate mode=0: This mode is to perform normal sleep. NOT safe sleep.
  • hibernate mode=1: This mode is to save data to sleepimage then shutdown.
  • hibernate mode=2: This mode is a SMART one. It will perform normal sleep when the battery is full. And when battery level is under "Hibernate Free Ratio"( Integer percentage ),  it will change to perform safe sleep. 
  • hibernate mode=3: This mode is to save data to sleepimage then sleep. If you lost power supply, OS X will use sleepimage to recover working state.
Because I use Macbook pro, and the energy saving is important for a notebook. So, I tuned as follows.pmset -b hibernatemode 2 hibernatefreeratio 5 
pmset -c hibernatemode 0

星期五, 11月 02, 2007

Parallels on OS X

最近試了將Parallels裝在Leopard上。有些心得與設定事項要注意。
  1. 因為Parallels有自動的post install,所以最好是用正版的Winxp安裝。
  2. 即使是用繁中的原版光碟安裝系統,在控制台/語言的設定中,卻是英文。這會造成一些亂碼與錯誤。比如 當你想要安裝程式時,卻出現了 NSIS Error 的錯誤。那麼請先去改成中文語系設定。
  3. Virtual Machine的設定從「Shared networking」改成「Bridged Ethernet」。速度會比較快一些。
  4. 聽說 usb的外接device會使得parallels不穩,但firewire就無此問題。
其它的小問題,等遇到了再來記錄~

星期四, 11月 01, 2007

TCP connections in OSX

隨著P2P分享軟體的增加,愈來愈多人使用這類軟體,使得本來的TCP連線數不夠用。
雖然調過Winxp上的TCP連線數,但是OS X上的要怎調整呢?

其實很簡單。因為OS X底層是採用FreeBSD的改良,所以調整系統參數的方法與FreeBSD相同。
使用sysctl這指令即可。
相關的文件可參考
Mobile01 【分享教學】使用sysctl 調校你的OSX (之一) 之二