Fixing openoffice.org fonts..

I use openoffice.org all the time on my Debian server box, most of the time through a VNC connection. Problem is, the fonts have always looked horrible. ISTR that they weren’t always bad, but they’ve certainly been bad for awhile. Well, today I finally sat down and fixed it.

It all started out when I upgraded the system (which I hadn’t done in forever) to get some updated packages. I was hoping that would fix my OO.o font problems, but it didn’t, so I dug a little deeper…

Basically, there are two issues I was seeing:

  1. The menu font was cartoonishly large in proportion to all of my other apps; and
  2. It appeared that anti-aliasing was not working or something, because all of the fonts had a very crude, blocky scaled look to them.

None of this prevented me from using the system, but it sure didn’t make it enjoyable. Anyhow, first I tackled the ugly-scaled-fonts problem. I noticed that I didn’t have the problem when I started OO.o directly on an X.org display. The problem was limited to the VNC server. The solution turned out to be starting Xvnc with a depth of 24 bits instead of 16. Don’t ask me why it works, but it does. It remains to be seen if the increased resolution will cause any performance degradation over my slow DSL uplink. I’ve not noticed any difference over our 100mbps LAN at home.

I solved the second issue by adding the following line to my $HOME/.Xresources file:

Xft.dpi: 85

So there you have it. As always, Google was extremely helpful in tracking down this info. References here and here.

Let’s go paperless

I’m on a paperless kick. I’ve decided that I have too much paperwork cluttering up my file cabinets, desk drawers, etc., so I’m getting rid of as much of it as I can. My goal is to shrink my paperwork collection down so that it only takes up one file cabinet (I currently have three). It’s one part of an overall downsizing theme that’s pervading our household lately, the idea being that if we get rid of as much stuff as possible now, it’ll be easier to move into a smaller, lower-maintenance house down the road.

It’s also getting easier to go paperless. More and more billers, financial institutions, etc. are offering electronic (usually PDF) statements with the option of turning off paper mailings. It took me a little while to warm up to this technology, but now I’ve accepted it wholeheartedly (the key was deciding that I trust the online delivery mechanism more than I trust our mailman).

The centerpiece of the paperless scheme is what I call a “virtual file cabinet”, which is just a fancy name for a directory hierarchy to hold PDF documents. I use ‘unison’ to keep an exact copy of the hierarchy on a different machine, which serves as an effective backup scheme.

I’ve centered on PDF as my document format of choice, because it works well and is used by the majority of the e-document providers I deal with. And that means that everything that is not PDF, has to be converted to PDF. The best way I’ve found to do this is to set up a virtual “PDF Printer”, which creates a PDF file in lieu of actually sending the document to the printer. Then, just send the document to the virtual queue to create a PDF. This saves a step over printing the document to a file (which creates a PostScript file which then must be converted with ps2pdf). And some apps, like H&R Block’s TaxCut, don’t allow printing to a file, but they’ll happily send stuff to the PDF queue.

Setting up the PDF printer on my Ubuntu machine was a piece of cake, following these instructions. Condensed version:

  1. sudo apt-get install cups-pdf
  2. sudo chmod 4755 /usr/lib/cups/backend/cups-pdf
  3. Go to System -> Administration -> Printing -> New Printer
  4. Select ‘PDF Printer’
  5. Select ‘Generic’, ‘postscript color printer’ driver

It was a little more difficult, but not overly so, to set this up on my home server box (and also configure our Windows box to print to it). See the Wiki for details.

XP and QEMU

Last week I decided to try building a virtual machine to run Windows XP. I figured I’d install XP, install all the recent patches, then make a snapshot of the virtual disk. Then I’d have a clean XP install that I could use to run various apps as needed. Several years back I purchased a copy of VMWare for this purpose, and it worked great. This time around I figured I’d try QEMU, an alternative emulator that’s free. Now, I’ll prefix this by saying that my host machine (a Debian Linux box) is somewhat underpowered to run an XP guest OS. It’s a 700mhz PIII with 512 megs of RAM. It works, and it’s usable, but it’s quite comically slow. In particular, I’d estimate that the installation process took about 12 hours (this was spread out over several days of occasional attention, so I don’t have an exact figure). The basic XP install goes something like:

  1. Install XP from CD.
  2. Install Service Pack 2.
  3. Download and install recent updates from Microsoft to bring the installation completely up to date.

