Monthly Archives: May 2008

General

Hang on/off

I just noticed that in a certain usage, the phrase-forms ‘hang … off …’ and ‘hang … on …’ mean the same thing. (Of course, you could find a lot of examples of such phenomena in English, but hey, this is my blog and I reserve the right to post about things that are not very new or original.)

‘Course, you wouldn’t say ‘hang the shirt off the hanger’ or ‘hang the keys off the hook’, but you would say ‘hang the Payment object off the Speaker object’ or ‘hang the new tree off the first leaf’ when talking about data structures in software. Or at least, I and my peer group would say these. But they mean the same as if you replace ‘off’ with ‘on’. I guess the preposition there is more for looks than function, since ‘hang’ itself is fairly unambiguous.

So I guess the only thing that’s actually interesting about this is that the phrase was appropriated into programming terminology, then slightly morphed from its origin, and probably for no good reason.

General

Unexpected classloader weirdness

Did you know that in Tomcat 6, you apparently… well, I can’t quite say what the cause is, but here’s what happened:

  • I have a webapp that’s using a library that might be doing some slightly tricky classloader things
  • If I access that app through the AJP connector, it fails to find a class that’s definitely there in my WEB-INF/classes and world-readable
  • If I access that app (from the same URL and in the same state) through the HTTP connector, it finds the class

It must be something to do with classloaders, but I can’t say that I understand any reason why that would happen. Of course, I haven’t investigated it, either, because I’m more interested in getting the thing to work right now than in figuring out what this weirdness is about.

Instead of using mod_jk and JkMount, I’m using mod_proxy_http and ProxyPass. Works well enough for my purposes and avoids whatever this problem is. Maybe sometime I’ll be inspired to dig deeper, because ya know this would turn out to be one of those “wow, I can’t believe these things would all interact in such an unexpected way” things.

General

nowin

Oh, forgot to mention in my “TV all over again” post that that was the last app I had to run in Windows. So now, in the normal state, there isn’t a lick of Windows running in my house. I run it in a VM when I need it, and on very rare occasions I might boot to it, but for the most part, don’t need it no mo.

General

TV all over again

So this morning I learned that one of my hard drives had died during the night. Luckily it was just holding backup data that was waiting to be burned to DVD-RW, so it was not a huge loss. But annoying nonetheless.

While I was in there replacing that, I figured I’d swap my TV card into that machine too, since the one that it was running in is failing to boot for reasons I don’t quite understand (it’s a combination of my fault and hardware bugs, I think). That required getting the card running under Linux.

It was only recently that my card (Hauppauge HVR-1600) got a Linux driver, so I was waiting for a while before I jumped over. But, given the confluence of annoying computer failures, I took the dive today.

It took several hours to hunt up code, compile kernel modules, install TV software, configure stuff, etc. Not really any longer than under Windows, so that’s good.

But now that I have it running, oh, man, am I glad I made the switch. MythTV is pretty awesome. The coolest thing for me is MythWeb, the web-based management plugin. Since I don’t do the using-the-remote watching-from-across-the-room thing, I really (really!) don’t like UIs designed for that mode. MythWeb instead gives a nice, compact, fast, easy to use way to browse listings, set up recordings, and get on with my life. Later I’ll just play my MPEGs out of a Samba share with VLC, totally avoiding the wacky UI stuff.

General

Mixing metaphors

Mixing metaphors can be a great source of humor, intentionally or not so. I don’t know which category this one fits in, but it’s great. (I haven’t actually read the article, I just happened to stumble upon this little quote and hadda point out how much I love it.)

There are few bold “aha” ideas, lot’s of social “-this or -that”, and mostly a bunch of companies hoping to draft on the perceived success of a few gorillas.

(from Incrementalism and “The New New Thing”)

General

Suspend, first experiences

Maybe I’ll make a thrilling serial out of my suspend experiences. “S3: Miami: Drivers and BIOS Division: Data Loss Prevention Unit”, maybe.

The first episode would be where I used suspend and had a mixed bag of results. Things seem to stop and start alright, but I have this fan problem… In Windows, the fan would often come on full blast and stay on after resuming, and I had a little workaround ritual where I’d select a different “power profile” from this applet that Toshiba pre-installed, then switch back, and it would go back to normal. I have similar symptoms under Ubuntu, but no workaround ritual developed yet. In the process of looking at that, I see that the fan doesn’t always kick in when the machine is running hard, which worries me a little that the thermal management is out of whack.

I’m also getting this notification when I resume that my machine could not suspend. Which is surprising, when coming out of resume, because I was under the impression that ‘to resume’ is something an entity can do only when it had, indeed, suspended. Hopefully that’s just spurious, rather than indicating some hidden problem.

So, yeah, I’m gonna need a scriptwriter to punch this up a little. Car wrecks, babies giggling, lottery winners who lose their husbands to their step-daughters, that kind of thing.

General

Ubuntu suspend

Speaking of suspend, it’s cool that it looks like Ubuntu supports it well in Hardy Heron (8.04). I’m not giving the credit all to Ubuntu; I’m sure lots of people contributed to that, since it’s certainly a huge endeavor to get the whole chain, from the kernel-BIOS interface up through the kernel and drivers up through the desktop environment up through applications, to live in a suspendable world.

