Working PDT with Eclipse Juno SR2 (4.2)

Juno SR2 brings some performance fixes that was causing heavy lag in responsiveness in the first release of Juno – which made me switch to Sublime for the majority of work.

Whilst PDT worked fine in 4.1, this could not be said of Eclipse classic 4.2 with PDT on top. I’m not sure if this is a common issue, but I eventually found the solution was to install the Eclipse for Java EE Developers edition. This comes with other useful plugins already, so it made my day.

Resetting Mac OS X

We were looking to give some old Macbooks to other people, so we wanted to reset it back to a vanilla state, without the original OS disc. This means performing:

1) Remove user data/profiles

2) Securely erase free space so undelete will not recover anything.

 

I found these links which helped when operating in single user mode (hold command + s at startup):

– resetting users and the installation: http://www.numlock.ch/news/it/how-to-reset-a-mac-os-x-installation/

– erasing freespace – http://sabiancrash.blogspot.co.uk/2011/06/how-to-run-diskutil-in-single-user-mode.html

Both can be achieved from the same single-user session. Once rebooted, the computer will launch the Welcome experience

On some newer macs, the diskutil utility may not work from single-user mode, so I ended up booting with a Mac OS X  upgrade USB (this one was for Mountain Lion for use on another computer) to use the DiskUtil GUI tool to clear the free space.

Note that applications will be left intact, so if you wanted to remove anything and tidy up the Applications drawer, you’d have to do this before removing the user profiles. These steps worked for an old G4 Powerbook and the original Macbook Air.

(this is useful too – https://discussions.apple.com/message/15701551#15701551)

 

Timing HTTP GET with curl

I was looking for a way to time the effect of PHP code changes, and using Firefox Firebug net timing becomes cumbersome quite quickly. The alternative route is to do this simply is via the commandline using one of the net tools.

This is a simple bash alias to retrieve total time to retrieve a web page (without the content nor headers) – place this into your ~/.bashrc file:

timecurl() { curl -s -o /dev/null -w '%{time_total}\n' $1; }

Usage:

timecurl google.com
timecurl http://username:mypassword@testsite.co.uk/page/

e.g.

> timecurl http://google.com
0.188

Meld

Out of the various visual diff tools I’ve used, Meld was the excuse to fire up the NX terminal to Ubuntu instead of using the natively run Windows tools like WinMerge or Kdiff3. Occasionally I’m not on my home network so I needed to find a way to have it running properly on my Windows 7 laptop. Unfortunately it isn’t available as a native Windows application, but it is written in Python with a number of prerequisites.

Thankfully, someone else resolved all the issues so it can be run natively –
http://blog.harvestofgnar.com/