Friday, June 20, 2008

Recovering your MacBook

My MacBook Pro died on me last Thursday. This is a truly devastating moment where you start questioning your back up procedure and realise in a flash how royally screwed you are without your laptop.

It turns out I had an "Invalid node Structure", but it took me a while to reach this conclusion. Then I figured out that this wasn't just a data integrity issue, rather my hard drive was hosed. I got a lot of scattered information about how to recover a MBP in various forums and friends so I thought I would record my experience just in case I have to go through this again.

  1. You should try running in safe mode first. To do this restart the laptop (by holding down the power key for 5 seconds) and then hold down the [shift] key when it starts back up. This did not work for me, but if it does work you need to run "Disk Utility" (see below.)

  2. You can boot from a Tiger or Leopard install disk by inserting the CD, power down, then restart holding down the [c] key.

  3. When I first started booting from CD I didn't know you had to hold down the [c] key. I had a sinking moment when I couldn't get the CD to eject from the MBP. If you are in this situation you can try 2 things:

    1. Restart and hold down the track pad key. This worked for me.

    2. Restart and wait 10-15 minutes, the laptop will eventually spit out the CD. This also worked for me.

  4. Booting from CD takes a while but eventually you get a welcome screen. From here you can got to the Utilities menu and run "Disk Utility".

  5. Select your primary boot volume and hit repair. This will verify the disk and attempt to repair. It was at this point I was told I was a victim of "Invalid Node Structure".

  6. You have a backup right? Yes I do, so now the recommended course of action is to reformat the drive, reinstall Leopard and then restore from back up. One major gotcha to be aware of is that you need to format your primary disk in the same format as your back up disk. Your options are: Mac OS Extended (Journaled) or Mac OS Extended (Case-sensitive, Journaled). The formatting MUST match up.

  7. If you do not have a back-up, it is possible to save your data. You'll need to go into single user mode and run the command: fsck -fy. See this forum post for more info. Folks on twitter and IM also recommended Disk Worrior, this piece of software looks pretty awesome if you need it.

  8. Wait forever while the install DVD is verified.

  9. Once the installation starts you'll soon find out if your hard disk is screwed. Even though I ran the Disk Utility on my hard drive, it started making bad noises half way through the install and eventually failed.

At this point I realised I needed a new hard drive. Living in Malta there is no Apple 'Genius Bar' to take my laptop to so replacing my hard drive myself was the only option. Cracking open your MacBook voids your warranty, so only do this if you have no other way of getting the hard drive installed.

Before you start unscrewing, I recommend you you take a look at the various videos on youTube. I thought these two were pretty good (you can skip through the boring bits).

You will need a couple of tools to get your MacBook open. I got by with a philips head 2.4mm screw driver and T6 torx (star head) screwdriver. There are whopping 24 screws you need to remove before you can get the hard drive out, if you get lost about which go where check this guide out.

Once you have installed your new hard drive restoring your system from Time Machine is pretty easy, but lengthy (mine took about 4.5 hours).

  1. Boot from you Leopard CD (hold down the [c] key at start up).

  2. Select your language and hit the arrow button.

  3. Select Disk Utility from the Utilities menu.

  4. Format your new hard drive. Remember it needs to be in the same format as your backup drive.

  5. Once the hard drive is formated, exit Disk Utility.

  6. From the Utilities menu again, select Restore From Time Machine. You'll need to plug in your back up drive at this point.

  7. Select the backup you want to use and you are off.

Thank goodness for Time Machine, this whole debacle would have been a thousand times worse if I wasn't using Time Machine. While Apple's hardware can be flaky, having great backup software make up for a lot.

BTW thanks to everyone who emailed, twitted and IM'd me with suggestions and words of encouragement.

One bad Apple spoils the barrel

Following on from my Apple woes earlier this week, I think my MacBook Pro hard drive got corrupted last night. The issue has manifested itself by getting stuck at the grey Apple screen at startup and I'm struggling to get anything more out of it. On start up things whir and beep but the damn thing doesn't get past the Apple-grey-screen-of-indifference. It's as if my Apple devices are colluding against me this week. I am now in the midst of trying to fix this mess and cursing Apple all the way.

