Ayrton, Diego get new stripes

This week I finally moved Ayrton (the iMac) to Snow Leopard and also managed to find the time to move up Diego (my 5+ years and still going strong Powerbook) to Leopard. Here’s a quick primer for someone looking to upgrade their Mac.

First, I prefer clean installs. No installing over the previous OS and carrying over stuff for me. I like to use this is an opportunity to wipe the stuff and clean up house. If you are anything like me, you keep around a lot of things thinking you’ll need them, but never do. This is the time for you to break free.

So here’s how I do it:
1) Create a bootable copy of the existing Mac using Carbon Copy Cloner onto an External USB/ Firewire drive. USB drives do fine for Intel Macs like Ayrton but a Firewire drive is needed to boot a PPC machine. Via Disk Utility ensure that your drive is using the correct partition scheme to be able to boot your Mac:

Disk Utility

If you want help partitioning your disk, refer this page.

Note: If you can live with non-bootable backups and would just like to have access to your old files, don’t worry about USB/ Firewire/ Partition Schemes and just backup to any drive that your existing Mac can write to.

2) Once CCC tells you that the cloning is complete, reboot your Mac and hold the option while it boots up. It will show you the list of drives you can boot off. You should see the external drive you just backed up on as one of the options. Select it and boot into that drive to make sure the backup you have works fine. This will serve as a fail-safe just in case something goes wrong with the new install and also gives you an option to boot into a full functional OS if you ever feel nostalgic! You’ll also be using this backup to copy back the stuff you need on the new install.

3) Once you’ve verified everything is as it should be, put in the Snow Leopard DVD (or Leopard or whatever) and reboot your Mac. Again, press the option key while rebooting and this time select the DVD drive. When you reach the Welcome Screen, from the “Utilities” menu, choose “Disk Utility”. Erase your current Mac drive – this is the part where you make a clean break. Then proceed with the setup as usual until it’s complete.

Note: I actually used Target Disk mode to install Leopard on Diego, since it doesn’t have a dual layer DVD reader. Will do a follow up post on how to do that.

4) There’s no step 4. You should have a faster, cleaner Mac!

Update: Remember to run “Software Update” on the first boot. Install all updates that are available and reboot your machine (if necessary). After reboot, run “Software Update” again. Repeat, rinse until there are no more updates available. If you are wondering why all updates aren’t available in the first shot, it’s because some updates are dependent on others.

Copying your old stuff
The first time you boot into your Mac you’ll be greeted by the Migration Assistant. Select “From a Time Machine backup or another disk”:

Migration Assistant

Select the hard disk you backed to. On the next screen, I like to select only “Settings” – this is part of the breaking free routine. This will copy your WiFi/ Network settings, time zone etc. Anything else I would need I like to copy manually.

Migration Assistant 1

Now you can manually copy the Applications you really need from your old Mac drive (or download latest versions from the Internet) onto the new. You can also copy the preferences for the same application from the Library/Preferences folder under the previous use to the current one, but most people won’t need that. The only preference file I remember bringing over was the one for Safari Stand and that’s cause I had configured a bunch of quick search shortcuts which I didn’t wanna do all over again.

Other things to note:

  • Passwords/ Keychains – If you want to carry over your saved passwords without any problems, I suggest you create a user with the same user-name and password as the previous Install. With that, you can simply copy the ~/Library/Keychains folder from the previous user folder to the current one and use them normally without any problems.
  • iTunes/ iPhoto – Simply copy the iTunes folder (~/Music/iTunes) and the iPhoto Library (in ~/Pictures) to the same location under the new user/ OS and you should be set.
  • Mails/ Calendars – Simply copy the folders Mail (~/Library/Mail) and Calendars (~/Library/Calendars) to the same location in the new OS and they should work without any problems.
  • This time I also created an Applications folder in my home folder where I keep all Applications I install. So that /Applications stays clean like the day I installed my OS. Not necessary, just an alternative way to organize your stuff.

