[wplug] Favorite handy one line commands

Tim Lesher tim at lesher.ws
Wed Jun 4 22:44:23 EDT 2003


On Wed, Jun 04, 2003 at 10:04:08PM -0400, John wrote:
> kill -9 `ps aux | grep processname | awk '{print $2}'`

Isn't 'killall -9 processname' easier?

The others (particularly the loop) are nice.

One thing I've done recently (though it's not a one-liner): I use
spamassassin to cut down the amount of spam in my inbox, and mutt to
read mail.  spamassassin has added Bayes filtering support, but to
make it work, you have to keep feeding it examples of spam and
non-spam ('ham') messages.  You can do this with the 'sa-learn'
command, and spamassassin's documentation suggests binding it to a
mutt key, but on my lowly mail server, this process takes about ten
seconds per item to update the bayes database, which is a heck of a
lag if you're just checking mail.

So instead of that, I've rebound 'd' from 'delete' to a command to
move the mail to a 'bham' mbox, and added a new binding 'S' to move
the current message to a 'bspam' mbox.  Then I have a cron script
that, in the wee morning hours, batch processes the spam and ham to
update the bayes db, then deletes and touches the mailboxes to
recreate them.

So normal mail reading (read, [respond,] delete) automatically tags the
received message as 'not spam', and tagging mail as 'spam' becomes
blindingly fast.

UNIX:  the simple is easy, and the hard is possible.
-- 
Tim Lesher <tim at lesher.ws>
http://www.lesher.ws




More information about the wplug mailing list