Wednesday, June 18, 2008

Dissecting Mice

In a fit of passive-aggressive rage against Apple, I decided to crack open my recently faulty Mighty Mouse. It was surprisingly hard to open because the thing had been glued shut (a $80 mouse is disposable according to Apple). After much prying and poking I got it open. This gave me sense of satisfaction that took me back to my childhood when I used to open up every gadget in the house to the dismay of my parents.
Anyway, I managed to clear out the dirt from the roller wheel but putting the thing back together was a fiddly task (much like it was in my younger years) and of course I had to glue the thing shut again to hold it all together. The good news is my mouse is working.

Here are some tips if you want to try this at home:

  • Do not remove the inner ring that the mouse glides on. There is no reason to and its something else you’ll have to glue.

  • Be careful when opening, the brown ribbon wire that attaches the scroll-ball is a bitch to put back in.

  • The scroll ball is housed pretty well, I think it would be easier to get a small screwdriver and run it around the scroll ball without opening the mouse up.

JBoss trying to reach for the clouds

JBoss have just announced a hosted offering on Amazon EC2. This is pretty similar to Sun’s announcement at JavaOne . JBoss are offering a monthly hosting plan plus a premium on the server time you use. I’ll be interested to see how this works out for them. My feeling right now is every OS and platform vendor will be offering a similar package in the next 6-12 months and then we'll realise that we want to avoid vendor lock-in... again.

We piloted a hosted offering almost a year ago, called MuleOnDemand, but felt we were too early to the table. Now we have a partnership with CohesiveFT (whom I’ve blogged about before), which means Mule users can already compose Mule-based applications online deploy them to Amazon EC2 as well as grab a VM image in any of the major formats from VMWare, XenSource, IBM, SUN, Oracle and Parallels.

Monday, June 16, 2008

Apple: Sexy, Sleek, Unreliable

I have been a Mac convert for over 4 years and bit-by-byte Apple have snuck their way into my home, office and pocket. I’ve always loved the fact that Apple have managed to marry function and form in away that makes me oblivious to spending money with them. Unfortunately, as I buy more Apple a nasty trend is emerging: their stuff breaks… a lot. I have been willing to ignore this trend because secretly, I want an excuse to buy the latest and greatest, but now it’s starting to bug me. Five minutes ago my “Mighty Mouse” scroll wheel broke. This is the third time this has happened and last Apple mouse I’ll buy. I just dug out a very old Microsoft mouse (one of the first with a scroll wheel) and it still works! (Though it is not wireless and cheapens the look of my desk). Last week, My partner in crime, Dave, was having problems with the Mac Book Air and has switched back to the Mac Book pro. And during JavaOne my iPhone crapped out and I had to replace it. That’s all in the space of just over a month. As much as I like Apple products, they are far from perfect, and these are the sorts of incidents that make me look elsewhere for my next gadget fix.

Wednesday, June 11, 2008

Mule and IntelliJ IDEA

As some may know, we are working on version 2.0 of our open source Mule IDE based on eclipse. However, with the new schema-based configuration in Mule, IntelliJ IDEA users (including me) get some great features to help them build mule applications quicker too.

In the most recent IntelliJ 7.0.4 EAP release they have fixed the XML editor so the full benefits of the Mule schemas can be realised. I'd like to thank the IntelliJ guys for this fix. It took them less than a month from us reporting the issue to them fixing it and doing a release. I think thats pretty fantastic!

Quick Introduction

Mule 2.0 XML configurations are defined in schemas. For every module and transport in Mule there is a schema that defines the configuration elements that can be used. For example the following defines the Mule schema (default namespace), the VM transport and the Quartz connector:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns=""


