Monday 30 July 2012

OS X Mountain Lion growling at git and rails

OS X Mountain Lion is a great update to the OS X lineup, however it is not without its problems. After you run the update you will find that your rails apps will no longer play ball if you so much as go near Gems accessed via git.
The reason... Xcode...
The fix...

Open App Store and check for updates. You should see an update available for Xcode that is compatible with Mountain Lion. Run the update. Xcode will now reinstall, but will remove the command line utilities including git... nice! 

Once the update of Xcode is complete open Xcode and go to Preferences -> Downloads -> Components and reinstall the Command line utilities.

Hey presto, bundle and rails should now be working again.

Added Note:
The Mountain Lion update also flattens the standard Apache2 config without making a backup first so if you have custom httpd.conf back it up first!

Sunday 15 July 2012

Linux : how to delete files from a certain month or year
To delete from a certain month (Linux never shows the year for files from this year) :
ls -la | grep May | /usr/bin/tr -s ' ' | /usr/bin/cut -d ' ' -f9 | xargs rm

To delete files from a certain year :
ls -la | grep 2010 | /usr/bin/tr -s ' ' | /usr/bin/cut -d ' ' -f9 | xargs rm