Rest In Peace CR-48 / My first Thinkpad

Have you ever been afraid to open a package?

On the first day of Feburary, 2011, St. Louis had a major ice storm.

On this day, the ice was so bad that I couldn’t get my work truck out of my driveway, which was impressive because it slightly slants down toward the road.  Before I had a chance to call into work to let them know, my boss called me and said it’s not worth trying to drive, and to stay home try to do a bit of work remotely and answer phone calls.

I noticed around noon that there was a package left on the doorstep.  I didn’t order anything at all, but it was addressed to me with no return address.

After a few minutes of head scratching I cautiously opened the package.  It was a laptop!  From Google!  For free!

Google was taking applications for the Pilot program earlier in the year, maybe even late 2010.  Before applying, I made sure that I had signed into my Chrome browser and installed some “Apps” and synced my bookmarks.  I also may have hinted that I was also interested in developing my own extensions for Chrome.

How, why, its not clear, but Google gave me a gift.  A 1.6ghz Intel Atom PC, 16GB SSD.  It wasn’t fast, but it was FREE.  I used ChromeOS for a few weeks, but quickly realized that I wanted more than just a web browser out of a laptop.  Apparently someone received a CR48 with a standard BIOS, and it was then dumped and shared.

I ran Windows on it for a while, but eventually settled on Ubuntu.  It was great for a light browsing machine, and I used on and off for over a year.  After the year of abuse, the hinges were completely shot.

A few weeks ago I got a wild hair to try to repair it.  I drilled some holes in the back of the plastic and put screws through it, and it was then stronger than ever.  I installed a new version of Ubuntu with XFCE and realized how nice the machine still was.

This seemed the rebirth of my free laptop.  Next I had the urge to upgrade the little 16GB SSD.  I ended up buying a 120gb MSATA disk.  When I disassembled the machine to install the SSD, I noticed I lost one of the nuts that I used to repair the hinge and decided to beef up the hinge even more.  I took a trip to the hardware store and picked up some bigger hardware, and some new drill bits.

When I got home, while enlarging a hold, my brand new drill bit binded up and what was left scraped across the motherboard near the RAM slot.  It looks like a few leads were severed and now it won’t boot anymore.  The SSD I ordered was useless because I didn’t have any other machine that supported MSATA SSDs.

What did I do?

I ordered a used Lenovo Thinkpad X220 from eBay, and a Bluetooth adapter, ExpressCard 54 USB 3.0 card, and an upgraded Intel 802.11n card from Amazon  The Lenovo supports the MSATA SSD, as well as a standard 2.5″ drive.  So I’ve now got 120GB of solid state storage for my OS and software, and a 320GB 2.5″ HDD for storage.  It would be roughly the same size and weight as the CR48 if I didn’t have the 9 cell battery sticking out the back.  It’s got a matte screen too, which is something I grew to love on the CR48.

I’ve never been happier with a laptop keyboard than I am with the X220.  It feels great to type on, has dedicated volume and mute keys, and with all the function keys.  This was a huge step up from the limited key count of the CR-48.

The only grip I momentarily had (and apparently I’m not alone) is that the very bottom left key is the function key, instead of ctrl like almost any other keyboard.  I found its just an option in the BIOS to swap the two keys, so I immediately change it.  The two keys are not the same size on this model, so I can’t physically swap them like you can on some Lenovos.

The trackpad at first sight was hideously small.  I was shocked that the buttons were above the trackpad instead of below.  What I didn’t realize is that the trackpad is one that physically clicks just like the CR48 and Macs do.  It’s a lot smaller than the one on the CR48 though, but that’s a trade-off for having a bigger keyboard in a compact machine.  It has one of the nub/eraser head/nipple pointer sticks too, but I can’t use it as efficiently as the touchpad.

I’m not trying to do a full review of an almost 2 year old laptop.  This is just some of my impressions coming from a cheap free laptop to my first Lenovo.