Essentially the schemas in Mule 2.0 provide an XML Domain Specific Language (DSL) for constructing integrations and service compositions. The benefits of this approach over the Mule 1.x approach is that:

  • there no longer class names in XML configuration files (unless you are plugging in a custom implementation)

  • all available attributes for a configuration element are provided in the schema and which gives you auto-complete in many Xml editors. Previously, developers had to look at the documentation or JavaDoc to figure out what properties to set

  • required elements and attributes are validated and enforced by the schema

  • attributes are typed making validation more robust

When editing a Mule Xml in IntelliJ IDEA, you will get full code-complete for the modules imported into your XML file:

While you are filling out the details of your connector you can quickly get help about the attribute you are adding by hitting Apple Key+J or Ctrl+J on Windows and you will get context help on that attribute.

The context help also works on configuration elements:

Unfortunately, these features do not currently work with Eclispe unless you are using the Altova Xml Spy Eclipse plugin or Oxygen Xml for Eclipse.

Creating new Mule XML files can be labourious since you need to define the namespaces and schema locations each time. You can greatly simplify this in IntelliJ IDEA by using ‘Live Templates’ (from the Options dialog). Live Templates are code snippets that can be inserted into any editor window simply by typing an abbreviation and hitting the Tab key. I have lots of templates set up but 3 are useful for creating new Mule configurations:

1. Mule Xml Configuration Template [m2]

This can be used in a blank XML document.

1. New Namespace [ns]

Use this to add a new schema namespace. When the template is inserted you just need to type the Mule module name , i.e. ‘jms’ or ‘http’ and then hit the Enter key.

1. New Schema Location [sl]

Use this to add a new schema location. When the template is inserted you just need to type the Mule module name , i.e. ‘jms’ or ‘http’ and then hit the Enter key.

Tuesday, June 10, 2008

Effective Product Demonstrations

Last week we had to give a demonstration of all MuleSource products working together. The requirements were open-ended and it required some planning to put the demo together. Like giving presentations, giving demonstrations is a skill that you learn only by doing. Ours went very well so I figured I would share some thoughts about it.

1. Understand your audience

You need to make sure that you know what your audience is looking to get out of the session. In our case the audience was technical, but understanding how to build the ESB was less important than how to manage and control it. This sort information drastically changes how a demonstration is presented.

2. Build a story

Our demonstration was about 1.5 hours and we had a lot of products to demonstrate. We didn’t want to bombard the audience with everything all at once even though the pieces were very much related. We decided to provide a big-picture view in the context of the story we were building and then sequentially go through each chapter of the story.

3. Keep it simple

A common mistake I’ve seen before is that it takes so long to introduce the reference application for the demonstration that the audience is confused before you’ve got to your real agenda. Usually, real world scenarios need to be simplified for demonstration purposes.

4. Introduce and summarise

The story should be broken into chapters, each one tackling a specific part of the demonstration. Each chapter should be introduced. We found it very effective to provide a diagram for each chapter to show how the pieces where going to be presented. After each chapter we summarized what was covered and allowed time for questions.

5. Present in pairs

It is very difficult to drive a live demo, answer questions and talk coherently on your own. It’s much better to have a co-pilot; one provides commentary for the presentation and fields questions while the other drives it and talks to the specific aspects of the demonstration.

6. Prepare, prepare, prepare

History is littered with demonstrations gone wrong; everyone remembers Microsoft’s numerous blue-screen-of-death incidents. Both presenters should run through the presentation at least a couple of times to iron out glitches and spot areas for improvement. You should also do a dry run with other people in the organization to get feedback and check timings.

7. Lock it down

You should not change any code using in the demonstration last minute. What may seem like an innocuous change may blow up in your face later. Like software releases, any changes will require a full run through.

8. Stay focused

When doing technical demonstrations you are likely to get a lot of questions. Sometimes these may take the session in a skewed direction. It’s up to the presenter providing commentary to keep the demonstration on track.

9. Have fun with it

I’ve sat through demonstrations in the past where I felt like the presenter was dead at the wheel. You need to believe in what you are demonstrating and put energy and enthusiasm in to it otherwise you will lose your audience. Having a co-pilot helps to facilitate more lively discussions.