A useful Linux app for your CD-R

Quit wasting space on your CD rack with CDs that are only 3/4 full!
C’mon. You know you’ve done it. You’ve got 1.9 gigs worth of stuff to burn to CD. You know it should fit on three CDs. Half an hour later, you’re tired of trying to figure out how to make it fit and you just burn 500 megs’ worth on four CDs.
Read more

Wiping a disk securely

Sometimes in the course of work, it’s necessary to securely wipe a disk. A drive containing confidential information may require replacement. Assuming you caught the problem before the drive died for good, you can wipe it before sending it back to the manufacturer.
Programs to securely wipe a drive cost money. Sometimes big money. Fortunately, it’s easy to do it with Linux.
Read more

I shoulda stayed home and read a book!

The last few days have been nuts. I’ve been wrestling with tape drives, trying to get them to work on a brain-dead operating system from a company in Redmond whose project is headed up by a potty-mouthed ex-DEC employee. Its initials are N and T.
And, riddle me this, someone, please. On Unix, I just hook up the tape drive, then I type this:


tar -cf /dev/tape /home

Badda bing, badda boom, I got me a backup of all my user data, assuming the drive is good. One command, keyed in. One command that’s no harder to remember than the phone number of that pretty girl you met last week. (Or wish you met last week, whatever the case may be.) What’s hard about that?

In NT, you plug in the drive, you load device drivers, you load your backup software, it doesn’t recognize it, so you stop and start 47 services, then it finally recognizes the drive, and then you stumble around the backup software trying to figure out just how you tell it to make you a tape. By the time you figure all this out, in Unix, you’d have finished the backup.

Ugh. So, when I get home, I don’t want to have much of anything to do with these brain-dead machines infected with a virus written in Redmond. And the virus from Cupertino isn’t any better. I don’t have much appetite for my computers that run Linux either, because, well, it reminds me of the crap spewing out of Redmond and Cupertino. It’s kind of like a messy breakup, you know? You meet a girl who’s nothing like the last girl, but you don’t want to have anything to do with her because she’s female, breathes oxygen, and she’s carbon-based, so there’s the off chance she might remind you of that last disaster.

Hence the mail piling up in my inbox and the lack of updates for a couple of days.

So what have I been doing?

I’ve been reading books. I finished Dave Barry Turns 40 a couple of nights ago. It wasn’t as good as his later books, but it had a few howlers and part of a chapter that was actually sincere and serious and really made me think. It was about his mother after his dad died. They lived their lives together in this brick house he built himself, and after he died in 1984, she would write on her calendar, on April 24, “Dave died today, 1984. Come back Dave.” And on the day of their anniversary, she would write, “Married Dave, 1942. Best thing that ever happened to me.”

Finally, the house turned out to be too much for her to handle on her own, so she sold it and moved away.

And he went on for another page or two, talking about the last years of her life, trying to relate to her and failing miserably, as she wandered from place to place, living with relatives, never finding a place to call home, because what she really wanted was that brick house back with Dave Sr. in it.

As she died, she had that smile that all mothers have, that smile that tries to reassure her boy that everything’s going to be OK.

The story had a flashbulb effect on me. Partly because it came from Dave Barry, the guy who went on and on about cell phones, and how people who get cell phones have no escape at all, and sometimes they’re trapped in their cars for months, stuck on the phone, surviving on drive-thru food and peeing in the ashtray.

I can’t say I read very many things that jar me, but that short essay definitely did, especially the insight it gave on his parents’ relationship. How many people feel that way about the person they married 42 years ago? All too few, in this day and age. And since it came from the person I expected it from the least, it made it all the more jarring.

Since then, I’ve been reading White Palace. I understand it was made into a movie in the early 90s. It takes place in St. Louis. It’s a book about a relationship, and the relationship has absolutely zero substance. Sex sex sex sex sex sex sex. And more sex. (I wonder what that’s going to do to my Google rankings…) I really don’t want to like the book, especially after having my world rocked by a short essay that Dave Barry snuck into a comedy book and apologized about.

But I learned something.

The book has no plot. Guy meets girl in a bar. Guy and girl begin torrid affair. It’s a cheesy romance-novel plot. You find better plots laying outside on the sidewalk or in the parking lot.

