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.

Friday, 29 August 2014

Intellij tip - Joining multiple lines into one

There are times when you have some code with each statement on its own line, and you want to move it all onto one line.

CSS is where I've needed this the most.

You start off with some code like this:
And really want this:
Intellij has a very simple way to do this by using Ctrl-Shift-J - for more information, see http://www.jetbrains.com/idea/webhelp/joining-lines-and-literals.html

Monday, 10 February 2014

Finding a use for an iPad 1

I'd noticed that most of the recent applications in the App Store won't install on my iPad 1 anymore. They either need a gyroscope or IOS 6 or 7. My iPad is stuck on IOS 5.

The first problem with this is that I haven't found a way to browse the App Store for applications that ARE compatible. This is incredibly frustrating, since its just left to trial and error finding some that will work.

I'd heard about the 'download the latest version that is compatible' feature, so decided that since my iPad is in awesome condition I'd gift it to my parents - who wouldn't be needing the latest and greatest features.

This hasn't been so simple, and I suspect others might have the same problem so I've tried to document what I've found:

  1. Doing a 'reset' to erase the iPad (before gifting it to someone) will leave you in the unfortunate situation of not being able to install many applications very easily.
  2. At this point, it doesn't seem possible to install applications requiring > IOS 5 via the device - its not compatible so not allowed.
  3. So to work around this, you can use iTunes to 'purchase' applications. Since using iTunes doesn't seem to be aware of your devices, it'll let you purchase anything.
  4. Now you have some purchases, you can return to your device and open the App Store. Go to the 'Purchased' tab and then individually install each application. Hopefully at this point you'll get the 'download the latest version that is compatible' message.
A couple of notes here:

  • I did all of this while connected over the cable to the computer running iTunes.
  • When I first did it, the applications seem to hang while installing, and never completed installing properly. The solution to this was to delete the applications from the device, then return to the 'Purchased' tab and reinstall. (I think the first installation of the apps may have been due to an iTunes sync which failed and never recovered - presumably because they are not compatible. By deleting them and reinstalling them from the iPad itself via the purchased tab, I got the 'install latest compatible' message which resulted in success).
  • Update 1: I am experiencing a lot of crashes on the device - mainly with the App Store and iTunes. I don't know if this happened before I reset/erased the iPad or if it has just started happening now.
Some obvious things could be improved here:

  1. The App Store could let you filter by 'compatible with device x' e.g. only show me those applications that will work on my 'iPad 1'
  2. When you install apps from the device, it could just install the latest compatible version right there (bypassing the need to do anything special).
If I've got any of this wrong, I'd love to hear. It would be extremely useful to be able to EASILY continue using the iPad 1.