GNU sort and -k: a gotcha

Sometimes I don't like GNU utilities.

Suppose that you have a file that looks like this:

oxygen     frednitrogen   bobxenon      fredcarbon     cksiron       jim

Further suppose that you want to sort it by the second field, to groupmachines by the users that own them. So of course you do ' sort -k2file ', because that's the obvious answer. Except that it doesn't work;it sorts in some peculiar, non-obvious way, and it's not that you


What we (currently) use virtualization for

I've pulled this out of Random's comment on yesterday's entry :

[...] but I stop short of doing everything on virtual machines,which I think you do more of.

Although I may have accidentally left people with a differentimpression, right now we're actually not using virtualization forvery much. We have one virtualization host machine, and on it wecurrently run only three virtual machines: two Windows imagesand a small Linux machine that forwards some low-priority email .


One reason that I call us a midsized environment

I mentioned earlier that I have a number of reasons tocall us a midsized environment. One of them is how we need to run ourenvironment, in that we are in the middle between two extremes of howto deal with systems.

On the one hand, we are sufficiently large that you don't want to dothings by hand and it makes sense to automate at least some things.We've long since grown past the point where all of our machines could beset up separately or run individually (


Redirecting from HTTP to HTTPS is a bad security idea

Every so often, people setting up SSL websites have the bright idea thatto be friendly, they should have a non-SSL version of the site thatredirects people to the SSL website. They are entirely correct that thisis the friendliest approach, but you shouldn't do it if you care aboutsecurity.

(There are plenty of reasons to use SSL even if you don't care aboutsecurity. Pervasive SSL frustrates all of the people who want to sticktheir fingers in traffic between actual users and your


How I set up my isolated testing Firefox environment

Yesterday I covered how I actually runtwo web browsers, one for my real browsing and one for various sortsof testing and isolated browsing. That raises a question: how do youset up something like that?

In theory, you could just use an alternate Firefox profile (with ascript to start your test Firefox with the right magic arguments). Inpractice I have never trusted Firefox's profile system that much, partlybecause in the past I spent some time testing out potentially buggydevelopment builds. So I


How I run two Firefoxes at once and still have remote control

Given how Firefox remote control works on Unix , you might wonder how I routinely run twoseparate copies of Firefox and still have my remote control environment work reliablyenough that I haven't pitched one of the copies out the window long ago.

In theory, the answer is Firefox's -no-remote argument. In practicethis doesn't work quite the way you want it to. The problem is that aFirefox instance run with -no-remote will still register itself as avalid target for remote


A very convenient trick: having a testing browser

One of the little peculiarities of my personal environment is that Iactually use two different copies of Firefox at once. Well, sort of.What I have is my regular Firefox and a separate 'testing' instance.

There are two important configuration differences between the instances.First, the testing instance uses a standard version of Firefox, insteadof my usual self-compiled and custom-hacked version. Second, it isconfigured to clear all 'history' when Firefox exits, thereby flushingbrowsing history, the cache,


What problems the Maildir mail storage format solves

There is a relatively widespread view that the Maildir mail storageformat is the solution to anyissue that one is having with traditional mail message storage ( cf thecomment here ). This is not exactly so, and asa result it is important to understand what problems Maildir actuallysolves and what ones it does nothing about. Or for that matter, theproblems that Maildir can make worse.

(In this entry I'm going to compare Maildir against the traditionalUnix mbox format.)

Maildir excels at all single-


An extra problem with not documenting things in open source modules

Programmers are famous for not doing a great job of documenting theinterfaces of their projects (whether these are libraries with APIs,protocols, programming languages, or whatever). The problems that thiscauses for people who are trying to use your work are well known, butit's recently struck me that open source projects in particular havean additional issue.

In the absence of documentation, people working with open sourceprojects can always read the source to find out how to do something, todiscover the interface that the


A modern VCS mistake enabled by working on live trees

I've written before about sysadmin style use of version control , where we typically use a VCS for documenting the livetree instead of developing something. Recently I ran into a mistake that modern VCSes and this style of working combinetogether to enable: deleting a file from the live directory tree butforgetting to delete it from the VCS.

Since the live tree is, well, live, deleting the file actually takeseffect and so you don't notice anything wrong. In fact, in a sensenothing is wrong