And that’s essentially what I did. The process was marked by long periods of waiting and wondering if it was hung, followed by entering some info in a dialog box, follow by more long periods of waiting and wondering if it was hung, etc. etc. etc. I ran into a couple of known QEMU/XP issues:

  • After the initial install, the reboot hangs on the “Windows XP” splash screen with the message “Please Wait”. Resetting the machine at this point seems to get it moving along again.
  • After initially logging in as “Administrator”, I got a dialog box that said “A problem is preventing windows from accurately checking the license for this computer. Error Code: 0x800703e6.”. Following some advice on the qemu-devel mailing list, I booted into safe mode and installed Service Pack 2, and that fixed this problem.

After that, there was lots more waiting while it downloaded updates, installed IE7, etc. etc. etc., but it eventually finished and left me with a working system. How much use I get out of it remains to be seen, but at least all the effort wasn’t for naught. Recommendation: if you’re going to do this, use a beefier machine than I did 🙂 Also, I highly recommend building and using the kqemu kernel accelerator module. For me, this sped things up from “super mind-numbingly comically slow” to just “comically slow.” And the final tip: If you think it’s hung, go to the host OS and check for activity on the virtual disk image. I lived by this during the install.

And in other news… it’s tax time again! And, this year I’ve decided that I’m tired of getting refunds. Even a “nominal” refund (say $100-$200) is still an interest-free loan to Uncle Sam. So it occurred to me, why don’t I just estimate our 2007 taxes and adjust my withholding appropriately so that I end up owing a nominal amount, instead of getting a nominal refund. Then, with each paycheck, I’ll set the extra amount aside in an interest-bearing account. When next year’s tax season rolls around, I’ll pay the amount owed, and the remainder becomes my “refund”. Seems like a no-brainer, and I wonder why I didn’t come up with this sooner. The complicated part, of course, is estimating our 2007 taxes and avoiding the whole underpayment/penalty/interest thing. But I’m going to give it a go.

Bye-bye Taxcut, hello TaxACT

Don’t look now, but it’s Tax Season again. This is usually the time of year I start looking for the best deal on H&R Block’s TaxCut product, which I’ve been using for several years. Truth be told, I’ve always been pretty happy with TaxCut. I usually pay between $15 and $25 for the “Deluxe” product (or whatever they’re calling it in the given year) which in the past has included “free” federal e-file and one “free” State (after rebates of course). However, this year it appears that Block is no longer offering the free e-file, so that prompted me to look around for a better deal.

To me, there are three important things to consider when choosing a tax preparation product:

  • Convenience. I’m sure I could use the old paper-and-pencil method, maybe with the help of a spreadsheet or two. But truth be told, that’s not really an option for me at this point of my life. It’s just too tedious and time-consuming. Tax preparation software is well worth a (nominal) price in terms of time and headache saved.
  • Accuracy. Obviously, the software isn’t worth anything to me if it doesn’t accurately complete the return.
  • Cost. The cheaper, the better.

Anyhow, I think I’ve found what I’m looking for: TaxACT online for Federal, and Maryland’s free (and excellent) iFile system for State. TaxACT will supposedly complete and e-file my Federal return for free, so combined with iFile, my total outlay this year will be a grand total of…. $0! And no rebates to bother with, either. Time will tell how well this works, but it sure seems ideal, so I’m hoping it works out. Stay tuned.

Late Christmas Present

Got a late Christmas present yesterday from an unlikely source: my employer’s 401(k) provider. Well, it actually came in early October, but I didn’t notice it until the other day when I checked my quarterly statement. Now, the plan has always had a decent selection of investment choices, but there have always been a bunch of things that bother me about it…

  1. The plan has a board of trustees that determine the investment choices, and the board has a habit of eliminating various mutual funds (replacing them with others) after relatively short periods of underperforming.
  2. The investment options are mainly regular, non-proprietary mutual funds with ticker symbols, etc. However, the provider, being an insurance company, feels the need to treat the funds as annuity investments, and tracks them using its own ‘unit’ system rather than using the funds’ actual NAVs.
  3. The fees are higher than they should be (although the provider passes on some mutual fund management fee reductions it negotiates, and these offset the provider’s fees somewhat, though not nearly enough).
  4. The quarterly statements have never made sense. The number of ‘units’ owned never adds up to the sum of ‘units’ purchased with each deferral to the plan. This, to me, has always been the biggest problem with the plan. It makes it impossible for me to (properly) track my account with my financial software, and leaves me wondering what’s actually going on behind the scenes.