If you’re curious, here’s a list of Applications I installed immediately after install (in the order they appear in my Applications folder right now):

  • Acorn – Image editor (Shareware, I have a license)
  • Adium – Multi-protocol chat client (Free)
  • Burn – CD/ DVD burning software for the rare occasions (Free)
  • Clip Menu – Clipboard manager allows you to have multiple items in the Clipboard. Recently switched to this instead of the Quicksilver plugin (Free)
  • Dropbox – Client for the easy to use file sharing service (Free)
  • Firefox – Not my primary browser, but need it for development (Free)
  • LittleSnapper – Image grabber, great for snapshotting entire web-pages (Shareware, I have a license)
  • Oilcan – PostgreSQL client. Pretty basic but does the job (Free)
  • Quicksilver – the grand daddy of all apps (Free)
  • Sequel Pro – awesome MySQL client (Free)
  • Skitch – another screen grabbing + quick sharing app (Free)
  • Skype – Voice Chat/ Calls (Free)
  • Transmit – Trying it out over Cyberduck for my SFTP needs (Shareware)
  • Socilate – A new Facebook/ Skype/ Twitter client, still in beta
  • Textmate – The best text editor on any platform – vi(m)/ emacs fanatics stay away (Shareware)
  • The Unarchiver – Does what is says, throw almost any format at it (Free)
  • Transmission – Torrent client (Free)
  • Tweetie – Twitter client (Shareware/ Free with ads)
  • uTorrent – Giving it a try, over Transmission above (Free)
  • VLC – Media Player that plays practically anything (Free)
  • Xcode

Plugins/ other stuff I installed:

  • ClickToFlash – Safari plugin that disables all flash items until you click on them! (Free)
  • Flip4Mac – To play those pesky WMVs in QuickTime (Free)
  • Growl – Notifications, Mac ishtyle (Free)
  • iStat Menus – An overview of the Mac in your menu bar (Free)
  • Letterbox – Outlook style 3 column view for Apple Mail(Free)
  • Macports – Allows you to install various *nix utilities in a hassle free manner (Free)
  • Perian – Allows QuickTime to play DivX and various other formats (Free)
  • SafariStand – Plugin for Safari that adds various goodies (Free)
  • USB Overdrive – I had some troubles with the software/ drivers Logitech shipped for Snow Leopard and found this one to be much more stable. Allows me to program the gazillion buttons on my mouse to various custom actions (Shareware)

I also installed all three of Parallels, VMWare Fusion and VirtualBox – still not sure which one I am going to keep for the rare occasion I need to dip into the dark side. You can simply copy the image file over from your previous OS and reinstall the software in case you have an image you want to carry forward.

Okay, that’s more than enough information – I’ll update this post and/ or do a new one in case I think of anything else.

Development on the Mac

Macs have long been popular with graphic designers and in the entertainment industry. Since the release of the original Mac OS X, and with every subsequent release, more and more developers are discovering that a Mac isn’t just something that sits in the corner and looks pretty. Let’s take a look at what Macs have to offer to the developer community.

Mac applications
If you want to develop applications for the Mac, needless to say, you’ve gotta do it on a Mac! The de-facto language of Mac developers is Objective C, an object oriented extension of C with Smalltalk like syntax. Objective C adds concepts like messaging and automatic memory management (with Objective C 2.0) to C. In other words, Objective C code is like pure C code with object oriented constructs. This makes the code readable for anyone with background in C.

If you are looking to write Mac applications, it’s looking increasingly like Cocoa is your only remaining friend – not that there’s anything wrong with it! For a long time Mac developers have had two options for developing native applications – Cocoa and Carbon. Carbon is the older options of the two, allowing users to write their applications in pure C/ C++. Many popular Mac applications like Microsoft Office and Adobe Photoshop are written in Carbon though with the release of Leopard Apple seems to be signaling that Carbon’s time is up (no 64 bit support for Carbon in Leopard). Thus, if you are starting off developing a Mac application in today’s world, you are well advised to stick to Cocoa. Cocoa is a collection of modern frameworks and APIs that allow you to build “Mac like” applications. As mentioned above, Objective C is the most popular (and Apple’s recommended) option for Cocoa developers, though one can also use languages like Python and Ruby (via bridges).

Apple complements these modern frameworks with ultra-modern developer tools. Xcode (the IDE) and Interface Builder are playgrounds that any developer would love to play in and are supplemented by nifty tools like Instruments that allow you to monitor your application performance in real time. All this, of course, comes with tons of documentation and sample code – think of it as MSDN without the pain!

