apt-checkpoint 0.1 released

I’m happy to announce that apt-checkpoint 0.1 has been released..

I’m excited about this, partially because this is the first “open source” project that I’ve gotten to a releasable state but also because it’s just a damn handy utility. I pimped the project in #debian-devel (on irc.freenode.net) today. A few people said things like “that’d be useful for me” and “this is a good idea, i’ll try it out in a chroot later. actually it will be really useful for chroots when you want to revert changes.”, while another sputtered “packages are not required to support downgrading at all” and “while [ 1] ; do dpkg –get-selections | awk ‘{print $1}’ | grep -v apt | xargs dpkg –purge; done.” and “Use a file system with snapshots.”

Of course, there are various ways of manually downgrading packages. The problem with his suggestion is that, while technically feasible, is not a clean solution. I shouldn’t have to pipe commands back and forth to accomplish what should be a seamless, automated task. Linux isn’t just the playground the technologically elite. Linux needs to be user-friendly, while still allowing us technophiles to get our hands dirty. apt-checkpoint, while rough and cludgy, is just an example of the kind of usability people need. They should be able to upgrade and, if something breaks, seamlessly rollback, akin to restore points in Windows (which are used for the exact same reason).

A few people have already started to play with apt-checkpoint. Hopefully I’ll get some good feedback from them, and a stable 0.2 release will be ready in the near future.

Making progress feels good

I’ve made some awesome progress on apt-checkpoint lately. There are four primary commands that apt-checkpoint recognizes: create, view, diff, and rollback. Right now, all but rollback are functional. Rollback will probably be the most difficult, which is why I saved it for last.

I’m going to get a project page up in the next few days. I applied for one at SourceForge, but then Jorge pointed me over to Alioth, so I’ve applied there as well. To be honest, SourceForge looks like it has more features, but Alioth is a Debian-run service, which might be better for me in the long-run, considering I want to become a Debian Developer. I guess I’ll wait and see who approves my project first and see how impatient I am.

apt-checkpoint progress

I’ve been making some decent progress on apt-checkpoint over the last few days. I’m using the python module apt_pkg to interface with the packages. I want to keep this package as lightweight as possible, and I think it’s a fair assumption to make that Python will be available “out of the box” on most Debian systems. Plus, Python is a nice language. I still favor C#, but Mono isn’t quite as widely used yet and for a tool like this, I think Python is a better fit.

My first goal was to get apt-checkpoint working, and it is now functional enough for me to do more testing. With the checkpoint generated, I was able to start working on apt-diff. I ran apt-checkpoint, apt-get install apache, and then apt-diff, which I’ve showed below:

stone@durin:~/src/apt-checkpoint$ ./apt-diff.py
Reading Package Lists… Done
Building Dependency Tree… Done
Package not found in checkpoint but installed: apache

So far, so good. I am able to detect a new package has been installed since the last checkpoint. I need to test version checking and work out the logic for apt-diff, but I’m pleased with the progress so far. At this rate, I should be ready to release something in a few weeks.

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!

The evolution of Linux.Ars

