Category Archives: Geek

All things geek

I’m sorry, Keith, I’m afraid I can’t do that. (FC3, HAL, and iPod)

I updated my desktop to Fedora Core 3 over the weekend. Technically, Fedora would consider it a fresh install, I just kept /home /work /usr/local and /opt. It all went smoothly thanks to my love of apt for rpm and the various repositories that I’ve talked about before that I use to keep me from hand compiling almost everything. The only thing I’ve done differently this time was that I’ve added DAG’s apt/yum repository to the mix.

With FC3 comes some new ways to get external devices going easier. udev, which “is an implementation of devfs in userspace using sysfs and /sbin/hotplug,” used to be an add on, but is now a central part of the distribution. udev is configured in such a way that it controls all of the /dev entries. Along with udev is the addition of freedesktop.org‘s Hardware Abstraction Layer software. This isn’t like the HAL in some other operating systems and based on the documentation that is not the goal. From the documentation:

HAL which is a piece of software that provides a view of the various hardware attached to a system. In addition to this, HAL keeps detailed metadata for each piece of hardware and provide hooks such that system- and desktop-level software can react to changes in the hardware configuration in order to maintain system policy.

Its not the world’s most useful thing yet, but considering FC3 ships with version 0.4.2 its doing a good job for its level of maturity.

One of the most useful things that HAL provides FC3 is the auto configuration of devices that would have removable media, such as cdrom drives, or is added via USB or firewire. In its default configuration is works pretty good: udev creates the /dev nodes and HAL, after scoping out and probing the hardware, creats mount points in /media and calls /usr/sbin/fstab-sync (which comes with HAL) to edit /etc/fstab with the entries. For my devices that have removable media, HAL has noticed my CD and DVD burners and has created /media/cdrecorder and /media/cdrecorder1. If I connect my iPod up via firewire, I see that /media/ieee1394disk is created. Putting a compact flash card in a slot of my 8-in-1 USB media reader, I see that /media/usbdisk is created.

As I said before, this is pretty good. However, there were a few things that bugged me that I wanted to change. The first problem I ran into was that hald, constantly probes attached media devices for media changes. This works great for my 8-in-1, as it correctly drops access to the device when I run /usr/bin/eject on the mount points. However, this fails dismally with my iPod.

In FC2, to get the iPod to go into the “OK to remove” mode, the eject command did the trick. In FC3, thanks to hald, it tries to spin up the iPod harddrive again. However, the iPod, after its in “OK to remove” mode will not respond to any commands from the computer until removed from the cradle. hald trying to contact it again causes the SCSI subsystem to go into a loop trying to reset the device and the SCSI bus, causes hald to hang, and generally really pisses off Linux. Since this whole ordeal ends with the SCSI subsystem kernel panicing and hald being stuck in a disk wait, the only thing to really get things back to normal that that point is a reboot. The reboot then has some issues thanks to hald being in disk wait, and Linux can’t cleanly unmount /usr.

So, obviously, I wanted to fix the “everything goes to shit when I want to remove my iPod” problem and I wanted to create a better mount point name for the iPod. Face it, /media/ieee1394disk is pretty weak and /media/iPod is much sexier.

I started digging around the hal package to see what docs came with it and what the config files were. The documentation that ships in the RPM is fairly non-existant except for some sample Device Information Files aka .fdi files. Next I looked in /etc/hald/hald.conf. That had a directive called storage_media_check_enabled which was set to true. Setting that to false and halfway fixed my iPod problem, except now two mount points were showing up in media. Also, setting it to false broke the 8-in-1 which was behaving perfectly. Not wanting to throw the baby out with the bathwater, I set it back to true. This setting, however, started to point me in the right direction.

Next I discovered the hal-gnome package by doing an apt-cache search hal. From this I found the misnamed /usr/bin/hal-device-manager. I say its misnamed as you get a Windows-style device manager view, but you can’t actually manage anything, its totally a read-only view. However, this let me see the properties that were being set for each device and its volumes along the way. Thanks to hal-device-manager I was starting to be able to read the .fdi files. However, my next question was “what are all the possible values of propery names that can be set?” For that I needed more documentation.

