An interesting experience with IP-based SMTP blocks

As I've mentioned before , I still run a maileron my office workstation. Since it gets almost no real email any more,I've become more and more aggressive about using kernel level IP-basedblocks on my SMTP port and applying them to relatively large networkareas when other bits of my anti-spam heuristics detect something theydon't like from an IP address in the area (this follows a familiarpattern ). I also reboot my workstation relativelyfrequently (Fedora releases a lot of kernel


Why you should never use file (or libmagic) to identify files

Every so often, someone needs their program to figure out what sort ofthing a file is; is it text, or HTML, or a JPEG image, or Postscript, orwhatever? When this happens it must be very tempting to use the file program to classify things, especially since some versions of file willgive you a MIME type for the file (instead of just a text label).

Here, presented in the traditional illustrated form, is why you donot want to do this:

; file example

ls -l should show the presence of Linux capabilities

The other day I discovered that /bin/ping is not setuid on Fedora 16machines, in particular on my machines. But it still worked, and tryingto strace it showed that somehow it still had some sort of setuidpermissions (because it didn't work any more, failing with permissionserrors).

(Ping normally needs to be setuid root in order to send raw ICMPpackets. You can question why this is a privileged operation and notjust another socket type, but that's the historical


What you need for migrating web content

In light of the wiki trap and the question of how to managecontent, let's start with a basic question: suppose that you want tomigrate from one way of storing and managing web content to another(such as in to or out of a wiki). What things do you need from yourcurrent content system?

Based on our experiences here, my answer is that the minimumyou need is:

  • a list of the important URLs you have now, especially URLs withessentially static content (let's

My view on why CISC (well, x86) won over RISC in the end

One of Tanebaum's now-famous three predictions in the Tanenbaum/Torvalds debate was that x86 would die out and be replaced by RISC architectures.Some of you may be tempted to immediately laugh at this prediction,but before you do that you should remember the historical context;specifically, that this prediction was made in 1992. Back then thislooked like a very good bet, one so good that Intel made it itselfwith the Itanium . RISC was everywhere, the x86architecture


The wiki trap (that we've fallen into)

A number of years ago we had a not verygood support website area that was basically a bunch of HTML pages withvery little organization and navigation. In late 2009, when thingsreached the point where the support site absolutely had to be improvedsomehow, we made what has turned out to be a bad mistake: we turned itinto a wiki. I say that this was a bad mistake because about a yearlater, we discovered that our wiki software was effectively abandoned . Oh, there's


Hypervisors are not microkernels

As a result of a Stackoverflow question on the Tanenbaum/Torvaldsdebate I got to see a certain number of people claim that (virtualization)hypervisors are more or less microkernels, certainly enough so tomake one of Tanenbaum's predictions (ultimately) correct. This iswrong.It's true that hypervisors and microkernels can both sit 'underneath'normal monolithic kernels as a low-level layer, and both can potentiallybe 'small' for some vague definition of small. But those are about theonly solid


Tanenbaum was wrong in the Tanenbaum-Torvalds debate

One of the reactions to the Stackoverflow question that asked why Tanenbaum was wrong in his predictions for the futurein the Tanenbaum/Torvalds debate was for people to say that Tanenbaumwas right or mostly right (although not as fast as expected). Thisis incorrect.

The question quotes three Tanenbaum predictions:

  1. Microkernels are the future
  2. x86 will die out and RISC architectures will dominate the market
  3. (5 years from then) everyone will be running a free GNU OS

The usual defense of the first prediction is to point to


Faking (or not) a ternary if operator with && and ||

Suppose that you have a multiline if in some language and you want torewrite this into a single line and a single expression; however, yourlanguage only has && and || operators without a ternary if operator(this is C's ?: operator). Can you do this rewrite safely?

To be concrete, let's do this in the Bourne shell (which is where I sawthis be done recently). Suppose you have the following multiline bit ofshell script and you want to reduce


Revisiting checksum functions

In his comment on Checksums and hashes , nothingscorrectly called me on some stuff in my discussion of checksumfunctions. So let me revisit my bit on checksums and try to do itbetter.

In a strict technical sense, per Wikipedia ,there is a relatively narrow mathematical definition of a checksum function.Or perhaps a somewhat broader one (this is the joy of Wikipedia). In either case, it seems that at least someof what we informally think of as 'checksums' are not checksum functions inthis mathematical