installing osx from an external hard drive

For whatever reasons if you need to install osx from an external hard drive, here are the steps I have tried and verified. In my case I installed snow leopard onto a mac mini from an external usb hard drive.

First of all, go get the snow leopard image file in iso or dmg.

Then we will need to prepare for your external hard drive. We are going to erase its content so please make a backup first.

  1. Open up Disk Utility, select your external hard drive.
  2. Choose the Partition tab, then pick two partitions. For the first one, click Options then pick Guid Partition Table to make it bootable. Pick Mac OS Extended format. Then set it to 8Gb for your CD image. Name it “Snow_Leopard_Drive”.
  3. For the second partition, pick Free Space.
  4. Click OK to commit the setup.
  5. Now, click on the Snow_Leopard_Drive, the choose the Restore tab.
  6. Double click on your snow leopard CD image, a white drive icon should appear on your desktop. Drag that icon onto the Source field.
  7. Drag your Snow_Leopard_Drive icon onto the Destination field.
  8. Click OK to proceed.
  9. Put in your root password, then the CD image will be burned onto your Snow_Leopard_Drive.

osx random freezes

I have had my macbook pro 13-inch for about 2 years now. It’s been running very well until recently, it randomly freezes. The keyboard and mouse would not respond and I would be forced to do a hard restart. After a few incidences, I noticed that this often happens when I am watching a youtube video or any long videos on VLC. At first I thought it was some corrupt libraries in the kernel and so I re-installed osx, but the problem remains. Then I clicked around, trying to investigate… to my horror, it was actually that my cpu fan stopped spinning!

I have attached a picture here. This software is called “iStat” btw. The cpu fan is spinning at 2000 rpm, which is good. This is after I replaced the fan. Before the replacement, it was at 0 rpm. The cpu temperature was going up to 90 degrees in fahrenheit.

I did try to clean up my old fan, but it still didn’t spin. See pic below. So it could be that it just died. Well too bad, I got another fan on ebay for about $15.

Replacing the cpu fan is fairly simple. All it takes is to unscrew the bottom screws from the case, then 3 more screws to remove the fan. Be careful with the small socket on the motherboard, coz it’s very easy to drag that along with the fan cable/plug. I recommend to use something small enough to press on the small outer socket, then use a needle tip to lift up the plug. After the removal, just reverse the process to install the new fan.

Now my macbook pro is working perfectly fine again! My cpu temperature is now at 45 degrees.

To limit bandwidth in osx

There may come a time when you want to limit your http download bandwidth coz it’s taking up all your bandwidth. I came across two apps that try to accomplish this task but I am afraid to say they are too hard to understand. So let’s just do this in the terminal.

1. First, create a pipe/rule that allows 100KB/s
sudo ipfw pipe 1 config bw 100KByte/s

2. Then assign that pipe to port 80 which is the remote web server’s http port #. It’s src-port coz the data is coming into your computer.
sudo ipfw add 1 pipe 1 src-port 80

3. At this point, all your http download bandwidth will max out at 100KByte/s. You could then do other things like ssh’ing to your work place or whatever.

4. To clear the bandwidth limit, do the following to remove pipe 1.
sudo ipfw delete 1

All these can be done on the fly. No reboot nonsense.

For more info, google for “ipfw bandwidth throttle” or do a “man ipfw”.

Changing osx root password

I hope this will never happen to you. But if you ever forgot your root password, then follow these steps to reset it. I cannot guarantee this method will work for all versions of osx, but it worked for me on my mac mini 1.5 GHz model at least.

  1. Hold Apple+S when booting, you will then enter the single user mode
  2. Run “/sbin/mount -uw /”. If you read through all the bootup comments it’s somewhere in there. It basically enables you to make changes to your hard drive.
  3. Run “passwd”. Then put in your new root password twice.
  4. Run “exit”. The reboot process should begin. You are done!

Maximizing an OSX window

This is often a frustrating experience to many new osx users, especially those who have used windows for many years. Often times I am ok with what the green zoom button does, coz it actually does make the current window bigger but just not maximized… Like most people, I settled with moving the window to the top left corner, then dragging the bottom right corner…

Today, while trying to look at a map in preview, for some reasons I just thought that there got to be something that can maximize an osx window right. There got to be! How many years has Apple been in business! There got to be!

After some googling, I found this tool called Right Zoom. It just does the maximizing correctly! It simply fills up the screen with the click of the green button.

In addition, if you like shortcuts, you can set one up as well. The default is Cmd+Opt+E. Good enough. I’m pleased.

Though to make this program run every time, you will need to add this to your “Login Items”. I am pretty sure you know how to do it.

This is a very under-publicized application, and it should deserve more public attention.

Check out the tutorial to this tool at

Pulling from Git

Perhaps Git is still new, I couldn’t find any one-click solutions to simply pulling a copy from a git repository in osx. If you are new to git, and you are a osx user, and you just want to pull the latest code from a repository, you are at the right place. I will show you the quickest way to do just that.

1. First download git-osx-installer at
2. Install it (you will need root login). After that, you should have /usr/bin/git
3. Say you want to pull from git://
4. Make a directory, for example: mkdir myApp
5. cd myApp
6. At this point, you would want to do a “git clone git://”. However, I bet you will get some error messages. So read on. 😉
7. Type “locate git-core”, check to see that you have “/usr/local/git/share/git-core/templates/”.
8. Type “locate index-pack”, check to see that you have “/usr/local/git/libexec/git-core/git-index-pack”
9. Now, set the path: export PATH=/usr/local/git/libexec/git-core/:$PATH (or wherever git-index-pack is located at from step #8)
10. Issue this command: git clone --template=/usr/local/git/share/git-core/templates/ git://

This should probably save you some time googling around…

If you are doing more than just pulling code, you should probably add the path info into your bashrc file or so.