Thursday, June 30, 2016

Chromebook (+ Crouton) - first impression

I have been considering whether to buy an Android tablet with a keyboard or a Chromebook. While most of what I need to do at home on a daily basis can be done inside a browser on either a tablet or a Chromebook, two interesting Chromebook "features" swayed my decision: 1) one can supposedly run Linux on Chromebooks 2) one will soon be able to run Android apps inside ChromeOS. So I went and bought an ACER CB5-311 Chromebook. At £140, it is certainly very competitively priced.

During the first two days, I

  • used the browser heavily for GMail, GDocs, Slack, and Evernote
  • published my first Medium post
  • used Pixlr Web to do a fair amount of image editing
  • installed Ubuntu via Crouton
  • installed Heroku CLI inside Ubuntu to create a Git clone of my website
  • used Zed Code Editor for editing some of these HTML and JS files inside ChromeOS
  • pushed these changes live using Git inside Ubuntu

The physical experience of using the Acer Chromebook is a far cry from that of using a MacBook Air. E.g. the touch-pad action isn't great and why is it that only Apple can design a light-weight laptop that can be opened with one hand?! But at this low price, I am actually quite impressed.

Installing Ubuntu (without a Desktop Environment)

I will write a bit about my experience installing Ubuntu using Crouton, which is a script to generate Ubuntu/Debian chroot inside ChromeOS. I was reading quite a bit about Crouton before buying the Chromebook, and initially it all seemed a bit confusing. But as it turned out, the installation was plain sailing.

First of all, I read that 1) x86 processor 2) 32Gb storage and 3) 4Gb RAM are what are required to run Linux on Chromebooks. I understand that the x86 requirement is an architectural one. My Chromebook came proudly with a "Intel Inside" sticker, so I should be fine. On the other hand, my budget machine only had 16Gb of storage and 2Gb of RAM. But it should at least cope fine with a bare-bone installation of Ubuntu? For what I have to do, I don't really need a graphical interface.

Enable ChromeOS Developer mode

The first thing one needs to do is enable Developer mode. Refer to this page to see how to do it on various machines. Warning: switching between normal and developer modes will erase your ChromeOS account setting! One thing I found was that after pressing Ctrl-D in Recovery mode to enter Developer mode, my machine appeared to be doing nothing for up to half a minute before it finally rebooted. Just wait until it reboots by itself!

Note that, once you have committed to Developer mode, every time you boot up the machine, you will be presented with the "scary" warning message and a delay. You can bypass the delay by again pressing Ctrl-D at this point.

Download Crouton

Get it from

Open a shell

Inside ChromeOS,
  1. Ctrl-Alt-T
  2. type shell
  3. press ENTER

Install Ubuntu without a desktop environment

Inside the shell, run sudo sh ~/Downloads/crouton -t cli-extra

Instead of specifying xfce as the target to install the Xfce Desktop Environment, I chose to install Ubuntu with the cli-extra target to keep the installation small.

When asked for a new username and password, pick something sensible. You will need the password when you do sudo in Ubuntu in the future.

Log into Ubuntu

Once the installation has completed, just sudo enter-chroot to log into Ubuntu!

Proof that it has worked :)

When you are done, just type exit inside Ubuntu to log out. Your Ubuntu installation is safely saved inside your machine storage.

Final words

I am impressed with how Ubuntu runs on my Chromebook so far. I am able to have the Ubuntu session open, alongside a number of Chrome tabs, and see no noticeable performance issues. I like the fact that the ChromeOS Downloads folder is automatically mapped to ~/Downloads inside Ubuntu, and that copy-and-pasting works well between the two OS's.

However, there is one thing I still wish for, and it is the ability to run Docker. From what I have read so far, this is not going to be an easy task, as it would involve some serious kernel customisation...

Thursday, October 15, 2015

Bar-end brake lever and best bike maintenance trick ever