The book does have compelling characters. The main character is 27 and his beloved wife died tragically when they were both 25. I’m 27 so I can relate to the guy on that level. And all of us have lost someone that we miss. And there’s a lot more about the guy too. I won’t give it all away. His (ahem) girlfriend has more substance than a plastic blow-up doll, although it would have been very easy not to give the character any substance. She’s in her early 40s, she drinks a lot, and she forgets to pay her bills. (At least she has priorities.) She works in a fast-food joint, and at at least one point in the book, she stops dead in her tracks, looks the character in the eye, and asks, “Why are you so good to me?”

Heart-wrenching line, that.

OK, so the book’s got good, well-developed characters. It also has a good setting. It takes place in St. Louis, and you can tell from the way he describes it all that he’s actually lived here. The main character lives in Kirkwood, and any St. Louisan instantly draws a mental picture. She lives in Dogtown, and any St. Louisan instantly draws a mental picture. He draws in places that St. Louisans are familiar with. He talks about Tony’s restaurant, and the book’s name comes from a fast-food joint that litters the St. Louis landscape (without infringing on a trademark). He even works in Concordia Seminary, and Cindy’s Motel. Any St. Louisan will instantly love the book because it describes home. I wonder how many St. Louisans utter aloud the words, “Where’d you go to high school?” while reading it.

He made St. Louis real, and he made it compelling.

Great characters, great setting… He didn’t need a plot.

And now I find myself itching to write fiction. I get that bug every couple of years. I wrote 100 pages’ worth of novel while I was in college. It was the opposite of White Palace. It had a good plot. Maybe even better than good, but I can’t be objective about my own work. But to the very few people I’ve described it to, it’s been riveting. But the characters were awful and so was the setting.

That manuscript is lost, as far as I know. Some version of it might be on my Amiga’s hard drive, but I wouldn’t hold my breath. No great loss. I intend some day to revisit that plot, plop it down in a compelling setting, and drop some compelling characters into it. There’s really only one question.

Have I lived enough yet to pull it off?

Who knows. Right now, who cares? I’m gonna go read some more. I think the UV from this monitor is getting to my head.

Another ordinary Monday…

Seen on a sign. God calls us to play the game, not to keep the score.
I like that.

Seen at a book sale. The Coming War with Japan. The book was written in 1992 and asserted that the conditions that pre-dated World War II exist today and that war is inevitable. Then I spotted another book: The Japanese Conspiracy. I didn’t bother picking that one up. I could have bought them for entertainment value, but I picked up a couple of books by Dave Barry and P.J. O’Rourke for that.

The idea seems ridiculous to me.

I was glad I went over to the section on war though. In addition to those, I also found A Practical Guide to the Unix System, Third Edition, by Mark G. Sobell. Had it been in the computer section where it belonged, it would have been snapped up long before I got there. It comes from a BSD perspective, but I have to work with a BSD derivative at work sometimes, so it’s good to have. At the very least, it can serve as a status book (books you keep on your shelf in your office to make it look like you know something, even if you never read them).

Speaking of humor value… I picked up a book on typography, written in 1980. Some of my classmates had a knack for making type look really good–they could literally turn a headline into art. I never got that knack. This book tries to teach it. It also talks about computerized typography. Needless to say, the couple of pages that illustrate that are just a wee bit out of date.

But I’m not worried about the key points of the book being out of date. The basic elements of good design were old news when Gutenberg built his first printing press.

Retro computing. I was inventorying my old stuff and I ended up building a computer. I have an original IBM PC/AT case, but the last of the AT motherboards don’t fit in it well. The screws line up, I’m in trouble if I need any memory, because the drive cage blocks the memory slots on a lot of boards, including my supercheap closeout Soyo Socket 370 boards I picked up a year or so ago. I used the motherboard that had been in that case for something else long ago, and it’s been sitting ever since.

In my stash, I found a Socket 7 board that fits and lets me put the memory in it. It even has 2 DIMM and 4 SIMM sockets in it. Unfortunately it has the Intel 430VX chipset in it, which didn’t cache any memory above 64 MB, limited the density of SDRAM it would recognize, and its SDRAM performance was so lousy you didn’t really see much difference between SDRAM and EDO. But if I run across a 32-meg DIMM or two it’ll fit, and a relatively slow CPU with adequate memory still makes a good Linux server, especially if you give it a decent SCSI card.

