A bash irritation
Presented in illustrated form:
; cat foo#!/bin/shcat "$@"; ./foo /etc/termcap | sed 1q >/dev/null./foo: line 2: 3632 Broken pipe cat "$@"
This behavior is new in Bash 2, as far as I know. I find itextremely irritating, because programs having broken pipesis perfectly normal in Unix. Many filters and so on don'tconsume all of their input, and
A pleasing Python regularity with __future__
The other night I was writing a Pythonprogram that wanted to divide two integers and get a floating pointresult. Normally integer division in Python produces integers, followinga C style model of distinct numeric types; however, Python is slowlymigrating towards a model where the types of numbers are more of animplementation detail.
The general way to get early access to an incompatible change likethis is a magic statement at the start of your module: from__future__ import whatever . I knew that the change in
Some quick SMTP connection statistics
Recently I've been wondering about the usage pattern of zombie machines.Do spammers typically make only a few connections from each zombie andmove on, or do they use the same machines over and over?
Through my weekly spam stats I know thatsome machines that we reject at connection time try again and again.But what's the distribution like? For example, do most IP addressesget refused once or twice and then go away? So I grabbed our logs andstarted looking.
All of these figures are
Some things about smpatch
smpatch is the official Sun thing for dealing with Solaris patches forSolaris 8 and 9 (Solaris 10 apparently has an all new system, hopefullybetter). I got interested in smpatch not just because it's the officialSun tool for this stuff, but because it has one feature that pca doesn't: it can reliably tell whatpatches are safe to be installed on a live multiuser system.
(While pca can skip patches that require reboots, it doesn'tcurrently have a 'skip patches that
The other dynamic linking tax
I've already talked about one dynamic linking tax , but here's another one.Presented in illustrated form:
; cat true.c#includeint main(int argc, char **argv){ exit(0);}; cc -o true true.c; cc -o true-s -static true.c; diet cc -o true-d true.c; ls -s true true-d true-s 8 true 4 true-
Keeping up with new Python features
I have a new resolution: every so often, I'm going to read over thecurrent builtins section ofthe Python documentation.
I've come to this because recently I was reading through a page onPython idioms to see ifit had anything new, and stumbled over the mention of an
enumerate()builtin, new in Python 2.3. Well, I'm using Python 2.3, and I hadn'trememberedenumerate(), and I could have used it recently. Whoops
Why I don't like resorting to caching
One of my little twitches is that I really don't like putting caching inmy programs. It's not because cache invalidation is hard, although itis. It's because resorting to caching is an admission of defeat: it'sadmitting that I can't make the actual code go fast enough.
In other words, I've failed to write code that's fast enough. Idon't think any programmer likes to fail; certainly I don't. I don'
Spiders should respect rel="nofollow"
If you're writing a web spider, what should you do when you see alink marked
rel="nofollow"?In theory, you can do nothing different from any other link.It's not a formal specification, and the original description only talks about the resulting link not giving the target any credit.
In practice, on the Internet what people expect is in largepart defined by what the 800 pound gorillas do. And both Googleand MSN Search consider
nofollowto be literal: don
An ugly spam attempt
Every so often I take a look at what user agents are visiting WanderingThoughts . Tonight it turned up a doozy; a single visit with a
User-Agentof:
Presumably the intended attack vector was sites that summarize useragent traffic onto a web page without escaping the text; that wouldmake this user-agent string into live JavaScript that would forceany visitor's browser to go there.
The attack is also noteworthy for how
Weekly spam summary on April 1st, 2006
Let's see what sort of April Fools joke the spammers have been havingthis week. This week, we:
- got 14,298 messages from 221 different IP addresses.
- handled 18,642 sessions from 966 different IP addresses.
- received 153,366 connections from at least 49,555 different IPaddresses.
- hit a highwater of 17 connections being checked at once.
Connection volume is up from last week , butsession volume
Menu
![]()