Linux.Ars has grown quite a bit since I originally came up with the idea many months ago. At that time, I roped Jorge into helping me with it as we discussed and planned future community involvement. When work got too busy for me to manage the weekly commitment, Jorge stepped up to the plate and knocked that ball out of the park. (No Proto, you are wrong. It was my baby. Jorge was just the nanny.

Since then, the community involvement has grown tremendously, even though Jorge has backed away from it recently. Hopefully we’ll both manage to contribute some content to it periodically. I’ve been working behind the scenes to establish a more permanent presence of Linux-related content on Ars Technica, which I hope will be hammered out during our next business meeting next weekend.

Posted in Uncategorized | 1 Reply

(Almost) A week with Fedora

So, last week I decided that it was time to reinstall Linux on my laptop. Being the glutton for punishment that I am, I followed the advice of #linux and installed Fedora instead of Debian.

I have to say that, despite my misgiving, I was impressed with Fedora. Right out of the box, everything worked. Wireless, XFree86, cups, you name it. And it looked damn good. Nice, crisp anti-aliased fonts.

I played with it for several days, I was able to use Red-Carpet to install Mono and all the dependancies in order to get MonoDevelop to run. Heck, I even had Mono CVS building smoothly.

Despite some frustrations with yum/red-carpet/up2date not being what I’m used to with apt-get, I was content.

And then my hard drive died.

Do you realize how hard it is to find a decent replacement laptop hard drive on a Sunday? It’s bloody difficult, I’ll tell you right now. You would think that, living as close to Chicago as I do, that there would be one store selling higher-end hardware. I had my eye on a top-of-the-line 7200rpm hitachi drive, but the only regional store that I could find that sold it, CDW, is closed on sundays.

Instead, I opted for a 5400rpm Hitachi drive with an 8Mb cache. So far, it feels considerably faster than the standard 4200rpm drive that came with the laptop.

Facing a complete reinstall, I decided that, although Fedora is nice as an easy-to-get-running desktop, it isn’t right for me. I like the power that I feel when I run `apt-get -t experimental upgrade`.

Now I’m back to Debian, running Kernel 2.6.4 and GNOME 2.6 and quite happy. Long live Debian.

Where in the world is…

I’ve been rather lax in posting lately. Work has been busy lately. It seems like we’ve been signing up new clients left and right which may potentially double our current traffic. Add that to an active development cycle and my days are pretty full. My side business has been brisk as well. I’ve got two different web services that I’m in the middle of building and a client with challenging needs using both. I’m practically writing code from the time I wake up til the time I go to bed.

Next month I’ll be at Penguicon where I’ll be running a panel on Mono, the open-source runtime that supports C# and the .NET framework. I’m also trying to finish my Mono article for Ars Technica. I’m trying to get it finished in time to be published before Penguincon, but there is a lot of material to cover and little time to do it in.

Spring is finally here and that means it’s time to get off my ass and get some work done around the house. Cleaning the garage, fertilizing the lawn, and tilling the garden are all on my immediate TODO list. It’s starting to warm up but it’s rainy and gray. There are still puddles of standing water in the field behind the house. I probably shouldn’t complain, though. It could be snowing.

Posted in Uncategorized | 1 Reply

Weekend Bliss and Sleepnessless

I had a business meeting with a client up in Milwaukee on Saturday, so Dena and I jumped in the jeep and headed up north. We headed over to my friend Nate’s penthouse overlooking downtown Milwaukee. We hung out for a bit while we waited for the meeting (which ended up being delayed a few hours). Eventually we left to meet up at the office for our meeting, which was short but productive. My favorite kind of meeting. While we were there I was given a gift* of a Treo 600 smartphone. The only catch is that, after I learn how to use it, I have to teach my client, Rick, how to use it. No big deal and I get to dump my crappy phone in the process.

Afterwards, Nate, Rick, and I met up for drinks with our significant others at Aqua. After a couple rounds, Rick and his lady left for a previously scheduled dinner, but not before arranging for reservations for dinner for us, Nate, and his wife. We sat down and enjoyed a very nice dinner. I tried a Kobe steak for the first time, which was pretty good. We were just finishing our meal and preparing to say no to dessert when the manager came over to our table, set down a plate containing a flourless chocolate cake and homemade cheesecake and told us that Rick had taken care of the bill for us, and the dessert was on the house. We were all a bit taken back at Rick’s generosity. It’s one thing to find a client that’s not afraid to spend money to get results; it’s another thing entirely to find one that’s also this thoughtful.

We got home around midnight and played with the dog for a bit. I was hoping to sleep in, but the dog had to go out around 5am, and Dena woke up shortly after. We managed to take a few hour nap later in the morning, but we probably feel worse now than if we’d just stayed awake. We’re taking it easy the rest of the day, watching movies and playing with the Treo.


* bribe

Nifty CSS trick

I was doing some design work on a new business web site and fighting some alignment issues with Mozilla and Internet Explorer. After a bit of digging I discovered this conditional comment feature of IE 5 and 6.


<!--[if IE 5]>
<link rel="stylesheet" type="text/css" href="/css/ie5-fejl.css"></link>
<![endif]-->

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="/css/ie6-fejl.css"></link>
<![endif]-->

This doesn’t solve the problem I’m working on, but I thought this was a neat enough trick. I’m glad I don’t have to deal with design issues like this on a daily basis. It’s frustrating enough to debug simple alignment issues.