Sunday, April 29, 2007

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:ping http://www.google.com/

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.

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.

where obviously you replace Our_House and the psk string with the appropriate values for your network.

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:

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/wifi_wpa.sh with the following content:

To get wifi_wpa.sh 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/wifi_wpa.sh /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."

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?

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:

Go to the archive page, and select the month and year of the program you want to hear. Click GO

Scroll down to the show you want, click on the date.

On the next page, right click on the “Listen to the whole show” line, and chose the “copy link location” option.

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:wget http://www.publicradio.org/tools/media/player/phc/2007/04/21_phc
which will return a file named 21_phc.ram. (Obviously the numbers will change with the date of the show.)

$ wget `21_phc.ram`
(Note that those are backquotes.)

This yields a file named 21_phc.smil. If you cat that file, you'll find a string like rtsp://archivemedia.publicradio.org/5559/phc/2007/04/21_phc.rmThat's the audio stream.

This produces a WAV file. You can produce MP3s directly with this method, but they are terribly compressed.

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

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:

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.

Burn a Ubuntu Feisty Fawn (7.04) Live CD.

Boot it.

Weird. The text screen resolution went Apple ][: 40x25.

However, the GUI is fine. Wacom mouse works out of the box, as does the wireless keyboard.

There is a warning message that we're using a Restricted Driver for the WiFi card.

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

Click the Install Button.

Language: English.

Time Zone: EDT (New York).

U.S. English keyboard

Set up partitions as above. (Manual install.) Does it really have to rescan the disk every time you click the mouse?

Saturday, April 21, 2007

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.

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

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)

Hook up 120 GB disk as slave drive (middle plug on cable). In Linux this would be /dev/hdb

Start windows

Windows identifies drive, tells you to reboot

Reboot

Copy contents of 120 GB disk to backup disks, as necessary

Hook up 120 GB disk as first disk drive, remembering to set the jumper to “cable select.”

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.

Defrag the disk. Probably not necessary, but it doesn't take much time at this point and makes the next step a little easier.

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.

Use the Force I810 driver option

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

Format the 40 GB as VFAT 32 (Partition Tab) This will be the E: partition (as always, saving D: for the CD/DVD drive)

Boot up, let the system check the disks, verify that the partitions are as they should be

Install "Dell ResourceCD" on computer. Why Dell couldn't ship the drivers on the same CD with the XP install is beyond me.

Move “Shared Pictures” and “Shared Music” folders to the E: disk, and create Shortcuts in the “Shared Files” folder on C:

Set up user accounts

Restore user files from backups

Make Firefox the default browser for each account

Make Thunderbird the default email client for each account

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

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.

Saturday, April 14, 2007

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.

Tuesday, April 10, 2007

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

Monday, April 09, 2007

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.

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

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

Get a Linux install disk.

Put it in the computer.

Boot the machine.

Answer questions about the installation process. In general, you can use the defaults.

Select any additional software you want to install.

Click the install button.

Wait for Install to finish.

Log on.

Update software.

Configure user accounts.

Configure Network and Email Accounts.

Enjoy.

How to Install Windows XP

Dig out Windows installation disk, or, the days, the “recovery” or “reinstall” disk.

Put it in the computer.

Boot the machine.

Accept the fact that there is nothing customized about this install.

Find the driver disk(s).

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

Reboot.

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.

Install SP2.

Reboot.

Get antivirus software installed. I'm using McAfee, only because Comcast offers it free to subscribers.

Reboot.

Run Windows Update (or install Microsoft Update) to get latest updates for XP.

Monday, April 02, 2007

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.