Archive for October, 2003

TwainTiffBatcher

Friday, October 31st, 2003

I’ve built a TWAIN to TIFF file batch scanning utility. It’s called TwainTiffBatcher. It grabs images from a TWAIN datasource and writes them to disk as TIFF files, rather than keeping them in memory. This is useful for scanner drivers that do not support writing to files. It supports B&W, 8&16bit grayscale, and 24&48bit color image types.

qmail probabilistic outgoing smtp load balancing

Friday, October 17th, 2003

I’ve built a patch to the standard qmail-remote.c and a patch to the qmail-remote.c resulting from patching with the SSL/TLS patch. They implement probabilistic load balancing of outgoing smtproutes.

Here’s an excerpt from a post to the qmail mailing list about them:

It’s probably easiest to give an example.

Previous smtproutes entries work as normal, but qmail-remote now
supports:

host.domain:host1:port1@weight1/host2@weight2/host3
.domain:host1:port1@weight1/host2@weight2/host3

Each of these lines will be interpreted as a set of three relay
hosts, host1 has port1 and weight1, specified as unsigned longs.
host2 has a port of 25 and weight2, specified as an unsigned
long. host3 has a port of 25 and a weight of 1.

qmail-remote totals the weights, uses srandomdev() (under freebsd
this is what I wanted - change this to the seeding behavior you
want) and random() to get a random number, and then iterates
through its list of weighted relay hosts until it finds the one
that corresponds to the random number.