The sort of command line I can wind up typing

Here's the sort of command line I can wind up typing:

spam/wtd daemon | expsyslog.pl | tcpwrhits -i | sed 10q | while (read foo) { n=`{echo $foo}; echo '| '^$n '|' `{checksmtp $n(2)}; }

(This will probably be wrapped in your browser, but it is all one line.)

I wrote that on the fly, in one pass, although I had to think it through a bit. I'm not going to claim that this is a typical Unix command line, but I do think it's the sort of thing experienced Unix users wind up doing every so often. It's also a good illustration of the density of little custom scripts in real environments.

What it produces is more or less the 'count / IP address / why' table from this week's spam summary, in DWikiText form ready to be dumped into place.

(The shell syntax will look a bit strange, since I use rc.)

Sidebar: an index of commands

spam/wtd Spits out the last week's worth of some sort of log, in this case the daemon syslogs.
expsyslog.pl expand 'last message repeated N times' in syslog logs
tcpwrhits Generate a report of IP addresses rejected at connection time by our SMTP frontend (and how many times each was rejected)
checksmtp Tell me what our SMTP frontend would do for a connection from a given IP address.

(Except for expsyslog.pl, all of these are completely specific to our environment and thus pretty uninteresting.)

These are my WanderingThoughts
(About the blog)

GettingAround
Full index of entries
Recent comments

This is part of CSpace, and is written by ChrisSiebenmann.

* * *

Atom feeds are available; see the bottom of most pages.

This is a DWiki.
(Help)

Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web

Search:
Written on 23 April 2006.
(Previous | Next)

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Sun Apr 23 03:55:38 2006
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.