Posts

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...

End of the Flashlight Story

Image
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...

A Flashlight Schematic

Image
Well, I took the broken flashlight to work. I have colleagues there who are genius electrical engineers and one in particular, Sam, had a fun time with this challenge. I explained to him the situation and handed him the circuit board. He peered closely at the board, rotating it round and round as he traced all the connections. As he did so he made notes on my whiteboard and after a few minutes he had deciphered the full schematic of the circuit and it's intended operation. We then hooked up a bench power supply and took some measurements (with a much nicer multimeter than I have at home). We measured 2.45 mA of current flowing when 6V is connected and the lights are off. At 220 mA hours of battery life: 220/2.45 = 89.79 hours 89.79 hours / 24 hours/day = 3.74 days Which totally correlates with my experimental data. Here's the schematic for your viewing pleasure (click to make it bigger): You can see some measurements we took and a curve for the diodes. Yes, ...

A Flashlight Story

Image
Back in May of this year, in preparation for a campout, I bought a nice looking LED headband flashlight at Walmart. It's a Garrity light and it ran me about $13. I used it on the campout and fell in love. It was incredibly light-weight and I soon forgot it was on my head, yet it was plenty bright (click these images for larger versions). After the campout it sat in a drawer for a few days before I had occasion to use it again. When I pulled it out of said drawer and pushed the button to turn it on, nothing happened. Saddened, I figured it must have been bumped and turned on while in the drawer or maybe one of my boys had found it and left it on. I bought new batteries and used it while performing some bicycle maintenance in my dimly lit garage late one night. I put it away high on a shelf away from any bumps or curious hands afterwords. A few days later, the batteries were dead again. I've gotta return this defective thing to Walmart, I thought to myself, but n...

Carefully Upgrading to Django 1.0

I’m a little behind, but I finally upgraded my family website to Django 1.0 . First of all, I wanted to keep the main site running my older version of django from subversion while having 1.0 installed and being used by the development version. First I added the old install to my apache configuration’s PythonPath. Here’s the diff: - PythonPath "['/home/bryan/web/murdockfamily'] + sys.path" + PythonPath "['/home/bryan/web/django_src', '/home/bryan/web/murdockfamily'] + sys.path" Then I deleted the symlinks to that django install from any site-packages locations: sudo rm /usr/lib/python2.4/site-packages/django /usr/lib/python2.5/site-packages/django /usr/local/lib/python2.5/site-packages/django Then reloaded apache: sudo /etc/init.d/apache2 reload And it seemed to still work. Next I untarred Django 1.0, and installed it: tar -zxvf /home/bryan/downloads/Django-1.0.tar.gz cd Django-1.0 python setup.py build sudo python s...

Convert a PostgreSQL Database from LATIN1 to UTF8

I had a problem with my family django-powered website. I have an aggregator for all our friends blogs, very similar to the Django aggregator , except that mine hasn’t been aggregating. After some serious investigation, I found that psycopg was barfing error messages because the feeds that were being stuffed into my postgresql database contained utf-8 characters that it couldn’t figure out how to convert into latin1 characters. I hadn’t paid any attention to this, but apparently my blog database was using latin1. Lame. I decided it was time to learn how to convert it to utf-8. First, I did a pg_dumpall in order to get a look at things (this happens automatically every night, actually): /usr/bin/pg_dumpall -U <special user> > /home/bryan/backups/all.dbs.out Sure enough, my database was created like so: CREATE DATABASE bryan WITH TEMPLATE = template0 OWNER = bryan ENCODING = 'LATIN1'; So, I dumped just that database: pg_dump -U <special use...

Linux Programmer’s Manual on Ubuntu

I typed man sscanf on my Ubuntu 8.04.1 system at home and was shocked to see this reply: No manual entry for sscanf Never had a UNIX or UNIX-like system ever left me out in the cold like this without help. Fortunately, I found where to get the manpages . Just sudo aptitude install manpages-dev and everything is all better. Phew.