All posts by John Goerzen

Some nice code: libarchive

Yesterday, while looking for information on the format of tar files, I discovered libarchive, which is part of FreeBSD. libarchive and read about 5 different tar formats, 4 different cpio formats, zip, and ISO images, and supports gzip and bzip2. It can also write 2 different tar formats plus cpio and shar. Very nice.

Oh, and its tar.5 is the best reference on the tar format I’ve seen.

I’ve packaged up libarchive and bsdtar (the default tar on FreeBSD, which is built using libarchive) for Debian.

Grandpa’s Creek

“Dad would have really enjoyed this.”

My uncle Ron said those words last Sunday, referring to my grandfather, who passed away earlier this year.

We were having a little family gathering, the first since the events surrounding Grandpa’s death.

We met as his old farmhouse, and then headed out to his creek. My dad already had a fire going — ready for the hot dogs and brats.

That creek, though it’s muddy and smelly at times, has a lot of fond memories for lots of my relatives.

For most of my childhood, uncle Ron lived in Indonesia. Every so often, his family would come back to the US for a few weeks. And just about every time he was in Kansas, he wanted to go camping by Grandpa’s creek.

He’d usually manage to gather a few people to go with him. Just who went would vary depending on schedules, but usually included my cousins (his children), my brothers, my dad, and Grandpa. We’d often go fishing in the creek as well.

At this point, I need to explain a small detail about that creek. It runs through the middle of a pasture. The kind that cattle live in. So, you have to be careful where you step. Also, you have to remember that you might be visited in the middle of the night.

My cousins, brothers, and I set up our sleeping bags on the bed of Grandpa’s pickup. I don’t remember where my uncle and my dad slept. Grandpa was the smartest one, though. He’d drive his car out to the creek, through the pasture, and spend the evening with us. Once it got dark and people were turning in, he’d drive back home for the night. And he’d be right back out there in the morning.

There was also an incident one time where I was fishing with my dad and my brothers, and I fell into the creek. But that’s a story for another day.

This week, my uncle was visiting, and the family got together out by the creek. Most of us hadn’t been there in a few years. It was a great time. We were probably there for four hours, despite the wind.

During a lull in the conversation, towards the end of the evening, my uncle remarked:

“Dad would have really enjoyed this.

But then, he probably is.”

All I Really Need To Know I Learned From 360K Floppies

Today I got inspired: to do something about these boxes of 360K and 1.44MB floppies scattered about the house. There are boxes dedicated to floppies, and floppies in boxes for other things, and floppies stacked on shelves. Some of them have moved with me through three states and thousands of miles without ever being read. Some are nearly 20 years old.

There’s a lot of stuff on those disks. Memories of grandparents, elementary and high school projects, and some code I wrote years ago in Pascal or C.

I decided to read in as many as I can and burn them all out to a CD-R or DVD-R.

Easy enough, right?

Well, not so much.

First, there’s the problem of reading the data itself. Some of the floppies have developed bad sectors in the years since they were last used. Most were formatted under DOS or Windows, and Linux has plenty of tools for reading FAT filesystems. But a few used OS/2’s HPFS. Not so easy to read these days.

1.44MB drives are still not too hard to find, but when’s the last time you saw a new PC sporting a 5.25″ drive? Bet it’s been a long time.

Then, there’s the problem of proprietary data formats. Back in the days of DOS, WordPerfect ruled the day for word processors. WordPerfect had pretty much the sort of stranglehold on the market then that Microsoft Word has today. I wrote lots of material in WordPerfect.

It’s all pretty difficult to get at these days. The very best thing I can do is install WordPerfect 6.0 for DOS and a PostScript printer driver. That will get *close* to the original document formatting, though not exact. (WordPerfect documents were tied to the fonts available in a particular printer, and an Apple Laserwriter doesn’t have much in common with a Panasonic KX-P1180 dot-matrix.) Once I have a PostScript file, I can pull it onto a Linux box and convert it to PDF. Lots of hassle.

Massachusetts made a wise move recently. If you really care about being able to read your documents decades down the road, you can’t be using a proprietary file format. Nobody would have expected WordPerfect’s spectacular fall (primarily due to being late to market with a Windows port). Nobody today expects a Word fall (perhaps due to being late to market with a Linux port?). But it probably will happen.

Then there’s the problem of proprietary software. WordPerfect is proprietary, and so is DOS. Neither are really prepared to run from a hard disk measuring in the hundreds of gigabytes on a modern PC sporting USB and other technologies never heard of in the 80s. But these are some of the easier apps. (Yes, I know there’s a Linux version of WordPerfect, but again, it’s proprietary, and can be difficult to make run on modern systems.)

Try an app like Lotus 1-2-3 that had copy protection. Or one that assumed that it can do whatever it wants with hardware. Not quite so easy now. VMWare can help sometimes, but sometimes it hinders. I had a lot of data backed up with Central Point Backup, part of the PC Tools suite. It formatted floppy disks in a special way (if I remember correctly, somehow getting one extra sector in each track.) Can’t even read them in Linux, and VMWare is clueless about what to do with them.

