Ecto and WordPress 2.1

WordPress, the software that powers this blog, released a new version recently and I, like many others, upgraded right away. As it turns out, there’s a minor bug in the XMLRPC handling that breaks my favorite blogging client Ecto.

If you’re using Ecto and WordPress, you can apply the patch or you’ll have to wait for the next maintenance release of WordPress.

Lego my iSight

I got an Apple iSight from Jorge last year. I finally got around to hooking it up when I started working from home a few weeks ago. I was a little frustrated with the little connector that comes with it for mounting, so I did what any self-respecting geek would do; I busted out the Legos.

 

I was going to use my Mindstorm set to build something that could rotate the camera, possibly even write up something to be able to control it from the web, but I didn’t have that much time. I’ll save that project for later.

Free iPods

Someone sent me a link to this site offering free ipods. What’s the catch, you ask? Simply complete one of their “offers”, which include things like requesting an AOL CD in the mail or opening a trial membership on some websites (like Ancestry.com). Then send the link to five of your friends. Once your five friends have completed their offers, they will ship you the iPod of your choice. Interesting deal. Sounds like a scam at first, but this same place has been around for a while, giving away various other products to get you to sign up with an advertiser.

With the pay for placement market what it is, it doesn’t surprise me to see an advertiser pay top dollar to this company in order to get a sign-up. Let’s do the math:

If an advertiser pays $50 for a sign-up, and in order to get a free iPod, you and 5 friends must sign-up, that’s $300. What’s a mini-iPod go for these days? About $250. That’s a net profit of $50 per person that they make, and I get a free iPod out of it. Interesting business model. Now let’s see if I can get the last two completions I need to get my silver mini-iPod.