I did some investigation using the tools at www.motherboards.org, and found out the board was a Spacewalker Shuttle. So I went to www.spacewalker.com, where I found out there were only three Shuttle boards ever made with the 430VX chipset. There were pictures of each board, so I quickly figured out which one I had–a HOT-557/2 v1.32. It tops out at a Pentium 200 or a Pentium MMX 166, so I’ve got some options if I decide the AMD K5-100 in there isn’t enough horsepower. And, most importantly to me at least, it looks like a computer. A machine from a time when computers were computers, not boomboxes and fax machines and toaster ovens and television sets. A machine that looks rugged enough to survive a tumble down a flight of stairs. A hot-rodded classic. A man’s machine, ar ar ar!

Back to the grind. The weekend’s over, and it’s time to think about work. Have a wonderful week, check the news sources I cited Saturday if you want, and check back in here a few times while you’re at it, won’t you?

Linux sites I read regularly.

Linux sites I read regularly. I had a conversation with someone yesterday, and sometime during the course of it, the person said, “I could know more about Linux than so-and-so within four weeks if I had time.” To which I replied he’d probably know more within a week. Then he cited the whole time thing.
That’s a problem for everybody, but there are Web sites that’ll help you get sharp and stay sharp, without spending an inordinate amount of time at Google. Here are my favorites.

LinuxToday. (Daily) I’ve been reading this site on a regular basis for more than three years. At one point it became a really obnoxious advocacy/attack site, but that’s calmed down and it’s a lot more professional now. If a Linux story appears somewhere, a link to it will show up here at some point during the day.

NewsForge. (Daily) Not as prolific as LinuxToday; occasionally gets the story sooner, but also produces much more of its own content.

Slashdot. (Daily) Not strictly a Unix or Linux site, but when they run a Unix or Linux story, it’s worth digging through the comments. High noise-to-signal ratio, but you’ll find buried gems you’re not likely to find elsewhere.

Linux Weekly News. (Weekly) A weekly summary of the biggest Linux headlines. If you can only afford the time to read one Linux news source, make a habit of reading this one every Thursday. You’ll find the week’s biggest headlines, plus any new developments in Linux distributions, applications, and the kernel, all boiled down and organized in one place.

LinuxWorld and LinuxPlanet. (Weekly) Two online Linux magazines, well-written, informative and useful. New content is posted irregularly; you won’t miss anything if you just visit each once a week.

Linux Gazette. (Monthly) Another online Linux magazine. It was much “thicker” (more articles) a couple of years ago, but it’s still worth visiting once a month. In 1997, it was just about all we had and I don’t know if we’d have the others if it hadn’t been for LG.

Sys Admin, Linux Journal, and Linux Magazine. (Monthly) Online versions of print magazines. Not exactly beginner stuff; these have useful content for professional admins and developers. The latter two have a little bit of stuff for end users. Read them and learn what you can from them. If you’re looking for a tax writeoff for yourself, or you have a couple hundred bucks left in your annual budget to burn, subscribe to these and think about buying their CD archives to get all the back issues.

Freshmeat. (whenever) Whenever a new open-source project is released, you’ll find the details here. Search here when you’re looking for something. Give it a cursory glance once in a while; you’ll find stuff you weren’t necessarily looking for but then wonder how you ever lived without it.

There are other sites, of course, but these are the sites that stood the test of time (for me at least).

Vintage PCs and bubblegum and Unix and Windows server crashes

Mail. Svenson wrote in, a little bit disturbed at the “vintage” label I hung on Pentium IIs this week. Here’s what he said:

What you call a Vintage PC is about what I got as a "new" box at work!

OK, it's a P2/400 but the 128Meg is not EEC and the drive is a standard 10GB 5400rpm thing. No SCSI anywhere. That is the kind of hardware being installed here.

Oh, and, BTW, it has to run Win2000.

To which I replied my “vintage” label was at least slightly tongue-in-cheek. I’ve got a Celeron-400 here that’s still in heavy use. My P2/266 laptop doesn’t get much use anymore because my employer provided me with a P3-800 laptop late last year. There are people who call even that P3-800 passe. They’re idiots, and I have zero respect for them, but they’re out there, and unfortunately people listen to them. Today I’m hearing P2s mentioned with the same disdain that 286s were in 1993 and 386s in 1996. They’re still fine computers. As my workplace is well aware–our workhorse machine is still a P2-350 or 400 with a 5400 RPM IDE drive, and that looks to remain true for another couple of years.

It’s a buyer’s market. If you know someone who needs a computer, buy one of these. They’re built much better than a $399 eMachine, and the models with SCSI drives in them will outperform the eMachine for household tasks.