Anyhow, in early October the provider quietly took a huge step in the right direction by abandoning its unit scheme and switching to a share-based valuation system using the funds’ actual NAVs. All of a sudden, the statements make complete sense, and I can track my account day-to-day because the fund NAVs are available online.

I still think the fees are too high, but I have to say I’m much happier with the plan now.

Card Reader

So, for the past year or so I’ve been using my Palm Tungsten E2, with 1-gig SD card and headphones, as a portable mp3 player, because it’s there, and it works. It’s actually kind of cool — I can play games, read e-books, etc. on the Palm while listening to music. It’s quite the thing if you want to completely tune out everything around you. Yeah, the Palm-as-mp3-player thing leaves a bit to be desired — the bundled player software (RealPlayer) sucks, and there’s a constant background hiss reminiscent of my old 1980s Sony cassette walkman. Quite nostalgic, but this is 2007 — but like I said, it works.

Up till recently I used a software package called Softick Card Export II to copy music to the SD card on the Palm. It’s a nifty package that makes the Palm emulate a USB mass storage device (one wonders why the Palm doesn’t do this out of the box, but I digress). And it works, but it’s e-x-c-r-u-c-i-a-t-i-n-g-l-y slow. It takes, like, 20 minutes to copy a couple of CDs worth of 192kbps mp3s to the card. You have to wait forever for the initial copy to happen, then wait forever again for the data to “sync” to the card, so you can remove it safely. I grudgingly dealt with this for a year or so, because I figured that’s just how it was with these things. Then this past Christmas, the wife got a dedicated flash-based mp3 player. And while playing around with it, I couldn’t help but notice that file transfers to it were light-years faster than transfers to my Palm through Card Export. And I began to think, well, maybe it’s the Palm and the software-based USB storage emulation slowing things down for me. So, I went to Best Buy and paid $15 (a buck less than what I paid for Card Export, BTW) for a USB SD card reader/writer. And indeed, it’s absolutely light-years faster than Card Export.

When I initially bought Card Export, I figured a card reader might be a little faster, but I had no idea it would be this many orders of magnitude faster. Live and learn I guess. I’m not knocking Card Export here, as it definitely has its niche, but it looks like the card reader is the way to go for larger transfers.

Fun with Michael’s future bedroom

Well here it is New Year’s Eve again. Once again, I took a nice, (2 week) long holiday break from work. And once again, I started out hoping to get tons done around the house, but it didn’t happen. Well OK, I got some stuff done, just not as much as I wanted to. It’s tough getting much done around the holidays, even when you only consider the social and family obligations. Then you add two young children to the mix, and that’ll be all she wrote. Next year I may rethink the long break, and maybe do a week around the holidays and another week a little later in January or Feburary.

In any case, I did manage to get several solid hours of work in on Michael’s bedroom, mainly trying to fix up the water-damaged area around the window seat. It’s a huge mess. I finally got all the crumbling plaster removed, and squared up all the openings, so I can patch the areas with drywall. The Dremel diamond wheel does a pretty good job at cutting through the plaster topcoat. If I run a shop vac at the same time, there’s not much dust. However, the Dremel isn’t the ideal tool for making square cuts in the plaster, because the tool itself is wider than the cutting wheel. I was able to make do with it, but what I really need is a tool that won’t get in the way of the cut, like a tiny angle grinder.

It will be really interesting to see how the finished product ends up looking. There are some issues with using drywall to patch plaster. It’s hard to get the drywall exactly flush with the existing plaster surface. In particular, the thickness of the plaster can vary from place to place, while drywall is always a single uniform thickness. I think I’ve got it pretty close, and my current plan is to skim-coat everything with drywall mud to get a smooth surface. I’m cautiously optimistic that this will give me a good final surface. Time will tell.

