Launch Sublime Text 3 from command line

Wiped and reinstalled OS X on the MBP, thus lost the shortcut to invoke Sublime Text on command line.

Thought I should document this so I won’t have to go through Sublime Text directories in Applications.

Open up Terminal and run the following (assuming 1. Sublime Text is installed 2. /usr/local/bin is in your PATH)

Step 1: Go to Terminal; Check whether /usr/local/bin in in your PATH

echo $PATH

Terminal should return the following

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

/usr/local/bin is located at the end of the string. You’re set!

Step 2: Run the following on Terminal

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin

Step 3: Test the setup by running the following:

subl .

This will kick in Sublime on the current directory.

 

OS X unable to read WD My Passport Ultra

(Or How To Read From A Slow Booting WD My Passport Ultra portable hard drive)

Recently, El Capitan and Sierra had stopped recognizing a WD Passport Ultra external USB portable hard drive that I have.

I had some really important data held inside which made me quite anxious about it. After scouring the intertubes [here], I had an assumption that a major surgery needs to take place before I can extract the data ever again.

The WD Passport Ultra has a PCB with a proprietary interface and I wasn’t able to attach a SATA to USB adapter to the hard drive. Also, the Passport Ultra comes with built-in AES256 encryption which meant I can’t read it directly when plugged into a SATA to USB adapter anyway.

I had even chucked the WD Passport Ultra into the freezer (freezing trick) that had worked before, all to no avail. Furthermore, the video above was quite telling about the recovery requirements, with the need for a PCB of the same version etc. Thus I had almost given up on the WD Passport Ultra.

Right before I decided to open up the hard drive, I had a job that required to forensically image a client’s data. A spark went off and I tried using a linux based recovery tool to read the portable hard drive.

Voila! 

I was able to mount the portable hard drive in readonly mode and was able to copy out the data. Of course, there is a need to sudo apt-get install hfsprogs as the drive was formatted in OS X, before mounting the drive in readonly mode.

Q: Why did a Iinux-based recovery tool managed to read the drive while full featured OS X couldn’t?
A: I suspect OS X will assume the hard drive as dead if it does not respond in an acceptable time.

Q: Why did the portable hard drive work previously?
A: Beats me. But since I was able to extract the data, I’ll leave it to the WD Quality Assurance division to give an answer.