Monday, April 30, 2007

Putting Things in a Whole New Light

The angry words spoken in haste,
Such a waste of two lives,
It's my belief,
Pride is the chief cause and the decline
in the number of husbands and wives.

Roger Miller, “ Husbands and Wives”

And here's the latest cause of the decline: Compact Fluorescent Bulbs.

Sunday, April 29, 2007

Getting Feisty With the Network

When we last left our installation of Ubuntu 7.04 (Feisty Fawn) on Hal's Evil Twin, we had everything in place — except wireless networking, a rather important omission since Spouse refuses to let me string an umbilical cord through the house. (It's only 20 feet!)

Now the Fawn has what is supposed to be excellent support for out-of-the box wireless, through something called Network-Manager, which is supposed to “effortlessly switch networks.” Well that's all right, even though HsET is permanently (I hope) connected to one network, all of the time.

And the initial results were encouraging. On installation, Feisty immediately found my DLink DWL-G510 wireless card, and told me it was going to use a Restricted (meaning third-party binary) driver to talk to it, if that was OK with me. Having no other choice to get on the Internet with HsET, I said yes, offering a silent prayer to RMS for, if not forgiveness, at least understanding.

I entered the network information: SSID, WPA-PSK (or Personal) security, passphrase, and click OK. A little arrow started chasing its tail, and eventually stopped. I opened Firefox, and headed off to GoogleTM.

Nothing. Open a terminal window, enter:

No response.

Obviously nothing's working.

So I went online with the Mac, which does do wireless out of the box, and started searching Ubuntu Forums. It immediately became apparent that Network-Manager didn't handle WPA, in particular WPA-PSK mode, security all that well.