I decided to finally get rid of my old-skool Weinmann brake levers in favour of some bar-end brake levers, to give my single-speed a neater, more streamlined look. After some googling, I bought a pair of Dia Compe 188 Reverse Brake Levers. They are pretty reasonably priced, and well-made. My handlebar is a DIY Chop-and-Flop affair, with an inner diameter of just under 20mm. Initially I did not realise the aluminium tubes that came with the brakes were actually shims for handlebars with wider inner diameter (>20mm) - they looked to me to be parts of the brake levers. I tried to force the levers with the shims into the bar ends. Realising my mistake, I installed the levers without the shims and was happy to find that they sit very snugly inside my handlebars after some tightening.


Bullhorn with "normal" (non-reverse) brake levers mounted

Now with Dia Compe 188 Reverse Brake Levers installed

Cables neatly concealed underneath the bar tape

p.s. the levers are designed to work with BMX-style barrel brake cable nipples, but I decided to keep my original brake cables with road-style pear cable nipples. Personally, I think the levers work with pear nipples just as well.

Best bike maintenance trick ever...

So what is the best-kept secret? I had to shorten my brake cables as the cables now run from underneath as opposed to from the top of the levers. The problem with trimming brake inner cable with normal pliers is that the inner cable tends to squash under pressure, and refuses to cut cleanly. While some people would insist on buying specialist bike cable cutter, I found out that if you wrap the cable tightly with a bit of insulation tape before cutting through it, you can actually achieve a clean cut with normal pliers! Trust me, it works a treat.

Wednesday, July 15, 2015

Visualising 2015 Tour de France yellow jersey data

The Tour is here! I have always been fascinated by how GC (General Classification) contenders fight for their rights to wear the yellow jersey up in the mountains of the Pyrenees and the Alps. Names like Col du Tourmalet and L’Alpe d’Huez evoke scenes of epic battle between climbers riding out of the saddles, pushing their very limits.

So I decided to have a go at visualising the stage-by-stage times for the top yellow jersey contenders, to see how they gain and lose ground over the 21 stages.


I used the excellent (and free) tool to extract data from By creating an extractor, I was able to

I then wrote a couple of Node.js scripts to, on a daily basis,

  • fetch fresh data using the REST api and persist results from each individual stage into MongoDB
  • create and persist the json array required by the Google Charts library to render the line chart, based on the latest top 10 GC contenders

I came across the problem of having too many asynchronous operations (e.g. MongoDB queries) to manage in the second script. To avoid callback hell, I gave the q npm package a go. While I had been using jQuery promise (on the client side) for years, this was the first time I tried such technique in Node.js on the server side. Good news is the package worked a treat - below is a simple code snippet to illustrate how simple it was to use:

p.s. Today Chris Froome destroyed everyone during the climb up La Pierre-Saint-Martin to stretch his advantage to 2 minutes 52 seconds. Let's see whether he can maintain his lead all the way to Paris!

Sunday, June 14, 2015

Mapping the Lisbon Tram 28 route

Trying to figure out whether Tram 28 is going to take you where you want to visit in Lisbon? Now you can see the route on an interactive Google Map.

At some point, most visitors to Lisbon will have been on the legendary no. 28 yellow trams which run from Martim Moniz to Campo de Ourique (Prazeres), climbing many incredibly steep slopes and negotiating numerous impossibly tight street corners.

While the Transportes de Lisboa site provides information on the Tram 28 stops, the map downloadable from the page is sadly not terribly useful for visitors who are not acquainted with the maze that is the winding streets of Lisbon. For example, the map does not show easily recognisable metro stations or street names. We wanted to travel to the Campo de Santa Clara flea market (open Tuesdays and Saturdays) but the map did not really give us a good idea of how easy it would be to get there by Tram 28. So I naturally googled to see whether there was an interactive online map of the Tram 28 route, and I found none.

Coming back home, I decided to create one.

Tram 28 on Google Map

Explore the famous Tram 28 route on Google Map, where you can search for places and access Street View, etc. I hope future visitors to Lisbon will find this little map useful.