Absolutely nuts. If you’re in the market for Luis Gonzalez’s bubblegum (Gonzalez is the Arizona Diamondbacks’ slugging left fielder), it’s for sale. I got a bit far out there on my baseball collectibles, but never that far.

Absolutely funny. I’m so glad that the people at Microsoft and Unisys are incompetent. They set their sights on Unix with their “We Have the Way Out” campaign. Then someone noticed the Web site was running on, uh, well, FreeBSD. I see. Unix is good enough for them, but not for the rest of us. Word got out in a hurry, and they hastily moved the site over to Windows 2000. Within hours, the site was down. And down it stayed, for two days.

See what happens when you abandon Unix in your datacenter for Windows 2000? I gotta get me some of that. I’ll charge into my boss’ boss’ office today and tell him we need to migrate our VMS and Digital Unix and Linux systems to Windows 2000. He’ll ask why, and I’ll tell him the truth:

The systems we have now work too well and I need job security.

Wehavethewayout.com is working now, but Gatermann visited it yesterday and noted its form didn’t work right in Mozilla. So I guess you can only get information on Microsoft’s way out if you’re running Internet Explorer.

Maybe these guys are smart, but they have about as much common sense as the chair I’m sitting in.

That’s just as well. If their experience is any indication (trust me, it is), they can keep their information. I’ve seen more useful information written in bathroom stalls.

CSS and XHTML and standards

Our Unix/VMS admin popped his head over his cube the other day and asked me if I’d tried a particular site on our corporate intranet under Galeon in Linux. I hadn’t; I’d never had occasion to use the site. I was booted into Wintendo at the time, which is normal, since I’m basically an NT administrator. Personal beliefs about Windows aside, administering NT pays the bills, and computers are tools, not a religion.
But my workaday browser is K-Meleon, a lightweight browser based on the Mozilla project’s Gecko engine. It’s small, it’s fast, it’s standards-compliant, and it’s easy to tell it to ignore the JavaScript code that creates popups and popunders. So I tried visiting the site in question with K-Meleon.

Denied.

This made me mad. TCP/IP, HTTP, and HTML were all intended to be cross-platform. The first graphical Web browser was written on a NeXT, for crying out loud! NeXT! How many people today even know what NeXT was?

Of course, when you use Microsoft Web servers serving up pages using Microsoft tools, all the rules change. Microsoft doesn’t even care about previous versions of its own browser. Rule #1 of Web design, which most designers have sadly forgotten, is that you test your site with several different browsers, and preferably several versions of them. It’s easy to make multiple versions of Netscape happily coexist on a machine, but Microsoft has made it next to impossible for more than one version of IE to exist on a machine without resorting to multi-booting. With IE4, IE5, IE5.5, and IE6 all in widespread use and the wretched IE3 unfortunately not extinct, that’s a burden.

A couple of days later, the site’s administrator came back with a snippy response: Use the company standard Web browser.

This, to a Unix and VMS administrator. The only time he ever runs Windows is to fill out his timesheet, since we use a Windows-only app to do it. He’s got a beat-up Micron Pentium-166 in the back of his cube for that purpose. While he could do his job with a PC running Windows and a decent Telnet client, he’s much better off running Linux. He can develop shell scripts locally before sending them up to our big Digital Unix box. Running Linux makes him more productive.

But forget him being able to do his job. He needs to run Windows and Internet Exploiter so he can log into this Web site.

While we’re at it, forget that Internet Exploiter has security holes big enough to drive a truck through. Forget that keeping IIS patches up to date is a full-time job in and of itself. Let’s be Microsoft lackeys. All hail Gates and Ballmer.

I guess the few remaining Mac users at work are going to have to get PCs so they can use this intranet site as well. While I can think of reasons to replace Macs with something else, the inability to display a Web page isn’t among them.

Want to know why it’s a really bad idea to code for just one browser?

Internet Exploiter users can’t read this paragraph, so, those of you who, like me, use a real Web browser written by someone other than an imperialistic monopolist, can share in a dirty little secret. Want to know how to sabotage inept browsers and encourage the use of standards-compliant browsers like Opera and the Mozilla family? Use the tag. Simply nest something inside and , and those who have yet to be liberated from the Evil Empire won’t be able to read it. (Remove the leading and trailing spaces–I had to put those in because some browsers don’t interpret the less-than/greater-than sequences either. Hmm…)

If you want to really be nasty, code your pages so that the only thing visible outside of those tags are the words, “This site can only be viewed with something other than Internet Explorer.” You’ll hack a lot of people off, but you’ll make your point.

