Thursday, August 30, 2012

Prioritize ethernet over wifi in macbook air

  1. System Preferences > Network
  2. Simply drag & drop to reorder

Monday, August 20, 2012

Recovering Git Projects from Time Machine

  • Recently I lost my development machine due to an upgrade to Mountain Lion. Sadly I had not backed up before performing the upgrade but I did backup before taking the machine to have its OS fixed. Even after three trips to the Apple Store's "Genius Bar" ... it continued to be an epic failure because recovering from the time machine backups yielded the same unusable experience once again.
  • I decided to recover the data piece by piece starting with my Git projects. I loaded the time machine file as a hard drive and copied the projects whole by dragging & dropping them into a similar file system location.
  • But when I performed a simple integrity check such as "git status" it led to messages like: "fatal: Not a git repository git repository"
  • Some basic searches led me to realize that I had to take a closer look at the .git directory in question:
  • First thing I realized was that my submodule that was causing trouble did not have a .git directory but had a .git file instead! Inside this file was a gitdir key and a path which redirected to a location in the parent git project.
    gitdir: /Users/olduser/gitProjects/myParentProject/.git/modules/myChildProjectModule
  • Afterwards, the solution was simple. The path for gitdir had an old username in it, which did not represent the current folder structure. Simply correcting the username in the path of the recovered file to the current one, fixed the issue.
    gitdir: /Users/currentUser/gitProjects/myParentProject/.git/modules/myChildProjectModule

Tuesday, August 14, 2012

Replacing X11 with XQuartz on Mountain Lion

  1. It is a bit of a surprise to realize that X11 is missing from your system after an upgrade to Mountain Lion. Apple does a good job of pointing the user to XQuartz but something critical is lacking!
  2. Apparently the installation (X11 2.7.2 - 2012.06.01 - First release supported on Mountain Lion) needs to be run twice in order for it to be successful.
  3. The first time it asks for a system restart after which the programs which are supposed to pick-up on and start using it are still asking dumb question like "Where is X11?"
  4. If you run the installation a second time though, it will now place an app called XQuartz in your system and you can launch it from Spotlight.
  5. Afterwards, you are no longer asked the question: "Where is X11?" ... the dependent applications simply work :)

Thursday, August 9, 2012

Upgrade mountain lion, macports, xcode (4.3 to 4.4)

Upgrade Eclipse to WTP

  • Upgrading eclipse to its WTP (Web Tools Platform) counterpart can often be quite a painful process as you can run into compatibility issues when Eclipse is done calculating the dependencies. Often when this happens its an indication that you need to figure out the exact release of your Eclipse installation and then add the corresponding WTP url that will allow for downloads matching that version.
  • I went to look in the About section of Eclipse but that only told me Eclipse SDK Version: 3.7.2 and I didn't find that very helpful for Google searches. But then I noticed that on the splash page, which launches before Eclipse comes up, it said Indigo.
  • This quickly led me to perform a Google search and add the appropriate URL for downloading and installing WTP platform. Afterwards with only that URL selected as the repository for the upgrade, there were no dependency errors at all :)