Mount partitions in Linux using GUID

If you’ve ever managed a linux machine, you’ve likely manually editied the /etc/fstab file to automatically mount filesystems.  If you manually specify it’s location (/dev/sdb1) you may know that adding other devices can change location, meaning you will need to change your fstab.

If you’ve looked at modern Linux distributions, you may notice that the fstab file does not contain any /dev devices, but instead uses the partition’s GUID.  From what little reading I’ve done, I’ve found this is a feature of ext2 and up filesystems.  A /etc/fstab in a recent version of Ubuntu will show you that you need to run blkid to print the UUID for a device, and then use GUI= as a prefix in place of the device location.  Run blkid as SU (sudo blkid) and you will see something like this: 

tim@cr48:~$ sudo blkid
/dev/sda1: UUID=”818bded8-51fc-4c02-be9e-abb99517c905″ TYPE=”ext4″
/dev/sda5: UUID=”283cf494-e3be-441d-b098-034869407e6e” TYPE=”swap”
/dev/sdb1: LABEL=”cr48_home” UUID=”cab2cac5-fb0d-4afb-9561-66f97c939412″ TYPE=”ext4″
In this case, I want to use the /dev/sdb1 device as my home directory, so in my /etc/fstab file I’ve added the following.
UUID=cab2cac5-fb0d-4afb-9561-66f97c939412 /home         ext4          0 errors=remount-ro      1
Now the partition will automatically be mounted to /home reguardless to it’s device location.  
If you’re using an old Linux install that’s been updated many times, your fstab file may still be using the device instead of it’s UUID.  It’s a good idea to fix this while you can.  It’s not uncommon to reboot with a new disk installed and it changing the address of all of your exising devices.

ProFusion X Digital Media Manager

Yesterday I wandered into an electronics store intending to buy nothing and walked out with an old computer, a “dmx ProFusion X Digital Media Manager”.

From what I can tell this was designed to play music in a store.  On the back it has connectors that convert the standard 3.5mm audio outpus to RCA’s that I’m assuming go to amplifiers.

When I walked to the register with the PC, the clerk was wondering why the machine was on the floor in the first place.  He told me he couldn’t sell it because the hard drive was still installed and still had music on it.  I asked if he could sell it without the hard drive, he agreed, ripped it out, and I was on my way.

It came running a VIA C3 CPU at 800MHz and with a whopping 128MB of DDR333, but it came in a nice case for a project.  It’s face has 7 buttons and an LCD.  It attempts to display a DMX banner as soon as power is applied. By attempts I mean that about half of the display is dead.

Inside, the front panel is powered using a floppy disk style power connector and interfaces using a 10 pin ribbon that occupies two a 2 port USB header on the motherboard.  The USB device presents itself as a standard FTDI serial to USB interface.  After some trial and error, I discovered that it runs at 19.2k baud and the buttons are mapped to send a single digit for each:

  1. Style Up
  2. Style Down
  3. Left: 
  4. Up
  5. *
  6. Down
  7. Right

When I send text to the display at the same baud rate it appears to display on the LCD, but since the display is broken it’s hard to see if the correct text is displayed, and I haven’t found what to send the display to set or reset the cursor position or clear the display.

I replaced the motherboard with and old socket 757 motherboard and a 1.8ghz AMD CPU, and I plan to make this a music jukebox at some point.  It’s burried deep on my todo list for now and if I come up with anything worth sharing I certainly will.

pfSense

I’ve recently replaced an aging Linksys WRT54G running DD-WRT with a PC running pfSense. 

Around a month ago I added a second NIC to an old mini-ITX 1ghz VIA motherboard I had lying around and dropped it in place of DD-WRT.  The PCI NIC started locking up daily about a week ago.  pfSense automatically restarts the interface after a minute or so, so it wasn’t very urgent.