Quick question: What’s the first line of the paragraph immediately preceeding this one? If your answer is, “Want to know,” you’re running a Microsoft browser. If your answer is “Internet Exploiter users can’t read this paragraph,” you’re not. There are two paragraphs here nested in non-standard tags. Browsers not made in Redmond correctly ignore this tag and display the text.

There are plenty of sites on the Web that ignore non-IE browsers for no good reason, and who could easily support everything by just following industry standards.

So, for security, what’s wrong with .htaccess files? They work, they’re easy to use, and they don’t tie you to any particular OS or browser on the client side. Especially on a corporate intranet, they’re great.

For layout, what’s wrong with sticking with standard XHTML and CSS? It’s easy to create beautiful pages that look beautiful in any modern browser (not just the one you happen to have installed on your machine), and remain perfectly readable in text browsers and ancient versions of the old standbys. Here’s a great tutorial on basic text styling, a more complete tutorial, some tips on converting existing content, and a site with several elegant layouts you can steal and adapt.

You can even do a cool trick to give your users a choice between your design and the preferences they set in browser setup.

It’s not incredbily difficult to make a layout that looks extremely good and is easy to navigate, plus is readable on all browsers, plus allows the user to gracefully resize it. The end result is files that are smaller than old-school HTML, so the pages download and render faster.

XHTML and CSS are all the rage now, with tutorials in the popular press, and with bloggers flocking to it. It goes a long way towards solving the complaints I had about HTML when I was learning it (let’s face it, when you’re used to designing in QuarkXPress, HTML 3.0 is just plain clunky) so talented designers can do some really impressive things with it.

I’m going to start moving in that direction. It’s time we all did. It’s time to take back the Web. Install Netscape 6.2 and Netscape 4.79 on your machine so you can check your pages in them. At the very least, install OffByOne to ensure your pages are viewable in a third-generation browser (it’s just 1.2 megs in size, so it won’t kill you).

XHTML and CSS are cool if you’re the artsy type, but they’re more than just cool. They’re the right thing to do. I hope I can find the time…

As as for that Intranet site at work? If using it ever becomes part of my job, I’ll re-code it and store it on an Apache server, protected by an htaccess file to show how easy it is to develop cross-platform apps on the Web. After all, it’s what it was designed for.

Not that I expect anyone to listen. It’s distressingly hard to find people who think for themselves, rather than just repeating everything that Microsoft tells them.

Encryption on the cheap

Disspam cruises along. It’s not often that I gush about a program, let alone a 4.5K Perl script, but Disspam continues to make my life easier. Granted, it simply takes advantage of existing network resources, but they’re resources that were previously (to my knowledge) limited to the mail administrator. Literally half my e-mail at home today was spam. Disspam caught every last piece.
A little scripting of my own. I’ve got a client at work who wants absolute privacy guaranteed. He and his assistant have some files they don’t want anyone else to be able to read, period. Well, there’s no way to guarantee that under NT, Unix, or VMS. Under NT, we can take away anyone else’s rights to read the file, but an administrator can give himself rights to read the file once again. We can make it set off all kinds of sirens if he does it, but that security isn’t good enough.

Well, the only way we can guarantee what they want is with encryption. But we’re nervous about making files that one and only one person can read, because last year, one of our executives went on vacation in Florida, fell ill, and died. We don’t want to be in a situation where critical information that a successor would need can’t be unlocked under any circumstance. So we need to encrypt in such a fashion that two people can unlock it, but only two. So the client’s backup is his assistant, and the assistant’s backup is the client. That way, if something ever happens to one of them, the other can unlock the files.

Password-protected Zip files are inadequate, because any computer manufactured within the past couple of years is more than fast enough to break the password through brute force in minutes, if not seconds. The same goes for password-protected Word and Excel documents. Windows 2000’s encryption makes it painfully easy to lock yourself out of your own files.

So I spent some time this afternoon trying to perfect a batch file that’ll take a directory, Zip it up with Info-Zip, then encrypt it with GnuPG. I chose those two programs because they’re platform-independent and open source, so there’s likely to always be some kind of support available for them, and this way we’re not subject to the whims of companies like NAI and PKWare. We’d be willing to pay for this capability, but this combination plus a little skullwork on my part is a better solution. For one, the results are compressed and encrypted, which commercial solutions usually aren’t. Since they may sometimes transfer the encrypted package over a dialup connection, the compression is important.