I haven’t actually used it beyond a couple tests so far, because my lid latch problem happened before my switch away from Windows, but those tests went well. I’ll report on my further experiences later.

General

My suspend back

The summary: after breaking a lid latch on my Toshiba Satellite A105-S4134 laptop, I was unable to reliably use the ‘suspend’ function. I repaired this with a fairly simple procedure. I took the long way around to get to that procedure; you don’t have to.

The whole back story: I had a quick and unexpected contact with Earth while exiting a car on an icy day, and while carrying my precious baby Toshiba in my backpack. She lost a right lid latch that day…

I can live with the fact that the lid is not quite as secure as before (there’s still the left lid latch), but I find it harder to live with the fact that now, when she’s in my backpack in suspend mode, she’ll spontaneously power on, in the hot and suffocating confines (when one is powered on) of the backpack laptop pocket. That could lead to at least battery drainage and at most CPU meltdown, neither of which I want.

There’s no option in the BIOS to turn off the switch action (and OS settings didn’t help either, which didn’t surprise me). Toshiba/Intel, please put this option in your BIOS settings in future models.

So, I had to say goodbye to suspend, which is paaainful to me, because I hate waiting for bootups and app startups and all that garbage several times a day. I wanted my suspend back.

The daring resolution: I decided today to go ahead and disassemble the machine and see if I could somehow disable the switch. I used the handy little Toshiba disassembly guide (and made a donation). Note: DO NOT DISASSEMBLE YOUR MACHINE LIKE THIS. It was somewhat risky and quite unnecessary for me to do this, so I don’t recommend making that mistake if all you want to do is disable your lid switch.

However, in the process of doing this, I did discover the fix to the problem. I noticed at one point that a couple of screws were sticking to the upper-right corner of the screen bezel. Odd. They were stuck there magnetically. I checked whether they’d stick to the other side; they wouldn’t. Hmmm, I thought, this is interesting, because my earlier tests had indicated that the right side of the lid was the important side in triggering the lid switch. Is it magnetic? I put things back together enough to be able to boot and test the theory, and used a magnetic toy to reveal that yes, the lid switch is magnetic.

So that means all I have to do is find and remove the magnet, eh? Wish I hadn’t disassembled the whole machine… I reassembled everything and switched to this guide. I went as far as Step 4ish. I opened the screen mask far enough to get to the top-right corner, and found a magnet with some tape over it, which was a good sign. I removed the tape and pried out the magnet (which was also glued from the underside) easily. Put everything back together and tested, and…

Woohoo, I can suspend my laptop again.

General

Cygwin-Wine

I bet you could run Cygwin under Wine to get a Linux-like environment in Linux.

General

A use for network boot

Have you ever had to try to replace a hard drive in a machine with a dead built-in DVD drive and an old BIOS (i.e. one that doesn’t really boot off USB devices)? It can be a frustrating endeavor.

My favored way to replace a hard drive (and yeah, I know there are other ways, but this is really the best one) is to boot the machine off a Linux LiveCD and use some sort of cloning program to clone the drive to the new one in a USB enclosure, then swap ’em. Clonezilla served me well when I replaced the hard drive in my laptop recently, so I wanted to do that with my girlfriend’s, too. But the internal DVD drive is dead, it wouldn’t boot off the external one, it wouldn’t boot off a USB Flash drive with the Clonezilla USB option, and any hope that a BIOS upgrade would fix the problem was dashed by the fact that the BIOS update program had to be run off a floppy (which the machine never had) or a CD, which clearly leaves me with the same problem again.

But, the BIOS does have a network boot option, which only became relevant to me when I felt I was running out of options. Setting up a server for network boot from scratch sounded kinda painful, but I remembered that Knoppix has this fairly cool feature they call ‘terminal server’ that might do the trick. Sure enough, I booted Knoppix on my laptop, ran their terminal server, connected it to this laptop with an Ethernet cable (luckily, though the Ethernet port is a little out of wack on this laptop, it’s still functional), selected network boot, and rather quickly, I was in a full-featured Linux environment without touching the to-be-cloned hard drive.

I used ntfsclone, which I knew to be the core of what Clonezilla uses when moving an NTFS partition, to move the single XP partition to the new drive, then ntfsresize to fill the drive (the new drive is twice the size of the old). The only snag I ran into with that was that Windows had previously diagnosed the drive to have bad sectors (the primary reason for replacing the drive in the first place), and ntfsclone doesn’t want to proceed with more than 5 bad sectors. But luckily that’s just a matter of adding a ‘–rescue’ commandline option. ‘course, it clones the bad sector map, which then causes ntfsresize to barf, but it has a ‘-b’ option. I see now that there’s some verbiage on the ntfsclone page that talks about bad sectors… whatever, it’s fine now, so I don’t feel the need to understand now NTFS deals with BS.

It’s cool that the Linux-NTFS tools have gotten to maturity these days; a few years ago when I was replacing drives, I had to do much more annoying things to clone NTFS. (I’m not sure if the software I mentioned in a previous post was based on Linux-NTFS or if they had some proprietary system (Apricorn’s software _was_ Linux-based, though.)).