HOWTO - Clone your Mac OS X hard drive
First of all, why do I need to clone the hard drive? Good question though. Here are a few possible answers:
- I have too much money to spend for a spare hard drive to clone my Mac hard drive.
- I want to have a bootable external hard drive, installing on an external USB hard drive is not possible.
- I want to upgrade my Mac’s hard drive, and I don’t want to do the installations and setup all over again
Obviously number 3 is my answer. I acquired a bigger capacity hard drive to upgrade my current 120GB hard drive in my MacBook. After some Googling around, I found an answer.
There is an Apple utility program called Apple restore or asr located in /usr/sbin. Connect your external USB hard drive and format it using Disk Utility. Open the Terminal in Applications -> Utilities. Type the following command line into the Terminal to copy your hard drive over your external drive.
% sudo asr -source /Volumes/OSX BOOT VOLUME NAME/ -target /Volumes/TARGET VOLUME NAME/
Replace “OSX BOOT VOLUME NAME” and “TARGET VOLUME NAME” with actual volume names. asr will take quite some time to copy the contents of hard drive to external hard drive. Get a cuppa, pop in your iPod earphone and relax.
When asr completes the execution, it will print a message:
asr: did not copy blessed information to target, which may have missing or out-of-date blessed folder information.
Then, bless your target drive with this:
% sudo bless -folder /Volumes/TARGET VOLUME NAME/System/Library/CoreServices
Now, the hard drive is bootable. Restart your Mac and hold down “option” key. A screen will appear allowing to choose which volume to boot from.
HOWTO - SCIM and Ubuntu Gutsy Gibbon
Ubuntu 7.10, code named “Gutsy Gibbon”, has been released. I just finished upgrading from Feisty Fawn (7.04) to Gutsy Gibbon. The upgrade (downloading, unpacking, removing, installing, configuring and cleaning) took about 6 hours to complete.
The upgrade was smooth and without any problems except it broke my scim. I have exhausted the search on Internet for a fix but was disappointed. So, I tried to experiment with a few methods based on the information I had on the Internet and came up a work around for this problem.
Referring to my Chinese Input HOWTO here, I assume you have installed scim in Feisty Fawn (7.04) and later upgraded to Gutsy Gibbon (7.10).
- Goto System -> Preference -> Sessions. Delete the “Input Method” as created in my previous HOWTO.
- Uninstall and install again scim and all suggested packages.
- Click on menu: System -> Preferences ->Sessions
- Click Startup Program Tab then [New] button.
- Name: Input Methods
- Command: scim -d
- Click [OK] button
- Logout and login again.
- Go to System -> Administration -> Language Support
- Select your language(s) support. In my case, Chinese and Japanese.
- Check the box at the bottom, Input Method, to activate complex characters input. Apply, uncheck it, apply and check again and apply then quit.
- Restart Language Support to make sure the box is checked.
- Logout and restart your system.
- Login and launch any application, e.g. gedit or Terminal. Right click and select “Input Method” and check “SCIM Input Method”.
- Now click on the “Input Method” tray icon on the top left of your screen to choose your desired language support and input method.
Now, you should be able to switch input method in some applications such as Terminal or gedit. It still does not work on every applications such as Open Office. To activate scim for every applications, use the command line (or Terminal):
- Check your locale:
$ locale | grep LANG=The answer would be something like below, which is in my case:
LANG=en_US.UTF-8 - Now, with the following command, insall scim-qtimm and tell your system you want to use scim for your input method in your locale:
$ sudo apt-get install scim-qtimm $ im-switch -z en_US -s scim - Logout and login again and start Open Office. You should now able to select your input method in every applications.
This should also work (with instructions from my previous post here) if you have a fresh installation of Gutsy Gibbon. Please let me know if this works for you.
HOWTO - Chinese input for Ubuntu
This HOWTO guides you to install scim for Chinese Input in Ubuntu with Gnome.
- Install the following packages:
- scim
- scim-chinese
- scim-config-socket
- scim-frontend-socket
- scim-gtk2-immodule
- scim-server-socket
- scim-tables-zh (option)
- xfonts-intl-chinese
- xfonts-intl-chinese-big
- ttf-arphic-gbsn00lp
- ttf-arphic-gkai00mp
- ttf-arphic-bkai00mp
- ttf-arphic-bsmi00lp
- Click on menu: System -> Preferences ->Sessions
- Click Startup Program Tab then [New] button.
- Name: Input Methods
- Command: scim -d
- Click [OK] button
- Logout and login again.
- You will see a new icon on the top right menu bar.
- Right click and select ¨SCIM¨ setup and activate languag/input support you need.
- Left click to choose desired input method.
HOWTO - Building GtkAda project with xcode
My current project (here) requires to develop a GUI application for displaying some JPEG images. I intended to develop a native Mac OS X GUI application using Carbon or Cocoa. Since there is no Cocoa binding in Ada, I narrowed down my option to Carbon. I hit on the wall of frustration where Carbon binding on MacAda.org is very old and supports only gnat-3.3 and PPC (I hope I am not wrong on this).
I have to turn to Gtk+ which will require GtkAda and X11 on Mac OS X. I compiled my test code written for GtkAda very well on console. But when I imported the codes into xcode project, it did not compile. I got the following errors:
error: "gtk.ads" must be recompiled ("a-except.ads" has been modified)
error: "gdk.ads" must be recompiled ("a-except.ads" has been modified)
error: "glib.adb" must be recompiled ("a-except.ads" has been modified)
error: "glib-object.adb" must be recompiled ("a-except.ads" has been modified)
error: "glib-type_conversion_hooks.adb" must be recompiled ("a-except.ads" has been modified)
error: "gtkada.ads" must be recompiled ("system.ads" has been modified)
error: "gtkada-bindings.adb" must be recompiled ("a-except.ads" has been modified)
error: "gtkada-c.adb" must be recompiled ("system.ads" has been modified)
...
I sought help from GNAT-OSX mailing list (September 2007 archive), but there was no avail. I spent many days investigating the cause of the errors. I found out that gtkada source codes would be compiled and produced .ali and .o files in the build directory when I used gnatmake to build my GtkAda application.
$ gnatmake testproject.adb `gtkada-config`
To build a GtkAda project in xcode, follow the instructions below:
- In the project browser, under the Group & Files column, locate Targets and the your project name. Right click your project name and select Add Link Binary With Libraries. Select GtkAda libraries from /opt/local/lib/gtkada and necessary libraries from /opt/local/lib.
- Select your project name and click on the Info button. In Build tab, select Search Paths under Collection. Include /opt/local/include/gtkada in Header Search Paths. Also include /opt/local/lib and /opt/local/lib/gtkada in Library Search Paths.
- Select Source in your project. Select Add to Project … in Project menu. Include all the GtkAda source files in /opt/local/include/gtkada.
HOWTO - Installing gnat-4.3 on Mac OS X
Perhaps someone has written this before but it seems no where to be found. So I just write a simple HOWTO about installing gnat-4.3 on Mac OS X.
My installation is on MacBook 2.16GHz Intel Core 2 Duo running Mac OS 10.4.10 with Xcode 2.4.1. Pre-requisition is to have Xcode installed before installing gnat-4.3.
- Go to MacAda.org to download gnat-4.3 and other necessary tools. Launch the installation in the disk image.
- Make the following softlinks:
$ ln -s /usr/local/ada-4.3/bin/gcc /usr/bin/gcc-4.3 $ ln -s /usr/local/ada-4.3/bin/g++ /usr/bin/g++-4.3 - Launch gcc_select:
$ sudo gcc_select 4.3
Xcode 2.3 and gcc-4.2 (Ada)
I have finally decided to update to Xcode 2.3 and gcc-4.2. There is not much information about how to install except from the MacAda mailing list. So, I decided to post the How-To here.
Here are the procedures:
- Uninstall previous Xcode installation by
$ sudo perl /Developer/Tools/uninstall-devtools.pl - Restart the computer
- Download and install Xcode 2.3
- Download and install gcc-3.3 Ada compiler from MacAda
- Download and install gcc-4.2 Ada compiler
- Unzip and untar the gcc-4.2 package with
$ tar -zxvf fsf-ppc-gcc-4.2.0-20060429.tgzor
$ tar -zxvf fsf-i686-ada-4.2-20060409.tgzdepending if you are using PowerPC or Intel Mac.
- Move the directory ada-4.2 to /usr/local
- Download and install Ada Plugin for Xcode and follow the instructions.
I tested Xcode by compiling some projects and it is great. But I still cannot manage to build Ada dynamic library with it. It looks like some problems with the flags. Here’s the error and warning messages I got:
warning -L: directory name (/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/darwin/default) does not exist
unknown flag: -Wl, -single_module


Listen to my podcast