Plus, it’s really nice to not have to bother with procurement and license tracking. If 40 people decide they want this, we can just give it to them.

The biggest problem I ran into was that not all of the tools I had to use interpreted long filenames properly. Life would have been much easier if Windows 2000 had move and deltree commands as well. Essentially, here’s the algorithm I came up with:

Encrypt:
Zip up Private Documents subdirectory on user’s desktop
Encrypt resulting Zip file, dump file into My Documents
Back up My Documents to a network share

Decrypt and Restore:
Decrypt Zip file
Unzip file to C:Temp (I couldn’t get Unzip to go to %temp% properly)
Move files into Restored subdirectory on user’s desktop

I don’t present the batch files here yet because I’m not completely certain they work the right way every time yet.

They don’t quite have absolute security with this setup, but that’s where NTFS encryption comes in. If these guys are going to run this script every night to back the documents up, it’s no problem if they accidentally lock themselves out of those files. If their laptops get stolen, all local copies of the documents are encrypted so the thief won’t be able to read them. And the other user will be able to decrypt the copy stored on the server or on a backup tape. Or, I can be really slick and copy their GPG keys up onto the same network drive.

This job would be much easier with Linux and shell scripts–the language is far less clunky, and file naming is far less kludgy–but I have to make do. I guess in a pinch I could install the NT version of bash and the GNU utilities to give myself a Unixish environment to run the job, but that’s a lot more junk to install for a single purpose. That goes against my anti-bloat philosophy. I don’t believe in planning obsolescence. Besides, doing that would severely limit who could support this, and I don’t have to try to plant job security. I always get suspicious when people do things like that.

Stopping spam.

Forget what I wrote yesterday. I was going to post the stuff I wrote in Ohio when I realized it isn’t all that good, it’s definitely not useful, and the people who annoy me the most are the people who can’t get over themselves. No one cares what I ate for breakfast, and the only people who care what went on in Ohio already know.
So here’s something useful instead. It’s the coolest thing I’ve found all year. Maybe all decade, for that matter.

Spam begone. I hate spam. It wastes my time and my bandwidth and, ultimately, my money. I’ve seen some estimates that spam costs ISPs as much as $5 per month per account. You’d better believe they’re passing those losses on to you.

There are tons and tons of anti-spam solutions out there, but most of them run on the mailserver side, so for an end-user to use them, they have to set up a mail server and either use it for mail or run fetchmail to pull the mail in from ISP’s mail servers. I’ve done that, but it’s convoluted. But that’s trivial compared to setting up the anti-spam kits.

I was crusing along, vaguely happy, when my local mailserver developed bad sectors on the hard drive, so one day when I went to read my mail, I heard clunking noises. I turned around, flipped on the power switch to the server’s attached monitor, and saw read errors. Hmm. I hope that mail wasn’t important…

Eventually I shut down my mail server and put up with the spam, hoping I’d come up with a better idea.

I found it in a Perl script called disspam.pl, written by Mina Naguib.

It took a little doing to get it running in Debian. Theoretically it’ll run on any OS that has Perl installed. Here’s what I did in Debian:

su (to become root)
apt-get install libnet-perl (Perl couldn’t see the network without this, so the next command in this sequence was failing. This hopefully isn’t necessary on other distros, as I have no idea what the equivalent would be.)
perl -MCPAN -e shell (as per readme–I accepted the defaults, then when it asked for CPAN servers, I told it my continent and country. Then it gave me 48 choices. I picked a handful at random, since none were any more obviously close to me than others.)
install Net::POP3 (as per readme)
quit
cp sample.conf disspam.conf
chmod 755 disspam.pl

Next, I loaded up disspam.conf into a text editor. It looks just like a Windows-ish INI file.

The second line gives me an exclude list. It’ll take names and e-mail addresses. So I put in a few important names that could possibly be blocked (friends with AOL and Hotmail addresses). That way if their ISPs ever misbehave and get blacklisted, their mail will still get to me. Then I popped down to the end of the file and configured my POP3 mailbox. I had an account I hadn’t read in a week, so I figured I’d get a good test. Just drop in your username, password, and POP3 server like you would for your e-mail client. If you have more than one account, copy and paste the section.

Bada bing, bada boom. You’re set. Run disspam.pl and watch. In my case, it flagged and deleted about a dozen messages, typical of what I usually get, like mail offering me Viagra or access to horny cheerleaders or how to find out anything about anyone (which I already know–I have a journalism degree). The only questionable thing it flagged was mail from MLB.com. I can’t get off their mailing list ever since I voted online for the All-Star game. No importa, I never read that mail anyway. I could have always added MLB.com to my exclude list if what they had to say mattered to me.