I visited the freedesktop.org hal site (as linked above) and it didn’t have anything really useful on it. I was getting motivated enough to just start reading C code, so I downloaded the hal-0.4.4 source from freedesktop.org. To my delight, there was actual useful documentation, albiet in raw docbook XML form. I almost cried, but I pulled myself together and typed make to build the documentation into a useful HTML file. Here was a list of all the possible properies, where they were good, and mostly good descriptions of what they did. I still didn’t have a full enough understanding, so it came time to start experimenting.

In my experimenting, I focused totally on making the iPod work the way I wanted and figured I’d tackle the 8-in-1 later as it mostly works the way I want now. The existing .fdi files have a comment that says to create system local files in /usr/share/hal/fdi/95userpolicy as all the other files in the other directories could be overwriten when/if the vendor updates the hal package. I started to write an iPod.fdi file and based my <device> entry on some of the existing firewire disk entry and merged it with the sample firewire connected hard drive example from /usr/share/doc/hal-0.4.2/conf

What I ended up with after my experimenting is something that seems to work really well. It turns off the media check just for the iPod, ignores the first partition used by the Apple Firmware, and makes a mount point at /media/iPod for the second partition where all the music lives. I also was able to add the sync mount option to the automatically created fstab entry. Lots of iPod on Linux people suggest mounting the iPod in sync mode, but I forget exactly why at this moment as my brain is running out of juice as I’m ending of this post.

This was through a bunch of trial and error, and if someone has a better way to do it, please let me know.
Here is my /usr/share/hal/fdi/95userpolicy/iPod.fdi

<?xml version="1.0" encoding="ISO-8859-1"?>  
<deviceinfo version="0.2">
  <device>
    <match key="storage.vendor" string="Apple">
      <match key="storage.model" string="iPod">
        <merge key="storage.requires_eject" type="bool">true</merge>
        <merge key="storage.removable" type="bool">false</merge>
        <merge key="storage.media_check_enabled" type="bool">false</merge>
      </match>
    </match>
    <match key="@block.storage_device:storage.vendor" string="Apple">
      <match key="@block.storage_device:storage.model" string="iPod">
        <match key="block.is_volume" bool="true">
          <match key="volume.fsusage" string="filesystem">
            <match key="volume.partition.number" int="1">
              <merge key="volume.policy.should_mount" type="bool">false</merge>
            </match>
            <match key="volume.partition.number" int="2">
              <merge key="volume.policy.desired_mount_point" type="string">iPod</merge>
              <merge key="volume.policy.mount_option.sync" type="bool">true</merge>
            </match>
          </match>
	</match>
      </match>
    </match>
  </device>
</deviceinfo>

but there is no joy in Mudville…

The mighty Ken Jennings struck out.

Today was the day, as reported everywhere. 74 time champ of Jeopardy, was defeated. That’s not all that bad as he broke zillions of records and won 2.5 million dollars. Ken is a software designer and he seems to be a hell of a nice guy. He’s now hero to trivia geeks everywhere. Sarah and I have really been enjoying watching him win game after game.

Part of the story that really amuses me is that he was felled by Nancy Zerg. Not that I know Nancy, but technically, I work for her. Zerg is a REALTOR® from Los Angeles.

I can’t wait for this seasons Tournament of Champions and the return of Ken!

The blog battle against spam

I’ve been being hit with comment spam on my blog for a bit. At first it was just one or two comments a week and I’d go in and nuke them from the database. Then it got to be 15 at one time from a dozen IPs. At this point I turned on moderation for all comments. This wasn’t great, but it was workable since I don’t get all that many comments, spam or otherwise. However, it got unmanageable yesterday when the I had about 60 comment spam posts to moderate. This morning I decided to look into what else I could do about it.

Browsing the WordPress site I found the following wiki article: How to combat comment spam with WordPress. It talks about the stuff that is built into wordpress, which is what I had been using. It then talked about renaming certain files to get around the bots, which seems like an unmaintainable idea in the long run.

Finally, at the bottom of the page was a link to something I thought was workable. Gudlyf has posted a plugin he wrote for WordPress called AuthImage. It does a simple captcha test as a reader posts their comments. I figure I’d give this one a try. It puts a slightly added burden on the random comment poster, but it allows me to turn off moderation and still avoid getting the spam messages.

LOAD “:*”,8,1

I got to take a geeky trip down memory lane last Sunday morning.

I was over at my parents and they were cleaning out the storage room in the basement. One of the things to go was one of those VHS wall storage units. We had moved it to the basement long ago and it became a storage unit of whatever we could think to cram in there. Somewhere along the way, it started to get all my computer stuff. Basically, anything that I had for my Commodore 128 in terms of manuals and software was stuffed in there.

