A Django site.
October 18, 2009

Antonio Ognio
gnrfan
» Creating an Ubuntu LiveUSB from the ISO file in OS X

I’m going to install Ubuntu 9.10 in a couple of machines at home so I needed to create a LiveUSB for that since burning CDs is so old school and mostly wastes the disk. After doing a quick search for a graphic tool for that I ended up resorting to the good old Unix dd command for the task like this:


Click on the image for the full size view.

Steps go like this:

  1. Grab the desired ISO file from the Internet. Verifying integrity with MD5 is a good idea.
  2. Open a Terminal emulator window.
  3. Get the current list of devices by running “diskutil list”.
  4. Insert your USB key
  5. Determine the device node assigned to your USB drive by running “diskutil list” again (e.g. /dev/disk2)
  6. Run “diskutil unmountDisk /dev/diskN”. In my case the device was /dev/disk2.
  7. Use DD like this “dd if=/path/to/ubuntu-9.10-beta-desktop-i386.iso of=/dev/disk2 bs=1m
  8. Finally, eject the media by running “diskutil eject /dev/disk2″ and remove your USB drive when the command completes.
  9. And that’s it. If you have been following this steps, you should have a bootable Live USB with Ubuntu by now.

June 5, 2009

Enrique Llanos
kukin
Beyond Zarathustra
» 3 + 1 Apps for Mac Designers

Unlikely to follow twitter links, I’ve followed one due to the word “Mac” in it two days ago:

RT @DesignerDepot: 40 Mac Freewares and Open Source Software for Web Designers:  http://tinyurl.com/pu7o6g

I’m not a designer yet I’m very well versed in Computers and Operative Systems, plus I self-learned the basics of design some years ago out of curiosity.

So, regarding the twitt you see lines above I must say I recommend 3 + 1 apps which will completely overcome these 40 apps recommendations, and these are:

  1. Gimp for OS X (Open Source Software): Advanced app for image manipulation.
  2. TextMate (Paid Software): The best app for editing source code, it completely worth it!
  3. CyberDuck FTP (shareware): A truly complete FTP client, sends keep-alive bits throughout the communication.

+

  1. Imagemagick (Open Source Software): I under-use this app via a simple oneliner script I created to resize and change format, using it’s binary “convert”; Installed via Darwin Ports for Mac.

Of course these tools are quite far from the ultimate tools for designers, yet my list is much reasonable to -at least- try than the 40 apps recommended by DesignerDepot; no pun intended.

May 17, 2009

Antonio Ognio
gnrfan
» Running Mercurial on OSX with MacPorts

I just needed to check out some code from a Mercurial repo and had to have Hg installed on my MacBook so I went to easy and straight way and executed this command:

sudo port install mercurial

Everything worked as expected and Mercurial got installed. MacPorts had to download and build Python 2.5 which I didn’t have because I’m currently using Python 2.6 in order to test some Django apps with it but it wasn’t an issue because this doesn’t interfere with my current Python setup. The problem was I started getting this errors while attempting to use hg:

Traceback (most recent call last):
  File "/opt/local/bin/hg", line 25, in 
    mercurial.util.set_binary(fp)
  File “/opt/local/lib/python2.5/site-packages/mercurial/demandimport.py”, line 75, in __getattribute__
    self._load()
  File “/opt/local/lib/python2.5/site-packages/mercurial/demandimport.py”, line 47, in _load
    mod = _origimport(head, globals, locals)
  File “/opt/local/lib/python2.5/site-packages/mercurial/util.py”, line 93, in 
    _encoding = locale.getlocale()[1]
  File “/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py”, line 462, in getlocale
    return _parse_localename(localename)
  File “/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py”, line 375, in _parse_localename
    raise ValueError, ‘unknown locale: %s’ % localename
ValueError: unknown locale: UTF-8

So, after a bit of googling I realized I hadn’t properly set my locale information since I reinstalled Leopard. So adding this two lines to my $HOME/.bashrc which is also called by my $HOME/.bash_profile solved the issue:

export LC_ALL=es_ES.UTF-8
export LANG=es_ES.UTF-8

I’m posting this here for my own reference and for helping someone out there having this same issue.

September 8, 2008

Antonio Ognio
gnrfan
» Triple Booting Leopard, Hardy and XP on my MacBook

Since I got a Macbook around six months ago I planned a triple-boot setup but didn’t really do it until recently. One of the first things I did when I got the laptop was using Bootcamp to repartition the hard-drive and install Ubuntu. When I then wanted to add Windows to the mix I found out it wasn’t that easy after struggling a bit with partition schemes and installers that don’t mix so well. The result was I just gave up for some time resorting to run Windows from VMware Fusion.

A few friends that own Macs and do Windows and Linux are happy running the OSes inside virtual machines. I was not. Windows under VMware runs nicely and the Unity integration features are quite cool but since I got the laptop with 1 GB or RAM running heavy enterprisey development tools for Windows among other stuff wasn’t working that well. Besides, OS X is fine and before the triple boot setup I got mostly used to run it all of the time but from time to time I run benchmarks, show demos or give talks and I needed the real Linux running on top of the bare metal. So I went for the real thing :)

Since I’ve switched to this machine as my primary computer I needed more RAM and disk space so I upgraded it from 120 GB to 250 GB and from 1 gigs of RAM to 2 gigs. Since I was going to have Leopard installed in a brand new disk this was the chance to finally go for the triple boot setup.

So the story starts with Boot Camp, Apple’s utility tool for resizing the Leopard’s HFS+ partion and have Windows Vista or XP installed aside of Mac OS using the drivers included in the Leopard installation media. As you might guess, given the propietary nature of Apple, Boot Camp is not the most flexible tool around and demands the hard drive to be formatted as a unique HFS+ partition using the whole disk. The good news is the process of installing Windows with Boot Camp is pretty smooth and works correctly almost every time. My experience was not the exception.

There are quite a few guides all over the Internet proposing different strategies for having OSX coexists with Windows and Linux on the same hard-drive and almost all of them are very emphatic on following the instructions to the letter. I read most of them but given my previous experiences and the information I had gathered I went for my own approach with I’ll briefly describe in this post.

GUID Partition Table (GPT)

GPT is a modern partition scheme that is part of the Extentensive Firmware Interface standard proposed by Intel. This is the scheme Apple uses for all Intel-based Macintoshes and Leopard’s installer only agrees to install the OSX on a GPT-partitioned hard drive so that’s one of the first things you must be aware of. GPT is an alternative to the old and well-know MBR partition scheme most of us are used coming from a PC world. EFI is a replacement of the old PC BIOS. EFI uses GPT where BIOS uses MBR. Nonetheless, Boot Camp uses a mixed GPT-MBR partition scheme under EFI in order to simulate the PC BIOS and have BIOS/MBR-only OSes like Windows XP installed in the new Macs. That’s why you CAN’T use Windows partitioning tools you might be used to like fdisk. They’ll simply ruin the setup and you’ll have to start all over again by partitioning the hard drive under GPT.

The current versions of Ubuntu Linux, like Feisty or Hardy, support GPT-partitioned hard drives in the installer, so they are not a problem. Windows Vista being a new OS only seems to support this in some 64-bits versions. That’s why you’ll want to rely on Boot Camp for the Windows installation and then try to mess the less you can with the arrangements the software has made :)

Installing Windows

There are many guides around for this part. I’ll link here to Apple’s official instructions in the 101: Using Windows via Boot Camp with Mac OS X 10.5 Leopard article of their support site. When installing XP don’t even think of creating or deleting the partitions. At most you can switch from NTFS to FAT but I went for NTFS since Linux is already supporting it well and my partition was 60 GBs big. You can opt for the quick formatting option for reformatting the drive C: but don’t try reformating, I repeat, since you’re not installing over an MBR-partitioned standard PC hard drive.

After booting XP you’ll find the look is so lame compared to OSX or Linux with Compiz that you’ll want to make the appearance a little bit more decent so I turned on the ClearType option, the Royale theme, XPize and finally Y’z Shadow for adding extra transparency and drop shadows to the windows.