Web Developers
Web developers have the advantage of developing in an environment that comes with a pre-installed industry standard web server (Apache) and a modern web browser (Safari). You can supplement your experience with popular cross platform tools like Dreamweaver or mac native stunners like Coda, that offer single-window web development experiences. You can test your web apps on a wide variety of browsers like Opera and Firefox (or it’s Mac only cousin Camino) that have their Mac native versions and even on Internet Explorer without going anywhere near a Windows machine via VMware Fusion/ Parallels or Boot Camp. Think small is beautiful? Take a look at Apple’s Dashcode, a tool dedicated for development of nifty web widgets.

The Ruby on Rails (RoR) community has taken to Macs in a big way – infact all “core” Rails team members use Macs! This is down to the relative ease of installing (and running) a wide variety of databases (MySQL, PostgreSQL, SQLite etc) and web servers (e.g. LightTPD) on a Mac as well as the emergence of a text editor called TextMate that has RoR specific “bundles” which make development a breeze. Ruby on Rails comes pre-installed on all Macs.

Java is both a strong development environment for the Mac in terms of the tools available and also a way for developers to bring their applications to the Mac platform. In terms of IDEs you are spoiled for choice with popular tools like NetBeans and Eclipse vying for place on your Desktop. Many popular cross-platform applications like Azureus and Oracle SQL Developer found their way to the Mac thanks to it’s strong Java support, which makes it easier for developers to port their Java applications to the Mac.

One thing to note for Java Developers is that all Java updates for the Mac are published by Apple and not Sun, as it does for other platforms. This means that often there is a slight lag between the time a major Java version is available for, say, Windows and Mac.

Mac OS X is a full POSIX complaint system, meaning you can do on on the Mac pretty much whatever it is that you can do on your favourite Unix/ Linux flavour. So go on use your favourite *nix tools (awk, sed etc.) and write shell scripts for your favourite shell – Korn (ksh), Bourne (bash) etc. You have the advantage of using powerful graphical text editors like TextMate, BBEdit, TextWrangler and others for writing/ editing your scripts if vi and emacs give you the creeps!

While not restricted to the *nix platform, both Perl and Python have strong *nix underlying philosophies. Mac OS X comes pre-installed with both Python and Perl. Affrus is a popular Perl IDE offering integrated and debugging support.

Oracle developers can get the Oracle client that allows them to connect to Oracle databases from their Mac. Or you can make your Mac into a database server by installing the Oracle server for Mac. Though there isn’t quite a TOAD (a popular tool on the Windows platform) equivalent for Mac in terms of the sheer volume of features that TOAD provides, Oracle’s very own SQL Developer and a third-party Mac native application called SQLGrinder are more than able deputies.

C/ C++
Mac OS X developer tools include gcc which you can club with your favourite IDE/ text editor to get a first class C/ C++ development experience. As far as libraries and code portability are concerned, your development experience would be comparable to that of developing on any other *nix flavour.

I am sure this is one sub-category that you never expected to see here. Truth is, however, you can use .NET Studio and whatever else it is that you use on your Windows machine, exactly the same way on your Mac to develop native Windows apps! This thanks to VMware Fusion/ Parallels that allow you to work seamlessly with Windows apps within Mac OS X, or Apple’s Boot Camp that allows you to dual-boot between Windows and Mac OS X.

Though you can develop web applications or widgets for the iPhone on any platform, if you are planning to build “real” applications that use the underlying OS technologies, you’ll need to develop via the iPhone SDK. The iPhone SDK, as of writing of this article, requires Mac OS X Leopard and does not run on Windows or any other platform. As part of the SDK iPhone developers gets the same set of tools as their Cocoa counterparts – Xcode, Interface Builder and Instruments – as well as an iPhone Simulator, to see how your application would actually behave on the iPhone.

Originally published at the CIOL developer network.

Translate .local hostname to IP address

You can have .local hostnames translated to IP addresses by installing Bonjour on the source machine i.e. the (windows) machine doing the lookup.

Saved me the trouble of changing the IP of my Powerbook in Synergy configuration on the Windows machine every time I got allocated a new one.

Doesn’t matter if you are part of a Windows domain, not part or whatever – just install Bonjour and you are good to go. That is the beauty of Bonjour.