The Apple mac mini make a rather nice silent and quite powerful Windows box (there just isn’t any other hardware out there as good). The problem is if you install Windows 7 you have to keep a Mac OS partition if you use BootCamp which is a waste of drive space. The second problem is the new mac minis don’t have a DVD drive anymore so it is not possible to install from a Window 7 DVD. The final problem is you need all the drivers that Apple supplies, so even if you manage to install from a image it would not work.

It occurred to me that it might not be necessary to keep the MAC OS X partition if I installed from the BootCamp created USB installer. This would allow me to remove the Mac OS X partition in the Windows install process. I gave it a go and it worked. The basic procedure is as follows:

  1. Boot into Mac OS X Lion and use BootCamp to create the USB installer with the Apple drivers. You will need an Windows 7 iso image and a USB drive. I am not sure of the capacity you need for the drive, but the drive I used was 16 GB. Make sure you don’t have anything you want on the USB drive as it will be deleted in the process of creating the installer.
  2. Restart the Mac Mini holding down the option key and select the USB drive to boot.
  3. Windows 7 should start up and take you through the installation process. Select the custom installation and when it shows the hard drive delete all the Mac partitions and create a new partition for Windows. Continue with the installation as per normal.
  4. Once you are in Windows 7 go to the USB drive and install the Apple drivers.
  5. Now you have the drivers installed you can download and install all the Windows updates – so much fun :)
Sphere: Related Content

If you want to install centos 5.5 on an intel mac mini it is pretty easy. My guess is the same process applied to other Apple computers, but I have not tried it on anything other than a mac mini. The mac mini is a really nice little server that takes up no space and is totally silent – much better to live with than the dual xeon space heater I had to move out of my office.

  1. Boot off the Mac OS X Install DVD or from an external drive (I have a firewire drive with Mac OS X installed on it so this it is what I did). Go to the  Utilities folder in Applications and launch Disk Utility if booting off an external drive, or if booting off the Install DVD select  Disk Utility from the Utilities menu.
  2. Click on the disk you want to install CentOS on to, then select Partition tab, then select 1 partitions and choose MS-DOS (FAT) as the format. Then click options and select Master Boot Record. Then click on Apply when you are done. Don’t click outside of this tab before pressing Apply or you will lose the MBR setting.
  3. Once the partitioning is complete insert the first CentOS CD and reboot the mac mini.
  4. Go through the standard centos install as per normal.

On tip to watch for if you are behind a proxy like me is to not select to install the CentOS extras packages. What happens if you do is you get hung at this point of the install and will have to start over again from scratch. You can always install the extras latter by modifying the yum.conf file in /etc.

Sphere: Related Content

Installing Splint on Mac OSX

September 21st, 2010

Splint is a really useful utility to check your source code, but it doesn’t seem to be installed by default on os x. It is not too difficult to download the source and install except for the minor issue that it doesn’t build. The good news is it doesn’t take much to fix the build problem. Here are the instructions.

  1. Download the source from http://www.splint.org/downloads/splint-3.1.2.src.tgz
  2. Open the .tgz file by double clicking.
  3. Open a terminal window and cd to the splint-3.1.2 folder
  4. Configure by using ./configure
  5. Open the osd.c file using nano src/osd.c
  6. Scroll down to around line 500 and change the line __pid_t pid = getpid (); to pid_t pid = getpid (); then save the file (control-x).
  7. Type make install to install splint

You should now be able to use splint (eg splint foo.c) and have a look at how many little issues are in your code :)

Sphere: Related Content

I was faced with the problem of having duplicate emails in some of my very large folders in Mail (some of my mail boxes have over 80,000 messages). There are applescripts for finding and removing duplicate messages, but they are very slow (~100 messages a minute) and so are not really viable on very large mail boxes – at this rate it would take more than 5 days to process one of my large email folders.

One simple solution is to archive the mailbox and then use formail to strip out the duplicate messages, then importing the cleaned mbox back into Mail. This approach retains all the meta information like flags and attachments and is actually quite fast. The basic procedure is:

1. Rebuild the mail box. This is probably a good idea anyway.
2. Archive the mail box. This will save a copy of your mailbox in standard mbox format which then formail can process.
3. Open a terminal window and cd to the folder containing the new mbox archive.
4 . Run the following formail command. This will create a copy of the mbox (mbox_new) with the duplicate messages removed. This will take around 5 minutes to process 80,000 messages.
formail -D 100000000 idcache < mbox -s > mbox_new
5. Open Mail and Import Mailboxes. Select the mbox_new mbox. Once it finishes importing you will now have a new folder under Import with all the non-duplicate messages. It is a good idea to rebuild the folder before moving it back to where you want.
6. Delete the archive.

This approach is much,much faster and has the advantage of working on a copy of your email data so if anything goes wrong you won’t mess up your current mailboxes.

Sphere: Related Content

I use my macbook with an Apple 23 inch monitor at work and so I can’t use the inbuilt iSight camera. Since Apple stopped selling the external iSight camera there is not much choice for Apple compatible web cams since most of the web cameras on the market don’t come with Mac OS X drivers.

One surprisingly option is the xbox360 web cam. This external usb camera works without any drivers and just plugs straight in and works. I managed to pick up a brand new one on eBay for A$35. The quality is pretty good and it sits without any problems on top of my monitor. Nice work microsoft.

Sphere: Related Content

There is a problem with Bootcamp 2.1 in that you can’t install the Apple drivers under Windows XP SP3. I recently bought a new MacBook Pro and installed Windows XP SP3 from an image and then tried to update the XP hardware drivers using bootcamp 2.1. This didn’t work an instead gave a nice cryptic error 2762. It seems it is not possible to install the drivers manually either as windows can’t install the drivers for the wireless network, iSight camera, and trackpad.

The solution is to install XP from a SP2 image (luckily I had kept one), then install the drivers, and then upgrade to SP3. I hope this saves someone a bit of time.

Update. This has apparently been fixed in snow leopard. I guess another reason to update.

Sphere: Related Content