So I am converting everything I can to a standard, open format. Documents go to text and PDF. The CD/DVD is burned with RockRidge and Joliet, so just about any OS can access it. Documents I write now are mostly done in just ASCII or in LyX, both of which are readable as plain text. Linux can read many open formats that existed in the Unix world before Linux even did. I feel much better about things now.

But then there’s this blog. It’s stored in a MySQL database.

Sigh.

At least I have the source.

ESR’s Bad Ideas

So I’ve been listening to some back episodes of The Linux Link Tech Show lately, and they’ve had a lot of insightful guests (the interview with Aaron Seigo of KDE was particularly excellent.)

They also talked to Eric S. Raymond in episode 95.

So here are some ESR quotes:

“A program that requires documentation is a design failure. . . If you need documentation, you have failed.” He said that in some cases, it may not be possible, but people should never give up on that goal.

I’d like to see him write something as easy and powerful as grep without documentation. How about a non-linear video editor, where there are some complex concepts at work?

He went on to describe how one might write a spreadsheet app without documentation. “The way to design a documentation-free spreadsheet is: the initial state of the spreadsheet is that every gesture that the user might make pops up a balloon prompt saying ‘This is what will happen if you confirm this.’ As they demonstrate knowledge of the interface, the balloons stop popping up, and are replaced by other baloons that say what they can do with other gestures.”

I have one word for that: AIEEEEEEEE.

This is worse than Microsoft Word with the paperclip. And ESR wants us to develop it.

Please, give people a simple quick reference card or something instead of annoying popups. Anything but the annoying popups! If I want to learn how to write a letter in word, I can go to the help system and learn how to write a letter there.

Argh.

Multiple Computer Use

I work frequently with four different machines. Two desktops, a laptop, and a tablet PC.

I want to be able to use programs in the same way across multiple machines and have state be preserved across them. For some things, I use unison. It works reasonably well for the KDE PIM apps and my Firefox bookmarks.

It doesn’t work well for things like NNTP readers (where article numbers vary from location to location) and aren’t easily fixed.

But then there are things like ipodder. It’s an otherwise nice program, but there is no good way to sync its ~/.ipodder between machines (especially if the download area is not to be synced.) Urgh. It gets all confused and messed up.

Sigh.

I wish more programs would think about this.

The Linux Link Tech Show

Probably the most unexpected result of purchasing a Motorola v551 phone is finding out about The Linux Link Tech Show. (One of the people involved had e-mailed me asking about bluetooth under Linux on that phone.)

I’ve listened to about 2 hours of back episodes now. It’s great. I can’t believe it’s been 2 years that they’ve been doing this and I just now learn of it.

They’ve invited me to be a guest on the show next Wednesday evening, September 21. I think it’ll be a lot of fun.

Plus, they’ve got an Asterisk setup. Always like the opportunity to do something cool with Asterisk.

Perl, Powered By Haskell

Autrijus Tang is well-known for developing the first working Perl 6 interpreter, Pugs. Pugs is written in Haskell, my new favorite language. Perl.com has an interview with Autrijus, and page 2 of that interview gets particularly interesting. Here are some quotes from Autrijus:

Haskell . . . is faster than C++, more concise than Perl, more regular than Python, more flexible than Ruby, more typeful than C#, more robust than Java, and has absolutely nothing in common with PHP.

(If it has nothing in common with PHP, it must be great, right?)

Haskell is a pure functional language optimised for conciseness and clarity. It handles infinite data structures natively, and offers rich types and function abstractions that give Haskell programs a strong declarative flavor–the entire Pugs compiler and runtime is under 3000 lines of code.

Most languages require you to pay a “language tax”: code that does nothing with the main algorithm, placed there only to make the computer happy. [Java, anyone? — jgoerzen]

On the other end of spectrum, we often shy away from abstracting huge legacy code because we are afraid of breaking the complex interplay of flow control and global and mutable variables. Besides, the paths leading to common targets of refactoring–those Design Patterns–are often non-obvious.

Because Haskell makes all side effects explicit, code can be refactored in a safe and automatic way. Indeed, you can ask a bot on to turn programs to its most abstracted form for you.

Go check out the interview (page 2) for more, including a demo program that Autrijus wrote to show off Haskell.

Thanks to metaperl for the link.

Some Airport Statistics

Airport Number of Gates Annual Passengers (2000) Wireless Internet Options Plainly Visible to Travelers
Charlotte, NC 79 10,377,837 None (checked all of Concourse A plus the atrium)
Atlanta, GA (Hartsfield) 176 38,255,778 None (and I walked almost the entire length of Concourse C to check)
Wichita, KS 12 535,715 Four free work centers throughout the airport, clearly marked, each offering four work areas complete with desk, chair, AC power, Ethernet connection, and wireless Internet access. Wireless connectivity extends into most gate areas as well. ESSID: “FREE”.