I recently aquired a P4 machine with dual onboard NICs, so last night I swapped it in place of the VIA machine.  Since my internet connection peaks at around 40mbit,  I won’t be seeing any immediate benefit from the gbit nics.  I’ve been prepared with a DOCSIS 3 Motorolla Surfboard for around a year, so I’ve got my fingers crossed I’ll see Charter jump over the 100mbit barrier.  Besides, It’s nice to see more gigabit link lights lit.

Although CPU utilization was never very high with on VIA, the web configuration pages are much faster on the P4.  Now that I have more wiggle room, I will likely add a spinning hdd (or two) and play around with using it as a caching proxy (both forward and reverse), for VPN access, and possibly as my SIP PBX.

I currently run a few local web services on different machines behind some apache name-based reverse proxy vhost configurations   I’m working on moving these roles to pfSense, so I’m going to try to document my steps post an update when I’m done.

Creating Keyboard Shortcuts for the CR-48’s missing keys on Ubuntu Linux

Running an OS other than Chrome OS on a CR-48 turns it into a perfect portable computer that can do much more than when it was just a browser.  The biggest drawback I’ve found is that the keyboard is customized for the OS it came with:  It’s missing keys, the function keys are labeled only with icons, and there is a Search key where a caps lock key should be.  

Using Ubuntu, you can create shortcuts with “Keyboard Shortcuts” in the System menu under Preferences.  Just click the Add button, give a name and command, apply, click the row for the command you created under the Shortcut column, and key your desired shortcut.

To create keyboard shortcuts that control backlight brightness, you will need to install xbacklight, and for mapping shortcuts to missing keys you need xvkbd and xbindkeys.

sudo apt-get install xbacklight xvkbd xbindkeys

The search key by default is mapped to Super/Mod4, which is usually the Windows key. After running Windows on the CR-48 for a few months I’ve grown familiar to using the search key as the Windows key, so I’ve decided to use it as the modifier key for my shortcuts.  Here’s how I have configured mine.  You can edit these to your liking.

“Brightness Down” maps Mod+F6 to
xbacklight -steps 1 -dec 20

“Brightness Up” maps Mod4+F7 to
xbacklight -steps 1 -inc 20 

“Press Home” maps Mod4+Left to
/usr/bin/xvkbd -xsendevent -text “\[Home]”

“Press End” maps Mod4+Right to
/usr/bin/xvkbd -xsendevent -text “\[End]”

“Press Page Up” maps Mod4+Up to
/usr/bin/xvkbd -xsendevent -text “\[Prior]”

“Press Page Down” maps Mod4+Down to
/usr/bin/xvkbd -xsendevent -text “\[Next]”

“Press F11” maps Mod+F4 to
/usr/bin/xvkbd -xsendevent -text “\[F11]”

For volume control, instead of creating custom commands, I’ve edited the existing audio keys to be my modifier plus the function keys with the correct icon.  (F8 for mute, F9 for volume down, and F10 for Volume up)

You may find that using the mapped keys with extra modifiers do not work.  For example, I have a habbit of using shift home and shift end for selecting from current cursor position to beginning and end of lines, and ctrl shift home/end for selecting from current cursor position to beginning/end of a page.  For any combination modifiers using shortcut keys you will need to create more shortcuts.

“Shift End” maps Shift+Mod4+Right to
/usr/bin/xvkbd -xsendevent -text “\S\[End]”

“Shift Home” maps Shift+Mod4+Left to
/usr/bin/xvkbd -xsendevent -text “\S\[Home]”

“Ctrl Shift End” maps Ctrl+Shift+Mod4+Right to
/usr/bin/xvkbd -xsendevent -text “\C\S\[End]”

“Ctrl Shift Home” maps Ctrl+Shift+Mod4+Left to
/usr/bin/xvkbd -xsendevent -text “\C\S\[Home]” 

Thats all I have for now.  I’m still trying to find a way to enable bottom left and right clicking on the touchpad without disabling two finger scrolling, which is possible when using Windows.  If you know how to do this or you have anything else to add please comment.