Spamhaus adds a RHSBL

I’ve been tinkering in my spare time with setting up a killer mailserver; something that will hopefully fend off spam with great accuracy, yet never at the expense rejecting legitimate mail. One great weapon in the fight has always been Spamhaus, which runs a series of extremely high-quality blacklists.

It turns out that they’ve recently launched their DBL, or Domain Block List, a form of RHSBL, allowing you to query domains for spamminess instead of looking up IPs. There’ve been a bunch of lists offering this, but DBL should bring the usual Spamhaus professionalism to the table. Yay!

Programming Tip

This is probably so ludicrously obvious that it goes without saying but, in my experience, it really needs to be said:

When building your architecture, you should design it so that things you do every day are easy.

For example, if you have an often-used object, don’t split it into two halves and require that you join on them. There are lots of arguments for not having a 50-column table, and there was a clear distinction between the public side of a user and the private site of a user, but splitting one simple concept in half has caused lots and lots of pain. If it’s a core “thing” on your site, make it easy to manipulate. For example, the question, “How many users signed up today?” should not require joining two tables, nor should finding out whether a user on the site is active or not.

When complexity doesn’t come under the guise of optimization, it sometimes creeps in as permitting new capabilities. On another product we moved the “email” column out and created an Email object, allowing users to have multiple emails. In more than a year’s time, nothing has ever been done to actually assign additional emails. All it means is that instead of User.find_by_email(‘abc@example.com’), I need to do Email.find_by_email(‘abc@example.com).user.

And here’s what got me annoyed enough to start this post: you shouldn’t need lots of conditions to show your base case of things. Right now I’m working on a bit of code to pull back all the posts on the blogs. It seems I need to check a whole bunch of columns: WHERE post_status=’publish’ AND post_password IS NULL OR post_password = ” AND post_date < NOW()

Sorry, but that’s dumb. Sure, you can bundle it away and give a nice simple method that does all that stuff for you, but hiding insane designs behind simple methods doesn’t actually fix them. It all comes down to the premise I began with:

When building your architecture, you should design it so that things you do every day are easy.

Displaying all the posts on a blog is a thing you do every day. So is getting the number of members who signed up today. So is looking up a user by email. So don’t make them hard.

Things Every Geek Needs

I tend to like comparing working with computers to working with cars. I’m not sure why. I think it probably has to do with the fact that everyone has a vague idea of what mechanics do, but computers are often seen as a black magic.

So here’s a list of things that I’ve found handy to have in my “garage,” because you never know when you’re going to need them:

  • Extra power cables. USB, power, and Ethernet, at least.
  • Extra USB peripherals, especially a keyboard.
  • A USB CD drive.
  • A USB-to-ATA and USB-to-SATA adapter. You use it once and it’s instantly worth it. I have a bunch of old hard drives, and I can just throw this little adapter into the back of the bare drive, use the included power adapter, and I’ve got a “USB” hard drive made out of an internal drive. Don’t consider buying one without SATA support or it’ll be obsolete.
  • A copy of the Ultimate Boot CD. It’s ancient (mostly DOS-based), so it sometimes has a hard time seeing a 2TB SATA disk connected off of USB or going through an SAS controller, but kind of like the USB-to-(S)ATA adapter, if you use it once you’ll sing its praises forever. It’s bailed me out repeatedly, and does everything from testing drives to checking RAM to doing CPU load-testing… Oh, and I recovered (!) a totally-destroyed boot sector after a botched OS upgrade once. I was flipping out trying to figure out if I’d managed to screw things up for good, and I ran one little tool that just fixed everything. I believe it has some nifty utilities for things like resetting Windows passwords, too, though it’s been ages since I used them and I’d be surprised if they worked on modern systems.
  • A Linux live CD. I like Ubuntu, just because it’s easy and works on most everything. (Knoppix is an old favorite too.) It’s not for installing over things (although that’s cool too…); it’s for rescuing data. An Ubuntu Live CD will speak many more file formats than Windows. Boot a messed-up machine from this, and use your USB-to-(S)ATA adapter to copy files over to an external disk… And since it boots to a full OS and not just a rescue shell, you can do things let get it to use your wireless NIC so you can use Firefox to look up information while you’re working. (And an added bonus: use it to verify whether your NIC is bad or it’s just your OS install that won’t see it… Unless, of course, Ubuntu’s Live CD doesn’t support it, but it’s 3 for 3 right now.)
  • A set of screwdrivers. Big and small. Mostly small.
  • Some Torx screwdrivers. I held out for a long time, and eventually bought a cheap set at Radio Shack. I wish I’d done it much sooner. It turns out a lot of things use Torx screwdrivers.
  • A whole, unformatted hard drive with huge capacity. Back everything up if things get scary, whether it’s because a drive is clicking or because you’re doing a major OS upgrade. It’s really worth the money to keep a 1TB+ drive that you never use. (And with the USB-to-(S)ATA adapter, you can get a cheaper internal drive, even.)

I used to keep a thumb drive with handy Windows utilities, too, but I haven’t done much with Windows lately. It had things like a bunch of SysInternals tools, CCleaner, Defraggler, and Recuva… Portable Firefox, and trial installers for anti-virus software. Revo Uninstaller. Back in the day I had Ad-Aware, too; not sure if it’s useful these days or not. Ninite is cool but not really meant for a thumb-drive. Actually, pretty much everything in Lifehacker’s How to Fix Your Relatives’ Terrible Computer is really good. Photorec is super-obscure and not easy to use for non-geeks, but it does its job amazingly well.

Rules about Trust

One thing that always drove me crazy in school was when teachers stressed that we had to take what we read on the Internet with a grain of salt. This was, of course, excellent advice: the Internet is filled with blatantly misleading information, and those are just the nice parts of the Internet.

But what always got under my skin was the unspoken implication: if it’s printed on paper and in a library, it must be true. Sure, there are higher barriers to entry in publishing, and most books go through lots of proofreading, so it’s not like some unhinged lunatic can turn out books of misinformation and hoaxes. Except that this happens all the time.

In the context of a research paper about Alfred Nobel or something, it probably doesn’t matter. Information you find on books in the library is probably accurate, but who knows about the Internet? I’m sure you could find some information. But this is really the wrong message. Shouldn’t the message just be “Always verify your sources because people get stuff wrong all the time”?

Recipe

Awesome discovery of the weekend: bacon-jalapeƱo pizza. I want to try to create this, possibly with chipotle instead.

Bacon and jalapeƱos are an amazing combination in general, I think.

Announcements

I’m still uneasy about the “all black people leave the store” announcement, but for two very separate reasons.

The first, of course, is the appalling racism. We’ve all known that racism is still alive and well, but it’s really quite scary to see it going on.

But the other thing that leaves me uneasy is the massive police investigation and the arrest — and possible one-year jail term — of the 16-year-old boy who made the heinous announcement.

I really don’t think a crime was committed. Was it disgusting, appalling, and hateful? Absolutely. But I could say the same about some talk radio shows. Should this person be ashamed? Totally. Ridiculed? Yes. But what crime was committed? Patently hateful organizations like the the KKK have enjoyed First Amendment protections for a long time. And by showing the absolute worst of America, they indirectly also bring out the absolute best of America: they show that even the nutcases enjoy Constitutional protections of their bigoted speech. Instead of trying to legislatively muffle their voices, we as citizens expose their intolerance and often upstage them with a much bigger counter-protest. It means that the system still works as intended.

I really don’t want to live in a nation of racists. But even more so, I really don’t want to live in a nation where people who make bigoted and uninformed announcements serve time in jail.