But if you’re like me and get lots of mail–that was my less-busy account–and about half of it is spam, that stuff’s going to scroll by really fast. So here’s what I recommend doing: when you execute disspam.pl, use the following command line:

~/disspam/disspam.pl ~/disspam/disspam.conf >> ~/disspam/disspam.log

Then you can examine disspam.log. If disspam ever deletes something it shouldn’t have, you can add the person to your exclude list and e-mail them to ask what they wanted. It looks to be less work than deleting all that spam. Probably less embarrassing too. Have you ever accidentally opened one of those horny cheerleader e-mail messages when there were people around? Yikes!

I fired up Ximian Evolution, pulled down my mail, and had 15 new messages. No spam. None. Sweet bliss.

It’s just version 0.05 and the author considers it beta, but I love it already.

Unix’s power allows you to string simple tools together to make powerful ones. Here are some suggestions.

You can e-mail the log to yourself with these commands:

mail -s disspam [your_address] rm ~/disspam/disspam.log

If you want the computer to do all the work for you, here’s the command sequence:

cronttab

Then add these entries:

0 0 * * * mail -s disspam [your_address] * 0 * * * ~/disspam/disspam.pl ~/disspam/disspam.conf >> ~/disspam/disspam.log

If you read your mail on the same machine that runs disspam, you can substitute your user account name for your e-mail address and save your ISP a little traffic.

You’ll have to provide explicit paths for disspam.pl and disspam.conf.

The first entry causes it to mail the log at midnight, then delete the original. The second entry filters your inbox(es) on the hour, every hour. To filter more frequently you can add more lines:


* 10 * * * ~/disspam/disspam.pl ~/disspam/disspam.conf >> ~/disspam/disspam.log
* 20 * * * ~/disspam/disspam.pl ~/disspam/disspam.conf >> ~/disspam/disspam.log
* 30 * * * ~/disspam/disspam.pl ~/disspam/disspam.conf >> ~/disspam/disspam.log
* 40 * * * ~/disspam/disspam.pl ~/disspam/disspam.conf >> ~/disspam/disspam.log
* 50 * * * ~/disspam/disspam.pl ~/disspam/disspam.conf >> ~/disspam/disspam.log

This program shouldn’t be necessary for very long. It’s short and simple (4.5K worth of Perl) so there’s no reason why mail clients shouldn’t start incorporating similar code. Until they do, you run the risk of disspam and your mail client getting out of sync and some spam coming through. If you read your mail on a Linux box with an mbox-compliant client like Sylpheed or Balsa or Kmail, you can bring fetchmail into the equation. Then create a .fetchmailrc file in your home directory (name it ~/.fetchmailrc to ensure it goes to the right place). Here’s the format of .fetchmailrc:

poll SERVERNAME protocol PROTOCOL username NAME password PASSWORD

So here’s an example that would work for me:

poll mail.swbell.net protocol pop3 username dfarq password censored

Next, set your mail client to no longer check for mail automatically, then type crontab and edit your disspam lines so they read like this:

* 20 * * * disspam.pl disspam.conf >> ~/disspam.log ; fetchmail (your server name)

In case you’re interested, the semicolon tells Unix not to execute the second command until the first one is complete. If you have more than one mail account, add another fetchmail line.

As an aside, Evolution seems to use the mbox file format but it doesn’t store its file where fetchmail will find it. I think you could symlink /var/spool/mail/yourusername to ~/evolution/local/Inbox/mbox and it would work. I haven’t tried that little trick yet.

But even if you’re not ambitious enough to make it run automatically and integrate with all that other stuff, it’s still a killer utility you can run manually. And for that matter, if you can get Perl running on NT or even on a Mac, this ought to run on them as well.

Check it out. It’ll save you time and aggravation. And since it only reads the headers to decide what’s spam and what’s not, it’ll save bandwidth and, ultimately, it’ll save your ISP a little cash. Not tons, but every little bit can help. You can’t expect them to pass their savings on to you, but they’ll certainly pass their increased expenses on to you. So you might as well do a little something to lower those expenses if you can. Sometimes goodwill comes back around.

Catching up.

