Fishing 1.0

Teague and Asher went on their first fishing trip this weekend. We went to Adam’s Canyon. They did a great job on the long hike into the canyon. Asher managed to get his pants and shoes wet after we had been there for about 2 minutes.

Each of them caught a couple of trout. We didn’t keep any.

This is Asher’s first fish. It was only a little longer than the worm we used to catch it. You might need to zoom in to see it.

Asher’s first fish

Teague and Asher worked together on this one. Teague got to reel it in and hold it for the picture:

Teague’s first fish

We decided to go somewhere without such a long hike next time. Of course, it will have to meet my other criteria: no fee for parking or entrance.

Now I have a blog post that Tina and Laura can understand.

MythTV on Ubuntu plus IRman

I’ve been running mythtv for a couple of years. It is much more flexible and feature-packed than any commercially available DVR. Last week Sam told me that the free service for the TV listings has closed up. There is a new fee-based service from Schedules Direct. Unfortunately, I was still running mine on Fedora Core 3, and a fairly old version of mythtv itself. The SD service requires the latest version.

So, I decided it is time to update & upgrade. I went with Ubuntu on both the backend and frontend. Why? Well, I’ve noticed Fedora is difficult to upgrade to the next version and package maintainers for mythtv tend to drop old distros. Ubuntu is fairly simple to upgrade–even without downloading a new install CD. So, hopefully it will be easier to keep up to date.

There are some nice metapackages for mythtv in the Ubuntu repositories (can’t remember which ones–but they show up in Synaptics Package Manager). The backend version installed everything I needed and even setup the initial configuration. Oh, and my Hauppage PVR-150 required zero configuration. It just worked! I did have to update the packages with the latest build from mythbuntu in order to use the SD service. But they have easy instructions for doing it.

The frontend was a little more tricky. Using the “ubuntu-mythtv-frontend” metapackage was pretty sleak. It adds a mythtv user and enables auto-login; and it starts the OpenBox window manager and the mythtv client automatically when the machine boots up. That made it tricky to disable the screensaver since I couldn’t find a config file. So here’s the secret:

1. Let it boot up like normal. Then exit the mythtv client.

2. You’ll see a countdown for the auto-login. Login as some other user (you probably created one when you installed Ubuntu.) From there, change the password for the mythtv user using the admin tools. Make sure you know what the password is. Then log out.

3. The countdown will show up again. Type the username ‘mythtv’. Don’t enter the password yet. From the options menu, set your session to Gnome. Then go ahead and login with the password you created in step2.

4. When it asks you if you want to change your default session to Gnome–or just use it for this one session, be sure to tell it you only want Gnome for this session.

5. Use the regular screensaver tool to disable it. Then log out.

All set.

Now, I also mentioned IRman in the title. I’ve had one for years, but I never could get it working. I decided to make it work this time. Just my luck, IRman support is broken in the current version of lirc. The site says there is a fix in the CVS version. Cool.

So, I downloaded the CVS version and tried to build it. There must be something broken in the configuration scripts, because it never started configuring anything after I exited the menu. So, I tried the latest CVS snapshot (v0.8.2pre3). That installed fine, but IRman still didn’t work.

(Oh, by the way, the irrecord tool worked fine to setup the remote, but lirc itself wouldn’t respond using the IRman.)

After trying all sorts of versions, here’s what finally worked:

1. Download the latest CVS snapshot mentioned above. Extract it.

2. Checkout the latest files from CVS. Copy the contrib, daemons, doc, drivers, remotes and tools folders from the CVS folder to the folder you extracted to in step 1.

3. Run “configure.sh” and choose “IRman” from the “Other Serial Device” menu. When you save and exit the program, it will configure lirc. Then just “make” and “make install” the lirc package.

I probably should mention, you’ll want to uninstall the Ubuntu version:

sudo apt-get remove lirc

When I did this, it kept my lirc startup script in /etc/init.d, but I had to modify it since lirc installed itself somewhere else. To find it, just do:

which lirc

(or maybe it was “which lircd”)

The rest of the setup for a mythtv remote is pretty simple. There are plenty of writeups once you get past this point. Here’s one:

http://www.keeto.net/articles/mythtv_lirc_irman.html

So, there you have it, my very unclear instructions.

Using RubyODBC in Rails on Linux to connect to MS SQL Server

(I really need to work on shortening my titles.)

I spent the day trying to figure out one little problem. I setup a brand new server for the Intranet at work. I set it up with Fedora 7 and started configuring it for my rails apps. Since our corporation has decided to use Microsoft SQL for all databases, I turned to the instructions on the Rails wiki to setup ODBC.

Most of it went pretty smoothly. When I was done, I launched mongrel and checked the site using http://ip_address:3000. It all worked great. So, then I setup mongrel_cluster and fired it up. No workey. I kept getting database errors saying “No data found.”

The very misleading error was hard to solve. I finally found a post which explains that there is a bug in RubyODBC which does not play well with “text” columns that are blank. So, the answer is to set all your blank fields to NULL. Well, I couldn’t figure out how to do that. (MSSQL is not my favorite.) I finally figured out to use a whole bunch of these queries in SQL query analyzer:

UPDATE tablename SET description=" " WHERE description LIKE ""

(There’s a space between the first set of quotes, but not the second.)

So, that fixed everything for now, but I also had to make sure it doesn’t happen again. I couldn’t get the default value in SQL to do what I needed, so I added a bunch of these in the model code for each problematic model:

def before_save
if self.description.blank?
self.description = ' ' #(two spaces)
end
end

Hopefully this will help somebody else.