Since Macs only have one click you’ll find useful the tiny Apple Mouse utility for XP which switches the left and right click options while you’re holding the Ctrl key. Just run it from XP’s start folder adding the /s parameter to the executable path for avoiding the start dialog and you’ll have right-click working the same way as under OSX.

rEFIt

So after Windows install my MacBook was booting straight into Windows. Horrible! :( Yes, I could still choose from which partition to boot by pressing the right Option (Alt) key or setting my choice using the Startup disk dialog under OSX’s System Preferences but I wanted a cool graphical bootleader that soon would be spotting a cute Linux penguin so I went with rEFIT, a superb opensource bootloader for EFI-based hardware that dynamically detects your partitions and even bootable media.

I grabbed rEFIt as a DMG file and run the graphical installer under OSX. When I booted again it wasn’t working so I had to resort to running the manual installation instructions which are a breeze to follow using the OSX terminal app. Rebooted and the nice rEFIT screen was welcoming me featuring both OSX and Windows icons.

Installing Ubuntu

So at this point my Mac was dual-booting Leopard and XP but I need to add Hardy to the mix. Since the biggest partition was Leopard’s I had to shrink it in order to make space for Linux. There are a few options for doing this: I could have used the opensource gParted tool included in the Ubuntu Live CD or OSX’s own diskutil command under the terminal, or even the Disk Utility GUI under Applications/Utilities but I went with iPartition, a commercial product included in a Coriolis Recovery CD a friend had lend me. The partitioning worked nicely and I had 60 gigs for getting Ubuntu installed to the hard drive.

The problem here was the brand new partition for Ubuntu is physically the third one but Boot Camp will only want to boot Windows from the last partition, in this case the third. So the trick comes here: I booted the laptop with Ubuntu’s LiveCD which at disk point is offered as a boot option represented by rEFIT as a Linux penguin with a tiny CD icon and had the new partition formated as NTFS and Boot Camp’s windows installation copied to the third partition. Of course I had to do all of disk manually so I used mkfs.ntfs over /dev/sda4 to create the new partition, then mouted both /dev/sda4 (Boot Camp’s Windows installation) on /bootcamp and /dev/sda4 (new Windows location) on /windows and had all the files copied by simply issuing a “cp -r /bootcamp/* /windows” command and waiting for it to complete before starting the Ubuntu installer.

Then, when perform the actual Ubuntu installation I switched to manually setting the partition in which Ubuntu was to be installed, /dev/sda3 in this case, created no SWAP partition since many guides replaced it by a swapfile inside the main Linux ext3 partition and had GRUB installed not in the MBR but in /dev/sda3 and everything worked nicely.

Due to Ubuntu’s bug #222126 the Ubuntu’s installer clears the MBR and after rebooting you’ll get a “no bootable device” error when selecting the Linux or the Windows icon from rEFIT. I knew about this problem and the fix from my previous attempts so I didn’t panicked :) It only takes to run the eEFIT’s built-in partition tool to resync the GPT and MBR partitions and you’re done. At this point my system had a fully operational triple-boot setup. :)

Configuring Hardy to use the MacBook’s hardware

For this part I mostly followed the instructions at the MacBook Santa Rosa and MacBook Santa Rosa on Hardy pages from the Ubuntu wiki. Sound is working. Wireless is working too. The only thing I’m missing is having the laptop suspend correctly which is currently preventing me from using Ubuntu extensively when relying on the laptop’s battery. I’ll be looking into this issue soon and will be updating the article properly.

Conclusions

Triple-booting Leopard, Hardy and XP wasn’t an easy but a fun journy. Yes, it can take quite a bit of time waiting for the installations to complete and even much more configuring the system so I really helps to know what your’re doing since you risk loosing data or at least a good piece of your precious time. Was the price well worth for my? Definitely, yes. It’s not just all the cool kids who happen to be Linux geeks and own a Mac are doing this but the chance to use all of the system resources running under the proper drivers and being able to forget for the most part what is the hardware platform you’re using what has value to me. Of course, it all depends on your very specific needs. Due to academic reasons I do a lot of team work with other people and at some points we switch laptops or I have mine used by someone else to complete a task. In this situations I’m now booting into Windows and forgetting about any ocassional OSX interferences like switching to a different desktop using OSX’s Expose. It’s also way easier to have Windows run from it’s own partition and not a VM’s disk if you plan to install a ton of software as I’m having to do this days. So for me, it’s working nicely and I can still use Virtual Machines under any of the three OSes to virtualize any of the two others or a different one if that’s what I need. So i’m happy with the end result. :)

I really hope this post is interesting and useful to some of you out there on the internets :) For further reference most links are available from my Delicious account under the tripleboot tag.

August 17, 2008

Antonio Ognio
gnrfan
» Typing Spanish characters in Mac keyboards

I want to share this information with other spanish speaking users of Apple computers. Yes, this can be found in several places all over the web but republishing it once again won’t hurt anyone:

  • á = Opt + e, then a
  • é = Opt + e, then e
  • í = Opt + e, then i
  • ó = Opt + e, then o
  • ú = Opt + e, then u

For the ñ, hold down the Option key while you type the n; release and type n again.

  • ñ = Opt + n, then n

To place the diaeresis over the u, hold down the Option key while pressing the u key; release and type u again.

  • ü = Opt + u, then u

The inverted punctuation marks are achieved as follows:

  • ¡ = Opt + 1
  • ¿ Opt + shift + ?

¡Allí está! Realmente útil, ¿no? :)

July 20, 2008

Antonio Ognio
gnrfan
» Keyboard freezes on Mac OS X

I got a white Macbook Santa Rosa a few months ago basically because I wanted to have a long-period first-hand experience using OS X on proper hardware. I’m a Linux fan and FLOSS advocate and surely Apple is a gross propietary-minded corporation and yes, I know I should be rejecting their products as the plague but I’m also a curious geek and I came to the point where I was clearly feeling I was missing 1/3 of today’s desktop action if I only used Linux and Windows. So I bought it and can’t regret it, I’ve been quite happy so far.

It’s no news Apple computers just work. When you switch, you learn your way around the new system in the first couple of weeks. Of course you don’t get to know every aspect of the OS but you get to learn all the stuff you really care about and use everyday.

Macbook

So everything was really fine with Leopard until I started to notice this very rare keyboard freezes. Wait! Keyboard freezes? I guess I had never experienced something like that with Windows and Linux before unless it was a bad cable or the keyboard cord got disconnected so at the very first time the concept seemed a bit alien. I’m a geek and the most of the times I know may way around computers and even without the keyboard to perform some basic testing and diagnosis I concluded that most of the running software was doing just fine and you could continue browsing the net and doing anything else that only required the use of the mouse so this was something strange that only compromised the use of the keyboard. But having no keyboard is quite annoying! Specially for a Linux guy that has at least one terminal open under OS X in order to feel sane taking my daily dose of bash, vim, wget and a few other command line utilities I can’t live without.

I realized that the keyboard freeze got fixed when I closed the current session and started a new one. Despite the session fix finding I must admit I was worried the thing was some weird hardware issue and I was somewhat expecting it to be gone by itself because it was happing once every week or two weeks and I could handle that.

Now a couple of weeks ago this freezes started to happen more and more often and the last days almost daily. Sometimes I had too many apps opened or I was using Windows under VMware so I was really a hassle so I searched the web for a solution and quickly found the patches from Apple in the form a small 978K update that requires a bigger 110 MB update that upgrades the system to version 10.5.1.

The upgrade process requires you to reboot your Macbook twice: first after the upgrade to OS X 10.5.1 has been completed then after installing the keyboard freezes fix. I’ve been using the Mac for a while and the problem seems to be gone.

I’m posting this as a reminder to myself because I might be trying a full reinstall of the software in my laptop in a few weeks in order to get a clean triple boot system up and running and because someone else may find the post useful.