chromebook recovery disk and external monitor

I bought a Chromebook and have been using it/testing it out before actually giving it to my mother.  This weekend, I tried to create a recovery disk and hook it up to an external monitor.  Here’s how it went.

Recovery disk

The Chromebook help page covers how to create a USB drive with a bootable ChomeOS recovery disk.  It took me a few tries though:

  1. Inserted 8GB USB flash drive into Chromebook and went to chrome://imageburner.  A third of the way through the 300-400 MB download it would fail with an unclear error message.
  2. Tried Chrome OS Image Creator on Mac.  However it asks for a model number like “Sams Alex2 Gamma0-US 1234.”.  I emailed the “Chrome Ninja Team” (google support) as I would like to know the answer to this.  I then guessed one and tried to download onto USB.  Same error.  I’ve used this USB drive for other things but maybe it is the drive.
  3. Tried a 4GB USB flash drive and created recovery disk successfully.
How to find your chromebook model # 
Per the Ninja team, if your machine still works, you can enter:
 chrome://system   (which shows a lot of interesting other info too; at least interesting if you are a geek)
How to find your chromebook model #   – approach 2
Per the Ninja team (parens are mine)
  1. Follow the steps 1 – 4 via this link http://support.google.com/chromeos/a/bin/answer.py?hl=en&answer=1360642  (I didn’t feel the switch move but it clearly did.  I hadn’t shut down fully (or knocked into the power button while doing this and had to do this twice.)
  2. Step 5) Press the space bar and then you will be able to see your model number.  (This worked.)
  3. (Flip switch back and restart – I got prompted for my internet connection again and given the welcome message so I think it did a partial reset.  But all settings are in the cloud so this isn’t a big deal.)

External monitor

My goal was to hook up the tiny 12.1 inch Chromebook screen to an external monitor.  I already have a VGA cable.  The Chromebook does not have a VGA or HDMI port.  Check what your model has.  Mine has a Display Port.   I learned it isn’t easy to buy a Display Port to VGA adapter.  Here’s what happened:

  • Radio Shack: Sells mini display port adapter because Mac’s use it.  (I already have one of these)
  • PC Richard: “That doesn’t exist; tvs use wifi now.” (Not true and useless advice)
  • Best Buy: Sells same things as Radio Shack.  Recommends buying it online
  • B and H: I suspect B and H does have this adapter in stock.  The trains aren’t fully running yet so I don’t feel the need to go into Manhattan to find out.  And they were closed today anyway for the holiday.
  • Amazon: I bought this on Amazon.  Will find out how it works in a few days.

more postgres tuning in jforum

A teammate installed a new feature on CodeRanch JForum that uses a 4,515,409 row table. When dealing with over a million rows, scans become a huge performance drain. To the point where one query was slow but real usages with many at the same time brought down the app. The reason why the query was slow was interesting so I asked him if I could blog about it.

The original query

select countryCode, countryName, region, city
     from ip2location
     where 540815125 >= low and 540815125 <= high;

Running this through explain says it uses the index with a cost of:

Bitmap Heap Scan on ip2location (cost=5949.66..54170.71 rows=219870 width=32)

That’s a really high cost explain plan.

My first thought was to change it to:

explain  select countryCode, countryName, region, city
     from ip2location
     where 540815125 >= low and 540815125 <= high;

Which has a much better explain plan of

Index Scan using ip2l_low_asc_idx on ip2location (cost=0.00..8.77 rows=1 width=32)

The reason is that in the first query, postgres needs to scan the large index from the beginning until it hits the low value. In the second, I gave it permission to start really close to the target row. I subtracted 1000 but that was arbitrary. It just needs to high enough to be in the vicinity of the row without missing out on any data.

My approach also makes the lookup time consistent. It is always looking through 1000 worth of index. (Which is always less than 1000 rows given the bunching of low to high.) The original is immediate through a full index scan.

Then the original teammate switched it to:

select countryCode, countryName, region, city
     from ip2location
     where  low =
           (select max(low)
            from   ip2location
            where 540815125 >= low)

This has the same explain cost as the hacky one and is clearer.  Same logic though – it doesn’t require scanning/returning extra results.

chromebook on the road

I’ve been testing out a Chromebook at home for a while now.  Friday was the first time I took it “on the road.”  In other words outside my apartment.

Connecting to 3g

At times, 3G connectivity takes a bit longer to start up.  (This probably happens at home too periodically; I just don’t watch startup there.)  Waiting seems to solve it.  Once I had to force it to reconnect by turning off the 3G and then turning it back on.  I also had to click the X to close the message that 3G wasn’t available.

The keyboard

At home, I’ve been using an external keyboard and mouse when doing anything non-trivial.  On the road, I realized I didn’t remember a keyboard shortcut:  alt up/down is paging.

Overall experience

The Chomebook was easy to use.  I was able to:

  1. Check email
  2. Check a website
  3.  Open a word doc
  4. Post on coderanch
  5. Check the address of a restaurant.
On a cell phone you get a dropped call every so often.  On the chromebook, this manifests as a few seconds loss of connectivity.  This happened to be twice. On a google site, you get a nice message that “the application is unreachable.”   On a non-google site, you get a long message about the dns entry not being available.  While this is true, it seems like a scary message for the lay-person.  The solution is to refresh the browser page in either case.
Bandwidth usage
I used the internet for about an hour total on Friday and went through only 4MB.  Granted I didn’t do anything bandwidth heavy, but I still expected it to be higher.