Update:
I’m happy to say that I’ve completed my five offers (but click on the links above to help my wonderful wife Dena get hers. Other people are reporting receiving their iPods and are quite happy with the results.

Update #2:
I found a little package on my front porch after work today.

packing slip
This packing slip sure looks interesting….

Behold!
Behold!

Free iPod

My free iPod has arrived, proof to the naysayers that claimed the FreeIpods.com was a scam.

podlet: iPod detection

I finished writing the iPod auto-detection code tonight, which means i’m almost ready to move on to syncronization.

This was a fun bit of code to work on. It was my first time working with Gnome-VFS. It took a little while to get the perl binding to work. That ended up being an old version of the library in Debian. Once I installed the latest version, it worked like a charm.


stone@moradin:~/src/internal/podlet/tests$ ./ipod_detect.pl
iPod detected at /dev/sda2

Essentially, it gets a list of all mounted volumes and iterates through them, checking for the existance of the iTunesDB on the volume. When it finds the file, we’ve found the iPod. I have to add a couple signals to detect insertion and removable of volumes and I can call this piece done.

podlet

I’ve talked about working on iPod support for Rhythmbox, and iPod support in general under Linux. I did do some work with Rhythmbox, but in the end I faltered and gave up on it. The future of Rhythmbox isn’t clear to me, and from the start I had qualms about writing application-centric support for something like the iPod. After much internal debate, I’ve decided to take a fork in the road.

I’ve been using Perl quite a bit lately. Then I discovered GNUpod. The wheels began to turn. I started to play with gtk2-perl. More cogs began to spin.

Thus was born podlet, a perl application that uses Gtk2::TrayIcon (which follows the freedesktop.org System Tray specification). In essence, it will be a complete syncronization tool, not just for music but also contacts, calendar, and tasks (not limited to, but including this bounty).

podlet
Proposed look of podlet, sitting in the Notification Area. The icon changes based on the current status – idle, syncronizing, or disconnected.

One- and two-way syncronization of music. I use my iPod with my laptop, but I don’t want to keep a full backup of it on there. One-way syncronization would let me syncronize music to the iPod without filling my hard drive. Two-way syncronization, as you would expect, would make sure that your library on your iPod is a mirror of that on your computer.

Calendar, contact, and task syncronization should work with any application you choose to use. There will be a plugin system to support various sources for this PIM data, so you can sync your iPod with Evolution, vcards, Thunderbird, Sunbird, etc.

In the end, I think podlet will make a pretty decent little syncronization tool. I’ve thrown my work into CVS and started to hack out the core of what needs to be done. I’ve also started to play with Glade. There will be a preferences dialog to manage podlet’s settings, and possibly a druid to be run on first run to walk the user through setting up syncronization.

apt-checkpoint (The anti-whiprush)

I finally got tired of OSX so I installed Debian on my iBook. After getting it up and running, I decided to try getting GNOME 2.6 installed from the experimental repository. Boy, was that a big mistake. One of the reasons it is still in experimental is that it’s not being built for all platforms yet. Unfortunately, there seem to be some critical packages still missing for the PowerPC (ppc). After an unfortunate dist-upgrade, I was left with a horribly broken GNOME install and no easy way of getting back. I whiprushed myself.

<StoneTable> `whiprushed
<rewt> To be whiprushed is to bring hell upon yourself by apt-get dist-upgrading without knowing wth you’re doing, and then being pulled over with expired tags and <cut to jail scene> ending up in a jail cell for the night with a heroin addict for a roommate. All because you messed up that Debian system.

The problem:
No way to revert the system back to a point-in-time when the system was working (ala restore points in Windows).

I started thinking about the process I went through to restore my system to the point it had been before I destroyed GNOME. Removing all of the GNOME 2.6 packages I had installed, including their dependancies in experimental. Being left with a broken apt-get and having to remove it, download the .deb from unstable and manually installing it. Becoming intimately familiar with querying out package data with dpkg, and finally reinstalling all of GNOME 2.4 and all of the subsequent packages that got removed in the process.

What a pain in the ass.

The solution:
It hit me as I was driving to work: apt-checkpoint. What we need is a method to create a ‘checkpoint’ that says this is a known good working system at this point in time and records the installed packages, versions, configurations, as well as the original packages (optionally, if available). Then an apt-diff tool could be used to compare the current system with this checkpoint of the working system to pin-point differences, and an apt-rollback tool that could actually restore the known good system configuration to an otherwise whiprushed system.

Maybe it’s just me, but I like to live bleeding edge. I run Debian unstable on all of my desktops and occasionally something gets screwed up, either by my own ineptitude or that of a package maintainer. Shit happens. If I had these tools, though, reversing the change that broke my system would be a relatively simple task (or at least the identification of the broken package/dependancy would be easier to find).

With the solution in hand, I’ve started work on apt-checkpoint, apt-diff, and apt-rollback, an anti-whiprush toolkit to save me (and you) from destroying your system by an ill-advised dist-upgrade. Hopefully I can get a simple, working solution in relatively short order. After all, simple solutions are often the best kind.

Converting OSX Icons to png

I found some Matrix icons that I wanted to use on my Linux desktop. Unfortunately, the only available formats are for OSX or Windows (.ico). I prefer to use png, so I set out to convert the OSX-flavored icons to png.

You will need to download and install a few programs in order for this to work.

First, you need to get a copy of StuffIt for Linux. For those of you morally opposed to using close-source software, shame on you for even considering using Macintosh icons on your Linux desktop. Begone, you.

Next, download yourself a copy of icns2png [Local mirror].

Finally, grab these two scripts: clean and convert. Don’t forget to mark them executable.

Extracting the .bin/.hqx
I downloaded mtrx_icn.bin and saved it to ~/icons. Unstuff this .bin file to seperate the data in to two files.

stone@durin:~/icons$ unstuff mtxr_icn.bin
The Matrix Rebooted Icons.sit.info
The Matrix Rebooted Icons.sit.data
/home/stone/icons/The Matrix Rebooted Icons.sit.info ..
/home/stone/icons/The Matrix Rebooted Icons.sit.data ...........................................................................................................
stone@durin:~/icons$

Next, we need to extract the actual icons themselves. Without setting the parameters to tell unstuff how to treat the file, it will extract 0-byte Icons.

stone@durin:~/icons$ unstuff -e=unix -m=auto -t=on The\ Matrix\ Rebooted\ Icons.sit.data
...
(lots of files being extracted)
...
stone@durin:~/icons$

Fixing the filename
When unstuff extracts the Icon files, it leaves behind a carriage return (\r) embedded within the filename. Whoops.


stone@durin:~/icons$ ls -b The\ Matrix\ Rebooted\ Icons
Icon\r Read\ Me\ Please The\ Icons

I tried various ways of using find, xargs, and perl to do this but failed. So what we have here is clean. Simply, it will remove any control codes, including carriage returns and line feeds, from a filename. I spent way too much time trying to find a solution to this, so I hope it comes in handy for someone else.


#!/bin/sh

if [ ! -n "$1" ]; then
echo "Usage: clean.sh "
exit 0
fi

set -o noglob
find "$1" -name 'Icon*' -print | while read name ; do
newname="`echo $name | tr -d [:cntrl:]`"
mv "$name" "$newname" # do the move
done

~/icons$ ./clean The\ Matrix\ Rebooted\ Icons
stone@durin:~/icons$

Converting to png

Now that the filenames are fixed, we can get to our ultimate goal, converting the icons to png. For this, I hacked up another script, similar to clean.sh, and called it convert.


if [ ! -n "$1" ]; then
echo "Usage: convert.sh "
exit 0
fi

set -o noglob
find "$1" -type f -name 'Icon' -print | while read name ; do
icns2png "$name" # Convert to png
rm "$name" # remove old Icon
done

This one is simple enough that you can probably accomplish the same thing with find, -exec and xargs.

Matrix\ Rebooted\ Icons
Icon2PNG Linux Edition - (C) 2002 Mathew Eis
Converting The Matrix Rebooted Icons/Icon to The Matrix Rebooted Icons/Icon.png...
(repeat the above two lines for each Icon)
stone@durin:~/icons$

And you’re done. All of the OSX Icons have now been converted to png. Happy theming!

Making screen captures of a DVD

Apparently Apple doesn’t want you to take a screen capture of your DVD movies. When the DVD Player is running, the standard keyboard shortcut Command-Shift-3 is disabled. I did some googling and eventually found a nice work-around.

Underworld

Run the terminal, run ‘screencapture -c’ to copy the entire screen to the clipboard. You can even tell screencapture to write directly to a file. The only difficulty I have right now is that I can’t run a movie full-screen and still make the capture. There might be a way to tie it to a shortcut key, but my Apple skills are weak.

iPhotoToGallery

I finally decided to install Gallery and upload the pictures from our vacation to New Zealand. While looking for an easier way to upload the photos I stumbled across this. iPhotoToGallery is a plugin for iPhoto that makes it easy to upload your iPhoto albums into Gallery.

I’m a happy camper now. Uploading each photo individually is a daunting task and the discovery of this is very pleasing. Good job, Zachary Wily.

Thinking different

After a long day of writing image filters (detecting diagonal lines embedded in an image is more complex than it seems), I finally decided to take a break and install the newest OS release from Apple, Panther.
My 12″ iBook, an 800Mhz G3, is a nice little machine, a bit slow but reliable and great for writing. It’s easy to throw it in my bag and sling it around my shoulder and the battery life is great. Still, the minor but noticable sluggishness always bothered me a bit. I listened carefully to reviews by the early adopters when Panther was first released a few weeks ago. The reports of increased performance filled me with anticipation.
The installation process went as smooth as could be expected, which is always a good thing. Copy new files, optimize, reboot and it was done. Perfectly.
I ran the upgraded system through my normal pattern of usage: listen to music with iTunes, chat via iChat and XChat and write via Word. Those early reports I had read were more accurate than I expected. Everything seemed to run smoother. Even iTunes, which is arguably the most intensive application I run on OS X, ran smooth. All in all, a very pleasant upgrade experience. With previous complaints about sluggish behavior gone and the extended battery life of the iBook (around 5 hours per charge), I expect to enjoy my mobile computing experience while abroad in New Zealand. I plan on keeping a daily journal of our travels and experiences while overseas and I can’t bring myself to bust out the pen and paper again.