Emptying it out to take it up, I came across Ahoy! and Compute! magazines with reviews, articles, and code listings that were pages long. I remember typing in the source for hours to play the cheesy games or play with the silly utility. Some of them were in Commodore BASIC for 128, but some was for the Commodore 64 which the 128 could emulate. A majority of them seemed to be hex listings, again for both platforms, that were pages and pages long. I remember the hex listings being an evil, evil bitch.

I also found about 50 5 1/4-inch floppies. This was the real source of nostalgia for me. Many of the had the writable notch for the other side of the disk put in by hand/scissor, while some actually came that way, and then there was the ones that were done with a tool just for the job. There were notes to myself and my parents on the sleeves about how to launch the games and applications, even the labels about what games and applications are on the disks. The list is too long, but to name a few that jumped out at me: GEOS, Summer Games I and II, Winter Games, Jumpman Jr., H.E.R.O. and Pitfall II.

Finally, I found one of the most useful things in my whole Commodore arsenal: the Epyx FastLoad cartridge. This sped of loading of data from the floppy drive on the Commodore 64 about 5 times. From what I remember, it would basically replaced the firmware of the floppy drive (in its operating memory) and gave it much, much more efficient loading routines. It also provides some common command shortcuts to load games. I forget the key combo, but I think it was commodore-control and it would execute LOAD ":*",8,1 and then type RUN<enter> when the READY. prompt was displayed. FastLoad didn’t work with all games, but it made a shit load of difference on the games it worked with. The weird thing is that I just googled for a page all about FastLoad and I couldn’t find one, I thought for sure someone would be out there singing the praises of it. Unfortunately, I’m not knowledgeable enough to write one.

Anyway, after my walk down memory lane ended at the garbage can where I trashed all this stuff. I haven’t touched it in at least 12 years, anything I would have needed form them I’ve transfered over to a PC long ago. As hard as I tried, I couldn’t come up with a single reason to keep any of that crap. Thus is the coda of one chapter of my geeky life….

The First Debate

Sarah, Dinah, and I watched the debates tonight. Dinah managed to stay away through the whole thing instead of falling asleep like a bored kid should. 🙂 In any case…

Kerry did really well tonight. For some reason I didn’t expect him to do that well, but he was really in his element tonight. In many cases President Bush seemed to be on the defense. Way more on the defense than I expected him to be. It was really interesting and I glad we watched the whole thing. It was amazingly on focus and amazingly based in the present for how this campaign has gone so far. I would however like a count of how many times each candidate broke the rules they agreed to. Sarah and I noted many times when Bush strayed from the rules, however, I’ll admit we’re of such a mind that we’d notice that more.

People were starting to say it was over and was starting to hand everything to Bush. I admit that I was starting to lose faith. (Of course, I listen to too much talk radio especially on a station that has scared away all the non-insane-right listeners except me and a handful of others.) The debates have certainly reenergized me. While my decision has been made for a long time, I hope my fellow citizens who were undeceided are no longer.

The other thing that really struck me as intresting is what I was doing while watching the debates. I was on IRC where I hang out with many people I know. We basically had instant discussion as the debates were going on. Its really amazing what technology allows us to do. I was talking with people in California, Washington, Illinois, and Michigan. While IRC isn’t new technology, its allowed us to fact check between us and debate points as they came up.

Unfortunately, I couldn’t participate as much as I would have liked since I had to hold, feed, and put Dinah to bed. Dinah is way more important than chatting on IRC. It would have been less of a nice evening without doing that with my daughter.

One more thing, I’m watching this as I type. The Daily Show is in full effect with instant response. The best source for news with the most educated audience!

Other Things DC

The other thing DC has done well lately is the Justice League and Justice League Unlimited shows. I was afraid that the quality would decline when they switched over to Unlimited and changed from the multi-part to single episode format. My fears have been unfounded as its been really good.

I like that with Unlimited we’re getting a mix of characters and really getting a good sense of all the characters outside of the Big 5. The Big 5 are a good draw, especially for the kids to latch onto. However, the DC universe has so many other great characters that its been wonderful to see the animators take advantage of that. On DC’s part, its a great tool for cultivating the young viewers of today to be the comic readers of tomorrow.
Continue reading Other Things DC