So I a sulked for awhile, and then went hunting for a solution. I found it in bits and pieces all over the forum, mostly written for previous versions of Ubuntu, but still useful. The best help was from the Ubuntu Forum and the Ubuntu Guide, some of which was originally written for static IP addresses, but with information about DHCP connections as well. I'll write out the steps I used here, but for further reference you should really go back to the original thread.

  1. First, get rid of network-manager and network-manager-gnome. I used synaptic, but you should also be able to do it with
    $ sudo dpkg -r network-manager network-manager-gnome
    This shouldn't be necessary, but I found no way to just turn off network-manager, even from within Gnome. There must be a way, since that's standard Unix/Linux practice, but I couldn't find it, so I just chucked the software out the window.
  2. Install the wpasupplicant package:
    $ sudo apt-get install wpasupplicant
  3. Open up a terminal window. Just about everything from now on will be done in this terminal window.
  4. Get your WPA identity string. Suppose your Networks SSID is "Our_House," and your pass phrase is "Two cats in the yard." Then run
    $ wpa_passphrase "Our_House" "Two cats in the yard." network={
    #psk="Two cats in the yard."

    Note that psk is the actual WPA password for your router. Save this output somewhere for the moment.
  5. Create the file /etc/wpa_supplicant.conf. I use
    $ sudo vi /etc/wpa_supplicant.conf
    but you can use whatever editor you wish, as long as you run it with sudo. Your final file should look like this:
            proto=WPA RSN
            pairwise=CCMP TKIP
            group=CCMP TKIP

    where obviously you replace Our_House and the psk string with the appropriate values for your network.
  6. Now we need to edit (again with sudo) the file /etc/network/interfaces to tell it about the card. Looking around the web, I find that the DWL-G510 uses the Atheros chip-set and the madwifi driver. So edit /etc/network/interfaces so that it reads the lines near the string auto ath0 read:
    auto ath0
    iface ath0 inet dhcp
    pre-up wpa_supplicant -Bw -Dmadwifi -iath0 -c/etc/wpa_supplicant.conf
    post-down killall -q wpa_supplicant
    (no, that last line doesn't have a “-9,” it is, indeed “-q”)
  7. Now we want this to run at startup. Note that you do not want to do this with a laptop, because you don't necessarily know which network you are going to connect to. Create a file /etc/init.d/ with the following content:
    #! /bin/sh
    echo "* [WiFi]: Enabling WPA Supplicant ..."
    if [ -x /sbin/wpa_supplicant ]; then
    /sbin/wpa_supplicant -B -Dmadwifi -iath0 -c/etc/wpa_supplicant.conf -w
    exit 0
  8. Make sure the files you create are world readable, and that the last one is executable:
    $ sudo chmod +r /etc/wpa_supplicant.conf
    $ sudo chmod +rx /etc/initd/
  9. To get to start during the boot requires us to get it into the list of files in /etc/rcS.d. If you list the directory:
    $ ls -1 /etc/rcS.d/
    the scripts will execute in the order they appear on the screen. We want WiFi to start just before the networking file S40networking, and this command pretty much guarantees it:
    sudo ln -s /etc/init.d/ /etc/rcS.d/S40netwifiwpa
    Your mileage may vary, in which case you might have to change the name "S40netwifiwpa" to make it appear just before "S40networking."
  10. Reboot, and log on. Your internet connection should be established, e.g.:
    $ ping
    PING ( 56(84) bytes of data.
    64 bytes from ( icmp_seq=1 ttl=243 time=11.4 ms
    64 bytes from ( icmp_seq=2 ttl=243 time=13.4 ms
    64 bytes from ( icmp_seq=3 ttl=243 time=14.3 ms
  11. You should be able to get the network running again with stop and start commands, but I haven't tried to find the appropriate sequence.

So far (three hours, two reboots) the network has been just fine, but there may be problems ahead. If so, I'll report them. I'd also appreciate any feedback from those who've tried this themselves.

Friday, April 27, 2007

Taking Garrison Keillor to the Gym

I'm a fan of Garrison Keillor and A Prairie Home Companion. Kansas German Lutherans aren't quite as shy as Minnesota Norwegian Lutherans, but it's a close race, and there are a lot of parallels between Lake Wobegon and Holyrood.

So I like to listen, but never get to hear an entire show.

Problem: I just can't take two hours out of every Saturday night to listen to the show. (I'm a busy (ex-)Kansas German (ex-)Lutheran.)

However, I spend 3-4 hours a week at the gym, and I have an Samsung YP-U1 MP3 player (inherited from Youngest Child after the purchase of an iFollowtheCrowdPod). So can we somehow get the show onto the MP3 player?

Yes! PHC has an archive where you can find old shows.

Problem: The archives play streaming Real Media, suitable for listening with RealPlayer or Helix Player (untested). Not a format supported by my Samsung.

Solution: Download the streaming media, convert it MP3 or OGG (the Samsung plays both).

But how? With mplayer. However, first we have to find the stream, and then capture it.

It's not as simple as all that, as the PHC site hides the file pretty well. Here's the procedure for last Saturday's (April 21) show, which just went on line:

  1. Go to the archive page, and select the month and year of the program you want to hear. Click GO
  2. Scroll down to the show you want, click on the date.
  3. On the next page, right click on the “Listen to the whole show” line, and chose the “copy link location” option.
  4. Open a terminal window, change to the directory where you want to save your files, write “wget” on the command line and then middle-click. This will produce the command:
    which will return a file named 21_phc.ram. (Obviously the numbers will change with the date of the show.)
  5. $ wget `21_phc.ram`
    (Note that those are backquotes.)
  6. This yields a file named 21_phc.smil. If you cat that file, you'll find a string like
    That's the audio stream.
  7. From here it's simple, if you read the reference article:
    mplayer -vc null -vo null -ao pcm:file=phc_070421.wav rtsp://
  8. This produces a WAV file. You can produce MP3s directly with this method, but they are terribly compressed.
  9. After the two hours are up (this is streaming media, remember?), go back to the command line and compress the file. Since the Samsung reads Ogg format, I use:
    sox phc_070421.wav phc_070421.ogg
    which produces a file that I can store on the Samsung and listen to in the gym.

Of course, now that you know the trick it's trivial to write a script to do the whole thing every week, but I wanted to note how you find all of this out, in case PHC changes the format of the files involved.

Sunday, April 22, 2007

Installing Ubuntu Feisty Fawn With Dual Boot

As a counterpoint to my Windows Re-Installations notes, here I'm going to give a blow-by-blow of my installation of Ubuntu 7.04 (Feisty Fawn) on that Hal's Evil Twin. HsET is an old (2003) Dell Dimension 2350 computer, with 512MB memory, a DLink DWL-G510 wireless card, a Microsoft Wireless Keyboard/Mouse combo, plus a Wacom graphics tablet which also serves as a wireless mouse, and connected to a Canon printer. The goal is to set this up as a dual-boot machine, and not have to run an Ethernet connection from the DLink router downstairs up to the computer, i.e., get the wireless running. Then Spouse, who likes Linux because it boots up a heck of a lot faster than our Windows machine, can read email while I'm composing pointless blog entries.

This is still an incomplete story, so stay tuned for further developments. Right off the bat, let me tell you that I don't have the Wireless connection going, yet.

First, we need media to hold Ubuntu. I've pretty much filled up the Seagate 120GB disk with Windows stuff, so I connected a Maxtor 40 GB disk (HsET's original disk, as it turns out) as a second drive:

The duct tape isn't the only thing holding up the disk, the cable is quite stiff and keeps everything upright. The tape is just to keep things from jostling around when the box gets moved.

For some reason we have to set the jumpers to make the Seagate the Master and the Maxtor the Slave. Setting both to Cable Select just gives you a computer that doesn't boot at all, even though both of the drives are attached to the same cable, in proper order.

So here we go:

  1. The target disk is now /dev/hdb. I find it easier to format these things before installing the distribution, so I loaded up a GParted Live CD to set everything up. I decided on these partitions:
    Mount Point File System Size
    /boot ext3 1 GB
    / ext3 12 GB
    /usr/local ext3 5 GB
    /home ext3 19.29 GB
    swap Linux Swap 1 GB
    (note: GParted found Microsoft Wireless keyboard/mouse, but not the Wacom tablet)
    GParted is quite easy to use, and I find it helpful to see what I'm doing, rather than trying to do it by cylinder number with fdisk.
  2. Burn a Ubuntu Feisty Fawn (7.04) Live CD.
  3. Boot it.
  4. Weird. The text screen resolution went Apple ][: 40x25.
  5. However, the GUI is fine. Wacom mouse works out of the box, as does the wireless keyboard.
  6. There is a warning message that we're using a Restricted Driver for the WiFi card.
  7. Try to set up wireless interface, connect to house 802.11g WPA personal network. Timed out. Though this is ultimately a deal-breaker, go ahead with the install and worry about it later ...
  8. Click the Install Button.
  9. Language: English.
  10. Time Zone: EDT (New York).
  11. U.S. English keyboard
  12. Set up partitions as above. (Manual install.) Does it really have to rescan the disk every time you click the mouse?
  13. Format everything, even though it's already formatted (it's Required by Ubuntu).
  14. Temporarily, at least, set Windows as the default boot device. See how at
  15. Reboot to Windows: Works (including wireless).
  16. Reboot to Linux: Works, except for wireless. It can even see the NTFS and VFAT files on the Windows partitions.
  17. To do:
    • Fix Wireless
    • Check printer drivers: Dapper's drivers did not do well with the Canon printer.
    • Update, load up software that we might want. This mostly involves things such as Java and Flash, and Feisty's pretty good about helping with that installation, once we have an Internet connection.
    • Move Spouse's files from downstairs upstairs.

To be continued ...

Saturday, April 21, 2007

Broken Windows (XP) -- Goodbye, Farewell, and Amen

I fixed the problem with all the USB stuff. Apparently Windows associates a device with the USB port where it is attached (Linux doesn't do this with the mouse, but I don't know about other gadgets). When I moved the computer, I disconnected all of the USB devices, and I probably didn't plug them all back into the “correct” ports. Starting up the computer, logging on, and plugging the components fixed the problem.

So I now declare Hal's Evil Twin fixed, and I'm going on to other things, such as installing Ubuntu Feisty Fawn as a dual boot on HsET.

Broken Windows (XP) -- Part V

This was supposed to be a post of triumph, how I overcame adversity and my own ignorance of installing Windows, and restored a computer, from scratch, to the way it Used To Be.

It will probably work out. I suspect I've made a silly mistake because I was working on things at 8 am on a Saturday morning, never a good time to do anything like real work.

But first, the good stuff:

As you will recall (and recall and recall and recall), Hal's Evil Twin (HsET), the XP box upstairs, crashed for no apparent reason, leaving all its data accessible but with no way to boot the computer, even in safe mode. After several attempts to fix the disk, I decided that the easiest thing to do was to copy everything off the XP's disks onto Hal for safekeeping, reinstall Windows, and then copy everything back.

Just so I'd know what I did, I kept a running log of how I performed the reinstall. It's going to be long. There are several reasons for this: the computer is four years old, from before the time when a company would ship a “restore this computer to the way it was when you bought it” option; I've added a fair amount of hardware over the years, so I had a bunch of new drivers to install; I changed the setup of the system, e.g., repartitioning the disk and using Comcast's free McAfee anti-virus rather than the Norton anti-virus package that was coming up for renewal; while just about everyone who's run Linux has done an install, few people reinstall Windows unless the Have To, so there isn't a neighborhood database; and, finally, I'm just ignorant about the ins and outs of Windows. I'm not as ignorant anymore, but before this I was happy if HsET would just get scanned for viruses and download all the proper updates. So this isn't a scathing indictment of Microsoft, because, while they could have made things a lot easier, I probably didn't do things in the most efficient way.

That said, here's the list of all the things I did to restore the system. It's not going to be well documented, but you should be able to GoogleTM a string to find the information.

Restoring Hal's Evil Twin

  1. Started with a working and updated copy of Windows XP SP2, with IE7, etc., on a 10 GB disk (this was my test install case)
  2. Hook up 120 GB disk as slave drive (middle plug on cable). In Linux this would be /dev/hdb
  3. Start windows
  4. Windows identifies drive, tells you to reboot
  5. Reboot
  6. Copy contents of 120 GB disk to backup disks, as necessary
  7. Hook up 120 GB disk as first disk drive, remembering to set the jumper to “cable select.”
  8. Put the Windows restore disk into the CD drive, turn on the computer
  9. When asked, have it format the HD. Use full format for NTFS disk
  10. Then tell it to install Windows. It will then hang at “Setup will complete in approximately 34 minutes” message. This is a well known bug: My file was mdmbcsm.inf. A previous test install indicated that simply restarting the installation may also work.
  11. Accept US defaults
  12. When asked, name the computer HsET
  13. Time is Eastern (GMT -5)
  14. Network connection wizard won't find a network until we install the wireless drivers. In fact, we'll have to install the Ethernet drivers as well, so there's nothing to do here.
  15. Defrag the disk. Probably not necessary, but it doesn't take much time at this point and makes the next step a little easier.
  16. Partition the disk. The idea is to have some shared data, mostly music and pictures, in a VFAT 32 partition so that the data can be read in Linux if (when?) I install a dual boot system. Do this with GParted, booting the computer with the Gparted disk.
  17. Use the Force I810 driver option
  18. Resize (Resize/Move) the partition from 114471 MB to to make it 73511 MB, followed by 40960 (40 GB) of free space. This will be the C: partition
  19. Format the 40 GB as VFAT 32 (Partition Tab) This will be the E: partition (as always, saving D: for the CD/DVD drive)
  20. Boot up, let the system check the disks, verify that the partitions are as they should be
  21. Install "Dell ResourceCD" on computer. Why Dell couldn't ship the drivers on the same CD with the XP install is beyond me.
  22. Install missing drivers:
    • Audio
    • Mouse
    • Intel Chipset Software Installation Utility
    • Intel 845 G/GL Integrated Video
    • Broadcom 4401 Integrated NIC Driver
  23. Reboot
  24. Up video settings to 1024x768 and 32 bit color
  25. Install D-Link Wireless Driver
  26. Reboot
  27. Install Service Pack 2. Use the Network Install executable, because it's a heck of a lot faster than using Windows Update.
  28. Reboot
  29. Configure Wireless Network
  30. Download and install McAfee Security Suite from Comcast
  31. Download and install Google Pack
  32. Do a Virus Scan (hey, you never know)
  33. Run Windows update, and run, and run, and run, rebooting as needed. Eventually you'll get the thing updated.
  34. Find driver for Wacom CTE-430 (Sapphire) (aka Graphire3) drawing tablet. Use the supposedly stable 5.01-9 driver.
  35. Load drivers for Canon iP4000 printer (reboot may not have been necessary, but I did it anyway).
  36. Load drivers for Microsoft Wireless Keyboard & Mouse. (A previous report of Microsoft Hardware's incompatibility with XP turned out to be a bad USB port. Linux & Things regrets the error.)
  37. Install (very old) copy of Photoshop Elements (from the original Wacom tablet package, as it turns out)
  38. Install (even older) copy of Office 97 (from a previous computer)
  39. Add all available updates to Office 97
  40. Install Nero CD/DVD Burning software
  41. Install Thunderbird and make it the default email client
  42. Move “Shared Pictures” and “Shared Music” folders to the E: disk, and create Shortcuts in the “Shared Files” folder on C:
  43. Set up user accounts
  44. Restore user files from backups
  45. Make Firefox the default browser for each account
  46. Make Thunderbird the default email client for each account
  47. Run msconfig.exe to turn off things you don't want starting up at boot: Google indexing (for now, anyway), that idiot toolbar that Office 97 put up on everyone's screen, anything else that isn't necessary.

And that should have been that.

Except this morning I decided to put everything back the way it was, i.e., HsET under the desk, printer where you can reach it, etc. So I unplugged everything, put everything back where it was before the unfortunate sequence of events, plugged everything back in, and turned the computer on.

It booted fine.

The keyboard doesn't work.

Neither the Microsoft Optical Mouse or the Wacom Tablet Mouse works.

There are several possibilities: I plugged things in wrong, the remaining USB ports on the computer are fried, or I've so offended Bill that he reached out through the Internet and strangled poor innocent HsET (not likely, that one). All of these require debugging, and I'm just too tired of it to work on it right now. Later today, maybe.

Friday, April 20, 2007

Virginia Tech

I really don't know what to say about the Virginia Tech shootings. Nevertheless, I feel as though I ought to at least make note of it. I've given talks at Virginia Tech, I have colleagues there, and I know students from our area who attend Virginia Tech. Thankfully, none of them were injured, but, of course, some of them knew one or more of the victims.

Our prayers are with all of you.

Saturday, April 14, 2007

THE Record Book

Every year, for decades, the people at The Sporting News has been putting out an annual Baseball Record Book. I have several of them on my shelf. Want to know how many no-hitters have been pitched? It's there. Record number of home runs hit by a second baseman? It's there. Want to see the famous Maris asterisk? Well, it wasn't ever there, but the older books did say that the home run record for a 154 game season was 60, by someone named Ruth, and Maris hit 61 in a 162 game season, until Mark McGwire erased both in 1998.

Used to be you had to pay for all of this, updated yearly. No more. This year, it's free. That's right, SN lets you download eleven PDF files that make up the whole book. If you want, you can print them out and take them to a binder, but you can also just view them on your screen, and they're searchable using xpdf, evince, kpdf, or even Adobe Acrobat Reader.

The Sporting News 2007 Complete Baseball Record Book

If this doesn't satisfy your baseball jones, then you need to join SABR.

Tuesday, April 10, 2007

Grammatically Correct Tag Line

A loyal reader informs me that the tag line I've been using, Fenestra delenda est, is incorrect, because “Windows” is plural. I was going to say that “Microsoft Windows” is actually only one product, and therefore singular, but then I remembered that we have XP Home, XP Professional, XP Media Edition, Vista Home Basic, Vista Home Premium, Vista Professional Homewrecker ...

I'm assured that the tag line is now correct.

Monday, April 09, 2007

Microsoft (Hardware) Works With Linux

I'm trying, slowly, to get all of the drivers working on the Windows box (see the last few posts). One bit of hardware we have for the XP is the Microsoft Wireless Keyboard/Mouse combo. This is a USB dongle which broadcasts to a wireless mouse and keyboard.

I've installed the drivers for the thing, but Windows still can't find it. If I can find the manual, or the TeenagerTM who installed the thing in the first place, I can probably make it work, as it Worked Before, but it's not automatic.

On a whim, I plugged the thing into my Linux box, and, voila, it worked. (I'm typing this post with it.) No drivers needed be be installed, at least with Ubuntu Dapper, and, I suspect, most major Linux distributions.

The default configuration for Hal is to use a Microsoft USB Optical Mouse plugged into a PS2 adapter and connected through a KVM switch. It's never given me a problem.

Conclusion: Microsoft hardware works best under Linux.

Much later: It turns out that the dongle was plugged into a bad USB port. Linux & Things regrets the error. In any case, Microsoft hardware usually works quite well with Linux.

Sunday, April 08, 2007

Broken Windows (XP) -- Part IV

Hey, I'm on a roll. Since last night I've

  • run Windows Update about a gadzillion times, rebooting more often than Mitt Romney changes his political position.
  • Found the ethernet and audio drivers.
  • Figured out what to do next:
    • Install the remaining drivers (graphics tablet, wireless keyboard, printer) and software (except MapleStory)
    • Copy it all to a DVD or two, or maybe one of those dual layer DVDs.
    • Install barebones XP SP1 on a big disk.
    • Copy all the files from the DVD onto the big disk.
    • Boot Windows from the DVD.
    • Restore all the old files I've archived.
    • Install remaining software (Office, Photoshop, etc.)
    • Install the never-to-be-sufficiently-fraked MapleStory.
    • Keep the DVD in a safe place, as a starting point for when I have to do all of this again.
    • Install a second disk on this machine, load up Ubuntu on it, and make it dual boot for my wife, who notes that she can finish reading her email in Linux during the time it takes the Windows computer to boot up.
    • Figure out how to get the DVD image into a form that qemu can use, so that “essential” Windows programs can be run from inside Linux.

Saturday, April 07, 2007

Broken Windows (XP) -- Part III

Everyone should have an Igor. I used to have two, but now I'm down to one. He swears that I can restore my trashed Windows disk without having to do a reinstall. In the meantime, just in case, I dug out an old 10 GB hard disk and plugged it into the Windows computer in place of the trashed disk. I'm in the process of installing Windows on that disk, just to see if I can do it. If I can, I'll feel more comfortable in reinstalling Windows on the bigger disk, if it comes to that.

In the process, I've noticed a few differences between the install process for a Linux distribution and the install process for Windows.

How to Install Linux

  1. Get a Linux install disk.
  2. Put it in the computer.
  3. Boot the machine.
  4. Answer questions about the installation process. In general, you can use the defaults.
  5. Select any additional software you want to install.
  6. Click the install button.
  7. Wait for Install to finish.
  8. Log on.
  9. Update software.
  10. Configure user accounts.
  11. Configure Network and Email Accounts.
  12. Enjoy.

How to Install Windows XP

  1. Dig out Windows installation disk, or, the days, the “recovery” or “reinstall” disk.
  2. Put it in the computer.
  3. Boot the machine.
  4. Accept the fact that there is nothing customized about this install.
  5. Find the driver disk(s).
  6. Install the needed drivers. (I still haven't found the Ethernet and Audio drivers. I did find the Wireless drivers, so I can connect the machine to the Internet that way.)
  7. Reboot.
  8. Since the only legal disk you can use to install Windows XP on this computer is set at Service Pack 1, download Service Pack 2. Note that this is the “Network Installation Package for IT Professionals and Developers.” Use this, or order the CD version. You're probably going to need it in the future. Further note that it's best to do this on another computer, since we don't have firewalls and virus scanners enabled yet.
  9. Install SP2.
  10. Reboot.
  11. Get antivirus software installed. I'm using McAfee, only because Comcast offers it free to subscribers.
  12. Reboot.
  13. Run Windows Update (or install Microsoft Update) to get latest updates for XP.
  14. Reboot.
  15. Install Google Pack. Select Firefox as the default browser.
  16. Install Mozilla Thunderbird. Make it the default email.
  17. Configure user accounts.
  18. Configure Network and Email Accounts.
  19. For each piece of software you need:
    1. Find it, via Internet or on CD.
    2. Install.
    3. Reboot as required.
  20. Enjoy?

Yes, it is so easy to install Windows, and so hard to install Linux.

Monday, April 02, 2007

Broken Windows (XP) -- Part II

After backing up everything on the aforementioned XP machine, I consulted my experts at work, who agreed that the first step should be to put the Windows Reinstallation disk into the CD drive, and boot it up. This should work, right? The computer boots and runs the Ubuntu Live CD without any problem.

Except it doesn't work. The system tells me to “Press any key to boot the CD”, and when I do, it goes straight to the same screens as the last time: First it says Windows won't boot, then when you tell it to boot in safe mode it coughs up a list of files, and finally, it blue screens.

This from an otherwise perfectly healthy computer that runs a live Linux CD without problem.

Meanwhile, people in the house are going through Maple Story withdrawal. It's not pretty.

And you wonder about the subtitle of this blog.