Tuesday, 30 December 2014

Enabling FileVault on Yosemite

Read the full details here before doing anything: http://support.apple.com/kb/PH18637?viewlocale=en_US

Enabling disk encryption on OSX Yosemite turns out to be a straightforward process. Simply enable it through Setting/Security & Privacy/FileVault - if you chose not to let your iCloud account unlock your disk (for when you've forgotten your password) you'll have to keep a safe record of the recovery key (it sounds like you only get one oppourtunity to record this) - this triggers a reboot, and then when you log back in you'll be able to monitor the progress of file encryption from the same settings panel.

I have 2 MacBooks:

  • July 2014 Apple MacBook Pro, 2.6GHz Quad-core Intel Core i7, Turbo Boost up to 3.8GHz, 16GB 1600MHz DDR3L SDRAM, 512GB PCIe-based Flash Storage
  • January 2011 Apple MacBook Air, 13 inch display, Core 2 Duo 1.86GHz, 4 Gig RAM 1067 MHz DDR3, 256 Gig SSD
Since disk speed is king, I wanted to measure the effect of enabling FileVault so I found this benchmark script to hopefully capture a meaningful before and after state: http://www.amsys.co.uk/2013/blog/using-command-line-to-benchmark-disks/#.VKDxQsAGA

Unfortunately the purge command now needs to be run as sudo - before I enabled FileVault I ran it without sudo so I didn't get accurate read results. I hope though that the write values are accurate - I did multiple runs just to capture a feel for the variability:

Before FileVault (without sudo purge, read results were invalid)

MacBook Air:
  • Write Speed is: 211.474 MB/sec
  • Write Speed is: 211.479 MB/sec
MacBook Pro:
  • Write Speed is: 749.875 MB/sec
  • Write Speed is: 747.208 MB/sec

After FileVault (with sudo purge, read results look reasonable)

MacBook Air:
  • Read Speed is: 177.373 MB/sec
  • Read Speed is: 179.464 MB/sec
  • Write Speed is: 162.953 MB/sec
  • Write Speed is: 162.258 MB/sec 
MacBook Pro:
  • Read Speed is: 764.053 MB/sec
  • Read Speed is: 762.525 MB/sec
  • Write Speed is: 665.999 MB/sec
  • Write Speed is: 692.193 MB/sec
IF this benchmark is valid, taking the BEST case (smallest difference) for write speed on the MBP (747-692) indicates I've lost 55 MB/sec or approximately 7%.  

I was hoping for a more negligible difference, but the real test that matters will be if I notice any significant degradation. 

Friday, 26 December 2014

Customising what gets included from bower dependencies (Brunch)

Sometimes you'll find you need to customise which files get included from a bower dependency.

For example, when using the moment.js library, you'll see (in bower_components/moment/bower.json) that by default 'moment.js' is the only file included:

In my case, I'm using brunch to build the project and I'd prefer to include moment.min.js - plus I want to selectively pick which moment local files to include.

This turns out to be quite easy - brunch understands bower overrides, so in your projects bower.json all you have to do is include an override which tells it which files to use from your dependencies:

Resetting your android device pin

If you've forgotten the PIN for your android device, you can reset it at https://www.google.com/android/devicemanager.

This page lets you choose from your registered devices (if you have more than one). From here you can see when it was last used, and where. You have the option of 'Ring', 'Erase', and 'Lock'. Choosing 'Lock' lets you provide a new pin - so next time you access it the new pin should be active.