Once the window seat area is done, I have the other walls to prep. The existing paint is in horrible shape, so it looks like I’ll be doing more skim-coating…

mp3act hacking

9 months or so ago, I installed mp3act, a PHP-based online MP3 streaming server. I’ve found that I really like it, but like everything else, it would be oh-so-much cooler with a few little tweaks. Development on it seems to have stagnated (no releases since mid 2005), so I’ve decided to hack on it a bit to make it do my bidding. So far, I’m really happy with the results.

Here are some of the issues I’m trying to address:

  • mp3act doesn’t deal well with albums containing multiple artists. It breaks each unique artist out into its own separate album. So for example, if you have an album called ‘great songs’ containing songs from artist a, artist b, and artist c, mp3act will create 3 albums called ‘great songs’, each containing songs from one of the three distinct artists. This is not what I want.
  • mp3act doesn’t handle artist sorting very well. If you have an album by Tom Petty and the Heartbreakers, mp3act displays it under ‘T’. If you want it correctly filed under ‘P’, the mp3 would need to be tagged ‘Petty, Tom and the Heartbreakers’, which again, is not what I want.
  • mp3act’s search and download features are a little lacking. The search results page allows you to play and/or add songs to playlists one by one, but there’s no ‘play all’ or ‘add all to playlist’ feature. And, it only allows downloads of albums. A ‘download playlist’ feature would be really useful.
  • With multiple-CD sets, if the songs on multiple discs are grouped under the same album name, mp3act will interleave the tracks together (disc 1 track 1, disc 2 track 1, disc 1 track 2, disc 2 track 2, …).

There are a few other little things, but those are the biggies. I’m taking a two-fold approach to dealing with these: tweaking the mp3act database tables for some, and tweaking the mp3act PHP code for others.

mp3act’s database schema is simple and easy to understand. It has a few quirks (biggest quirk: the year field is associated with albums, when in fact, it should be associated with songs), but I’ve found that I can get a lot done just by importing music into the database, and then going through manually and tidying things up. Specifically, I’ve corrected the multi-artist album problem and the multi-disc track interleaving problem this way.

To reconstruct a multi-artist album, first find all of its parts:

select * from mp3act_albums where album_name like '%name here%'

Note album IDs, which are typically consecutive. Then create a new artist, if necessary, for the album:

insert into mp3act_artists values(null, 'Various Artists', '')

Now create a new album:

insert into mp3act_albums values(null, 'name here', last_insert_id(), 'genre here', year, '')

Then, using the album IDs from the first query, re-associate songs with the new album:

update mp3act_songs set album_id = last_insert_id() where album_id between low id and high id

And finally, delete the old, no-longer-used albums.

delete from mp3act_albums where album_id between low id and high id

That’s it. Now, this works great, but it does introduce a couple of problems. First off, when you browse to one of these albums, it doesn’t show the artist name in the track listing. And secondly, there’s now no way to browse to the individual artists that make up the album (unless you have other albums by those artists). The first issue is a quick, easy fix to the PHP code. The second is more complicated. For this one, I added a separate ‘browse’ option that browses songs by artists, instead of albums. It was a bit of work, but not too bad.

And so it goes. Here’s a summary of all the changes I’ve made so far.

  • Fix database to deal better with multi-artist albums
  • Fix database to deal better with multi-cd track ordering
  • Show artist name in track listing for album/song browse
  • Add ‘browse for songs by artist’ feature
  • Create custom genres for some albums. This is easy to do and you are not limited to valid ID3 genres, which is nice, because they suck.
  • Modify ‘browse for albums by artist’ to not show artists with no corresponding albums
  • Fix artist sorting issue by adding ‘sort key’ field to albums table, and modifying artist entries where the sort key is different from the artist name

mp3act works very well for me with these changes, and the framework has the potential to do a lot more. Over time I’ll keep hacking on it to add features and improve its operation.

