Thursday, January 29, 2009

Ode to the Compaq 8510w

I got a sweet new laptop at work. It's a Compaq 8510w. The Core 2 Duo T7500 is fast, 3 GB of RAM is luxurious, and the 1900x1200, 15.4 inch widescreen LCD is pretty. I installed Ubuntu 8.10 and it sleeps (suspends to RAM) and wakes up like no other Linux box I've ever had, which is very, very nice (though the XO has started doing that with the latest update extremely well too). I installed the corporate image of windoze XP under VirtualBox. With the processor's virtualization extensions it runs pretty snappily. I can watch the corporate propaganda WMV movies, use Lookout for calendaring, and access the internal IE-only "web" apps just fine.

I went with VirtualBox instead of kvm this time, kind of just to see what the differences where. I had to set up bridge networking because the corporate image didn't like not having a corporate IP address. I hear the newest version of VirtualBox doesn't need this, but here is the script I run to set up bridged networking with the "old" version:

brctl addbr br0
ifconfig eth0 0.0.0.0
brctl addif br0 eth0
dhclient br0
VBoxTunctl -b -u bryan
ifconfig tap0 up
brctl addif br0 tap0

To remove the bridge and set it back to normal I do this:

ifconfig tap0 down
VBoxTunctl -d tap0
ifconfig br0 down
brctl delbr br0
dhclient eth0

I got help from here and here on this. The scripts work well, except that Firefox gets confused when I switch back and forth. That happens to Firefox when I VPN into work and then disconnect the VPN. I'm sure there's a good explanation.

The other really cool thing about this laptop is that with the docking station, it can drive two external monitors. It's easy to do with the windoze nvidia driver, but with the Linux driver it wasn't as straightforward. Mainly because the version of the nvidia driver that came with Intrepid (version 177) simply didn't support this option. After getting some help from the other Linux lovers at work I realized that this was my problem. Doing an aptitude search nvidia showed that there was a more recent version available and a few older versions. Thankfully it's a simple aptitude install nvidia-glx-<version> to try a different version. I tried version 180 to no avail, and then found that version 173 worked.

The way I could tell it was working was by running nvidia-settings while docked and connected to the two external monitors and finally being able to see them under X Server Display Configuration. You have to disable the Seiko LCD screen (DFP-0) to get the other two (DFP-1 and CRT-0, since there's one DVI and one VGA connector on the dock) configured and working with twinview.

When I undock, the LCD screen stays blank. If I manage to restart X then the display comes up on the laptop LCD, but it's still at the dual-display resolution that doesn't fit on the built-in LCD very well. My solution was to git tag (since I still keep /etc under git) the dual display xorg.conf and then recreate the single built-in LCD xorg.conf and tag it too. To switch between them when docking and undocking I created two scripts, one is called 'laptop' and looks like this:

#!/bin/sh
cd /etc/ && sudo git checkout xorg-laptop-display X11/xorg.conf

The other is called 'external' and looks like this:

#!/bin/sh
cd /etc && sudo git checkout xorg-external-dual-display X11/xorg.conf

It works pretty well, but I still have to restart X after running the scripts. I've heard of this cool thing called XRandR, but it seems like I read that the nvidia driver doesn't Just Work with xrandr. I need to look into that some more.

So, my work satisfaction went up when I got this machine. I never thought I'd want a large "mobile workstation" laptop like this, but when I think about how fast and nice it is, it doesn't feel nearly so heavy to carry. I should probably disclose that I may happen to work for the same galactic corporation that makes this laptop, but I'm in a totally different part of the galaxy, far from where laptops are made. There is absolutely no bias in this endorsement at all. And nevermind that I would not have considered shelling out for such a nice machine myself :-)

Thursday, January 22, 2009

End of the Flashlight Story

Sorry it's been so long. I did play with my flashlight some more. I did exactly what I said I was thinking about doing at the end of that last entry, cutting traces and soldering on new wires, but since the wire I used was so thick there was no way it was going to fit back inside the case. I gave myself credit for fixing it anyway. Not long after I read about edge-lit holiday cards. They looked so cool in the pictures I had to try it. My wife scratched her best wintery scene on some acrylic that I paid waaaay too much for at Michael's and I taped together the light source, using one of the LEDs from my flashlight (yep, I broke it again). I think the acrylic from Michael's was too thick and hard to scratch, and looking at the original instructions again, I'm seeing that they used much smaller pieces too. Ours didn't light up nearly as well. It was fun though. Here's how it turned out: I know, not too impressive of a lighting job. The photography could use some help too, but I had to document it.