Sunday, November 16, 2008

Updated 101 things list

I crossed one more item off my 101 things list, and made progress on a number of others. I also added a direct link to my list off to the left, so you can jump straight there. I'll try to post little posts like this when I update the main list, so the hordes of my fans with RSS feeds (1? maybe 2?) can keep up.

Thursday, November 13, 2008

#*@%ing keyboard


Recently, our keyboard had a stroke, as Holly put it. All of a sudden, typing became impossible. Your words would be highlighted, deleted, rearranged, programs would start up and shut down, all while you were trying to type your name.

After some careful experimentation, it appeared that some of the keys had fused with other keys. For example, pressing "a" or "home" meant that both "a" and "home" seemed to be pressed - i.e. the cursor would go to the start of the line, and an "a" would appear there. So "a" and "home" were fused, "d" and "print screen" were fused, and "f" and "caps lock" were fused. I think there were a few more, but I forget what they were.

So as long as we weren't typing anything with "a", "d", or "f", it wasn't too bad, but ... well heck, I have a soft spot for all the letters of the alphabet, and I wasn't willing to continue in this hobbled manner. Leave no alphanumerical behind, and all that. Off I went (in the rain, I might add - stupid keyboard) to Future Shop (stupid keyboard) to buy a brand new unit.

[start rant] Keyboards these days are ridiculous. All curvy and bent and extra-button-laden and rearranged for optimium STUPIDNESS and holy cow, who's designing these? Morons. All I want is my standard 101-key keyboard where the keys line up like they're supposed to, and there aren't any surprise buttons anywhere. I haven't imprinted this design on my brain in permanent marker for nothing, people! It's bad enough I couldn't find the uber-simple keyboard I wanted - it has the Windows keys and whatever the heck that stupid menu key is - but it also has those stupid media and launcher buttons on each side. Stupid. [end rant... for now]

Once we got the new keyboard plugged in, it all worked like a charm again. The only thing left to do was to dismantle the old keyboard, be amazed by all the dust and detritus lodged amongst the keys, and pop the individual keys off for use in crafts or similar. If you want a ring with a "5" on it, let me know. I'll hook you up.

kdesudo vs. gksudo

So I've written a little Python script that deals with downloading pics from our camera - it puts them in a dated directory, auto-rotates them, etc. The usual stuff that a pre-made program does, but makes me feel more important and talented than just downloading a program that'll do it for me. I like to feel special.

Anyway, the point is that to achieve downloading goodness, my script needs root access in order to successfully talk to the camera. But it's a GUI - a visual point and click interface. With buttons! How to run sudo to give my camera-talking commands the power they need?

The answer is that there are a handful of graphical sudo tools out there - commands that will pop up a little window to accept your password and authenticate that way. The first one I tried was kdesudo, which seemed to work great. However, I noticed that when the camera downloaded, it would hack up a hairball on about every 16th image. The output for each image was 64 characters long, which when multiplied by 16 is 1024 - a common limit for some shell-related stuff, although not one I've run into in a while. Dead giveaway that something was hoopy somewhere.

After trying to pin this on Python's commands.getstatusoutput() for a while, I did some simple tests that showed that it was only a problem when run through kdesudo! It seems there's something in there with some kind of limit on output - not exactly sure what, because it would get so far, then choke, then continue with the next image on the next fresh line. Very odd.

Long boring story short, I swapped it out for gksudo, and my problems evaporated. gksudo ftw!