(I used to plot the route, and to extract the coordinates in KML format, before overlaying the route on top of Google Map)

Saturday, May 02, 2015

London Underground Metropolitan Line Luggage Rack

Sze Kiu and I went to the London Transport Museum Acton Depot open day last week, and we could not resist the temptation of buying a reclaimed luggage rack from the now de-commissioned London Underground Metropolitan Line "A Stock" trains.

The old "A Stock" train -

Not only is the rack a piece of iconic London history, it also proves to be an extremely practical and stylish item for our living room. Voila:

They are available from the London Transport Museum online shop (at a considerably higher cost than what we had to pay for at the open day, incidentally)

Saturday, March 28, 2015

Product management: a walk in the wild

Roadmap is often used as a tool to plan how a product gets developed and evolves. Being a keen walker and also a product manager, I was pondering today on the "map" metaphor.

Here is a series of simple analogies:

  • As a walker, you set the objective to climb to the top of a hill.
  • As a product manager, you set the objective to reach a targeted number of active users.

  • As a walker, you establish a strategy to climb the hill by taking the most direct route.
  • As a product manager, you establish a strategy to grow your active user base by developing a specific set of features to differentiate your product.

(Hopefully, you will have somehow validated your strategy!)

  • As a walker, you map out the segments and plan your walk.
  • As a product manager, you map out the features and plan the development work.

  • As a walker, you make tactical decisions during the walk on when and where to stop for food, when to put on your waterproofs.
  • As a product manager, you make tactical decisions during the project on what user stories to prioritise in the product backlog.

  • As a walker, you monitor the distance and make adjustments to make sure you make it to the top.
  • As a product manager, you monitor the product metrics and make adjustments to make sure you hit the target.

Sunday, March 22, 2015

Two-brewery walk - from Brockley to Peckham

Microbrewery seems to be a popular business in London nowadays. There are two rather excellent, friendly breweries close to where I live, in southeast London - Brockley Brewery in Brockley and Brick Brewery in Peckham Rye.

I regularly walk these neighbourhoods, so I thought I would map a walk linking the two breweries. This simple 2.4-mile walk takes you past a couple of very pleasant parks, an old Victorian cemetery and down one of the most vibrant shopping streets in London.

Click here to see the route on Google Map

A brief description of what you will expect on the way:

Brockley Brewery is on Harcourt Road, pretty close to the Brockley Overground station, housed inside what looks like an old garage. After enjoying a tasty pint (or a half) there, make you way back to the station, cross the bridge, turn right to reach Drakefell Road, a typical Victorian terrace-lined road in this part of London.

You will walk past the entrance to Telegraph Hill Upper Park. I encourage you to pop in, if only just to check out the wonderful view across London from the top.

Go through a foot tunnel/bridge and follow the route to reach Linden Grove. Here you will find a real hidden gem - Nunhead Cemetery. This is one of the "Magnificent Seven" Victorian cemeteries. Again pop in to experience the tranquil and magical environs, but don't get lost - you need to get to the other brewery!

Go down Forester Road and then Solomon's Passage. You will soon find the vast green space of Peckham Rye Common.

Head north along the edge of the common to reach Rye Lane. The combination of Art Deco architecture (yes I am a huge Art Deco geek, check out my Art Deco London map) and diverse cultural vibe always fascinates me about this busy shopping street. Also worth mentioning is Bussey Building on the right which hosts some interesting art and music events.

Turn left into Choumert Road, and then right into Choumert Grove, and you are in a decidedly different setting to the hustle and bustle of Rye Lane. Look out for the beautiful Girdlers Cottages before being stunned by the quaint Choumert Square - I bet you would never believe a place like this would exist right in the middle of Peckham.

Find Brick Brewery on Blenheim Grove to claim your well-deserved pint!

PS - remember to check on the brewery websites for opening hours (Saturday afternoon is a safe bet)!