Followup… My next big “to do” is to make the album downloads more flexible. mp3act handles downloads by building a zip file on the fly, then sending this to the browser as an attachment. But the zipfile library it uses (which is included with the app) is kind of bare-bones, and it requires the mp3 library to have a certain directory structure. Looking at this library, it’s easy to see why downloads are not as flexible as I would like. Fortunately, PHP 5.2 now includes a much nicer built-in zipfile library, so the first step is to modify mp3act to use this. At that point, I should be able to greatly improve the download functionality.

Floor drain plan

OK, so here’s the current plan for the basement floor drains.

I haven’t quite finished poking and prodding the drains in the office and the back basement, but assuming the configuration is the same as what I predicted in my previous post, I want to scope them out with a video drain inspection system like the Ridgid SeeSnake. I think it’s the only way I’m going to find anything concrete out about their configuration. SunBelt Rentals, which has a location in Laurel, rents the SeeSnake at a base rate of $126 a day, which seems reasonable.

Assuming I can get my hands on a SeeSnake, I may need to do some surgery on the drain(s) to do my inspection, depending on which SeeSnake model is available. The camera on the base model is 1.75″ in diameter, which is too large to fit through the bell trap opening in the drains. I’ll need to enlarge the opening to about 2″. The drain is cast iron, so I will initally try using a tungsten carbide hole saw. Home Depot has one for around $12-$15 that I hope will do the job; Grainger has some much more expensive models. Drilling the drain(s) out will lose the bell trap functionality, but that’s not a huge loss because I don’t have bell trap covers for most of the drains anyhow.

During the SeeSnake rental, I may want to simultaneously rent a power drain auger with cutter blade. This will allow me to inspect, then clear obstructions, reinspect again, etc.

12/12 – A week or so ago I checked out the carbide hole saw that Home Depot sells. It looks a little too shallow to clear the raised bell trap opening and reach the area where it would need to cut. As a workaround, I might want to try using a sawzall to make shallow radial cuts through the opening, so I can break off the raised area. Home Depot also sells tungsten carbide sawzall blades.

Also, today I was able to confirm that the bar sink drain ties into the floor drain plumbing. With the drain plumbing relatively empty (it’s been several days since it rained) I ran a large volume of water down the bar sink, and I was able to see the water flowing through the drains in the office and the back basement. This also confirms that the drains flow from east to west, and it raises the possibility of using the bar drain as an entry point for the video snake. Access is a little tough under the sink, though.

Basement floor drains again

I’m slowly learning more about our basement floor drains. I bought a small pump (a Little Giant PP-1) that sucks and discharges through a garden hose, and it does a wonderful job of pumping the drains out. A short length of hose easily fits down the drain, and I run the discharge into the office sump pump. The drain system holds quite a bit of water — as a point of reference, if the standing water is about 4″ below the top of the drains (a typical situation a couple days after rainfall) it takes roughly 20-25 minutes for the PP-1 to pump them out. This is slightly longer than the PP-1’s 15-minute duty cycle, so I have to do it in two “shifts”.

With most of the water out of the drains, I’m more able to inspect the drains and see how water flows through them. In the back part of the basement, It appears that the 4″ vertical drain pipe goes directly down to a cast iron “T”. If I run a tape measure down the drain, I’m able to get it to go in either direction a good ways. This seems to indicate that the lateral line is directly underneath the drain, and it’s 4″ cast iron. If that’s indeed the case, then that is good news, because it will be easy to get a sewer auger into the line.

What’s still not clear, is where the drain lets out, and why it collects so much water. The line is a good 7 feet below grade. As to the water, my theory is that the people who did the waterproofing in the well room area tied these drains in with that system, and the water from that drain tile is draining through the floor drain pipes. Since the floor drain pipes are plugged up, the water collects until it overflows into the well room sump pump. It’s really the only theory that would account for the volume of water that collects in the drains (the water problems in the well room area are another, totally separate issue…)

Next steps: I’d like to prove the theory that the lateral line is directly under the drains. I think I can do this by running a snake down one drain and seeing if I can spot it in a different drain. Then, I want to empty the drains and observe what happens during a rain storm. That will (hopefully) confirm that the water is coming from the well room and not the other direction. And then finally, I can look into snaking the line, doing a video inspection, etc.