Home

A Mac User's Notes

Updated 2010-07-05.

The notes here are accumulated everytime I got a problem with Mac. Most of the time, the answer could be found in google search results.

General

How to enable fast user switching?
Enable fast user switching in APPLE->Preferences->Accounts There will be account name of the right top of the menubar.
key shortcuts
Use SPACE to page down, SHIFT-SPACE to page up. COMMAND-LEFT move to line begin, COMMAND-RIGHT move to line end.
How to show safari debug menu?
defaults write com.apple.Safari IncludeDebugMenu 1
Format file system
sudo newfs_hfs -v 'Windows' /dev/disk0s3
How to restore a custom firware of iphone?
In itunes, option-left click on the restore button to select a custom restore firm ware. The custom firmware should be saved to be used in future. Do not update too often. Apr 15, 2010.
How to convert wav to aif?
  1. Open iTunes.
  2. Import your .WAV files into iTunes, by choosing File -> Add to Library.
  3. Open iTunes Preferences. On Windows, choose Edit -> Preferences, and on the Mac, Choose iTunes > Preferences.
  4. On the General Settings tab, click the Import Settings button. In the pop-up dialog, select "Import Using AIFF" and click OK.
  5. In the song library, select the audio track you want to convert, and then from the Advanced Menu, select "Create AIFF version."

How to make screenshot

Command+Shift+3 Capture entire screen and save as a file
Command+Control+Shift+3 Capture entire screen and copy to the clipboard
Command+Shift+4 Capture dragged area and save as a file
Command+Control+Shift+4 Capture dragged area and copy to the clipboard
Command+Shift+4 then Space bar Capture a window, menu, desktop icon, or the menu bar and save as a file
Command+Control+Shift+4 then Space bar Capture a window, menu, desktop icon, or the menu bar and copy to the clipboard

iTunes doesn't recognize my iPad/iPhone

This happens after upgrade to snow leopard. I have to reinstall iTunes everytime! I follow the guide on apple support, but it doesn't work:-(

After several weeks, I install Software Updates, and it suddenly works again.

Emacs

Emacs has been very important to me. So when I moved to Mac, I do want to keep the look and feel as close as possible to the way I used it in windows.

First, I dislike the anti-aliase blur like fonts when I am writing code. I kind of get used to clear little letters. Download UCS-fonts . Download FontForge and convert bdf to apple font file. 7x14 looks good.

(setq default-font "-apple-Fixed-medium-normal-normal--14--*-*-m-0-iso10646-1")
(setq mac-allow-anti-aliasing nil)
Small fonts allow more content especially if you don't have an extended display.

In snow leopard, you have to run the following command in terminal:

 defaults write org.gnu.Emacs AppleAntiAliasingThreshold 100 

Xcode

Where is xcode preference file?

Just like all standard preferences it is under your ~/Library/Preferences directory with a file name matching the applications bundle identifier. ~/Library/Preferences/com.apple.Xcode.plist

Font and Colors

I don't know why, but when writing code in an IDE, I prefer Fixedsys font. Maybe it is because that when I learned to program, we were using VC6. And that makes a strong impression to me that code should be written that way. You can find an open source fixedsys font here.

The colors I used:
background 255 255 255
comment 0 128 0
strings 255 0 0
keywords 0 0 255
selection 255 255 0
This color theme is too bright and eyes may be uncomfortable after long time coding. So I rely more on Emacs to write code, while xcode is mainly for debugging purpose.

IMHO, VC6 and VB6 has the best IDE design, clear and concise. Especially VB6, I think it is even better than VC6.

Capture screenshots from iPhone simulator

  1. In simulator window, press CTRL + COMMAND + C;
  2. Then in Preview, New from clipboard.

Other stuff

I have to upgrade to snow leopard, because xcode 3.2 doesn't support leopard anymore. Fortunately it saves about 10G disk space over leopard. It is uncommon nowadays. (2010-05-11).