Here's a present from not-invented-here land:
http://lpaste.net/355117
ips-to-cidr.sh, a script to aggregate a list of IPv4 addresses into CIDR nets.
The idea is that you start out with a list like this:
$ cat ip-list
173.0.52.58
173.0.52.59
173.0.52.63
173.0.52.73
And aggregate addresses into CIDR nets:
$ ./ips-to-cidr.sh ip-list
173.0.52.58/31
173.0.52.63/32
173.0.52.73/32
which are nicer for firewall tables etc.
There must be existing tools to do this, but I don't know them :/