People are ordinary

Most people are ordinary, which means that most people are going toproduce lame and boring results. Not through any fault of their own, butbecause they will be ordinary results, and we're simply just not veryinterested in the ordinary because there's so much of it. By and largewe're driven to the exceptional, the rare; to what stands out.

Thus, the inevitable but often overlooked result of people being social on the Internet is a lot of ordinary, boring blogs,home


Weekly spam summary on June 3rd, 2006

This week, we:

  • got 11,560 messages from 225 different IP addresses.
  • handled 16,969 sessions from 1005 different IP addresses.
  • received 135,139 connections from at least 46,180 different IPaddresses.
  • hit a highwater of 12 connections being checked at once.

Apart from slightly higher numbers of IP addresses talking to us thisweek, this is a clone of last week 's numbers.Since the per


The fundamental problem of spam

Recently, yet another article on the death of email ranin the Register, 'The time has come to ditch email' (which I saw due to a Slashdot article ). As usual, itadvocates replacing SMTP email with something that is more 'secure',whatever exactly this means.

Unfortunately, this misses the fundamental problem of spam:

You want to get email from strangers, but only good strangers.

Telling good strangers from bad strangers is a hard problem, to put itone way. There is no


An object identity gotcha in Python

Consider the problem of implementing a modified LIFO stack that has anadditional O(1) operation called min , that gives back the smallestitem in the stack. For now, let's pretend that Python arrays are O(1)(or that someone has implemented a native queue class); in many respectsthey are as far as Python code is concerned.

The simple implementation is to keep two stacks, the main stack andone that you only push new minimum items onto. Then push and pop aresomething


Link: a Unix sysadmin rosetta stone

Rosetta Stone for Unix is a very handycross-index of various commands and tasks across various Unix variants.The index of tasks is especially handy as a quick 'how do I do this onX' pointer. It's available in several formats, and as a bonus you getsome helpful links as well.

(Since I was just using this today to figure out how to do variousthings on Solaris, I figured I should finally get around to mentioningit.)

(From a Slashdot comment .)


The cynical take on nofollow

People have been calling the nofollow tag afailure for a while, most recently in Blog Spam, and a 'nofollow'Post-Mortem , which hit the geek news today. Comment spam has not exactly diminished sincenofollow's adoption, which is not a good result for somethingintroduced with the title 'Preventing comment spam' .Calling it a failure is pretty easy.

The cynical take on nofollow is a bit different: nofollow is actuallya clever way to improve search engine results . While it's not


Fiddling with X selections from shell scripts

I know of three command-line programs that will fiddle with theX selection (and/or the cut buffers) in a way that's usefulfor shell scripts: xsnarf from Smarasderagd's collectionof X things , xcb , and xclip .

I use xsnarf for a variety of reasons, I think partly historical (inthat I had it around well before I found the others); I'm jotting downthe other two here partly so that I have the information handy the nexttime someone asks me


A simple way to get a disk space usage summary

In the spirit of my little shell scripts, here's a simple way to get auseful summary of disk space usage on a Unix system:

du | sort -nr | less

(substitute the pager of your choice for less , and use ' du -x ' asnecessary.)

This is less pretty than the various graphical disk space visualizationprograms that float around, but I find it gives me pretty much theinformation I need. It's pretty easy to narrow down what areas of thefilesystem,


An shell script idiom for choosing what file to operate on

This is one of those Bourne shell idioms where I show the code firstand explain the effect later:

#!/bin/shdef=$1; shiftcase "$#" in  0) if test -t 0; then        cat -- $def     else         cat     fi;;  *) cat -- "$@";;esac

Call this selfile . You use it in things like log scanning scripts,invoking it as:

selfile /var/log/something "$@" | .


An obvious way to do bulk initialization of dictionaries

Every so often in my Python programs I need to initialize adictionary with a whole bunch of values (and then pass it offsomewhere). For a long time, my usual approach to this was:

d = {}d['a'] = b.whatd['c'] = foo(d)....

Recently I stumbled over the better way to do this, which isembarrassingly obvious in retrospect:

d = {      'a': b.what,      'c