One of these days I’ll get around to posting the stuff I wrote in Ohio. I didn’t think I’d have culture shock out there. I can’t decide if Ohio is in the midwest or if it’s really an eastern state, but St. Louis is awfully eastern for a midwest city, and my dad was from Doylestown, Penn., so I lived with an easterner for 18 years of my life.
Look for that tomorrow, maybe. I’d have to unpack the laptop to post that material and I really don’t feel like doing that. I’ve had a fairly productive day, cleaning the place up a bit and politicking and reading Exodus, and I’m going to conveniently remember that Sabbath runs from sunup to sundown, and the sun is down (never mind that the Sabbath takes place on Saturday–this is my convenient re-interpretation, thank you) so I’ve got my excuse to be lazy, which means kick back with a cup of decaf green tea and let the stream of consciousness flow.

Politicking. Yes, politicking. I found myself in the distressing position this week of being a moderate. I’ve always been an outspoken conservative/libertarian (whichever stance will offend the most people is the one I generally took in print in college), except on religious matters, where I’ve always found a way to be a flaming liberal. When I ditched the liberal theology, I gravitated towards modern practices, which put me right back in the liberal camp.

I find myself caught between two very strong personalities, one that wants radical change yesterday, and the other who finds the status quo very comfortable. That in itself makes me uncomfortable, because our comfort level isn’t very high on God’s priority list. And the mission statement of our church is Reaching people for Christ, equipping people in Christ. When I look around at all the GenXers in our congregation who could be reached more effectively, the status quo makes me very uncomfortable. Ministry starts to go downhill fast when the focus shifts to numbers, but I can think of a dozen faces we could help equip more effectively.

I’d much rather equip one person effectively over the course of a year than 12 in a so-so fashion, but with the status quo, I’m questioning whether we can equip one more person effectively. By the same token, alienating 20 people in order to satisfy one person and potentially gain new people is a net loss, even if you eventually gain more than you lose. You don’t just turn someone’s world upside down for no reason.

Hence, I’m suddenly a moderate.

I don’t like being a moderate on much, so I’m going to go find something I can take an extreme position on.

Shaving. That’ll do it. Unix and VMS master Charlie was talking about razors on his page. I can take a strong position on shaving. Become a Nazarite and don’t do it. Life is much simpler afterward. It takes less time to get ready in the morning, and you end up looking like Richard Stallman so no one will come near you, which means you have fewer social problems, thus making your life even simpler.

Except these days, there’s e-mail, so people can talk to you without having a clue what you look like. And I like being able to walk up to girls without them shrieking something about the ghost of John the Baptist and running away at about 60 miles per hour. But if you get your jollies by trying to prove the Cheetah isn’t the fastest land mammal, I think I just told you how.

But I digress, as usual.

I was having a conversation about a year and a half ago with a good friend and mentor, and I told him about an incident I found myself in. I was having lunch with an old friend, female, in Kansas City, and I found I’d forgotten my razor. So, before I went to see her, I went out and bought a drag razor and my sister showed me how to use it. I’d never shaved with a blade in my life. (She was worth impressing. But don’t get any ideas, because she’s married now.)

“Once you go to a drag, you never go back,” my friend said.

Oh, I went back alright. The drag gets a whole lot closer, but even with a really high-quality one, I can still cut myself occasionally. Once I learned the secrets, I never cut myself with an electric. And an electric is so much faster, because you don’t have to bother with shaving cream and filling the sink with water, and you (usually) don’t have as big of a mess to clean up afterwards. There are two tricks with electric razors. OK, three.

1. Brand matters. A lot. My dad used to give me the electric razors he tried and didn’t like. I figured out really quickly why he didn’t like them. They were like shaving with a Sherman tank. They didn’t shave close, and I felt like I had a rash afterward. Sometimes they’d turn me beet red too, and I wasn’t even mad or embarrassed. My dad would never let me try his Braun. So one day I snuck in after he’d left for work and I tried it. Good stuff.

So if you don’t like your electric, try another brand. I’ll never use anything but a Braun. If a Braun doesn’t work for you, your face might be better suited for a Remington or a Norelco. They must work for some people, seeing as someone buys them.

2. Use pre-shave. The most common brand is called Lectric Shave, but there are others. Rub your face down with it a couple of minutes before you shave. It can make a big difference. With pre-shave, my 3-stage Braun gets just about as close as a blade.

3. Clean your razor! Your razor is not a gateway to a netherworld where your whiskers disappear to. If your razor just isn’t getting very close, pop the top off it and empty it out. It’ll work better afterward. And you’ll have a mess to clean up, like you would if you used a blade.