Code, Tools, etc
Filtering Spam with Procmail
I use Procmail to filter my
incoming mail into folders. Mail lists get filtered into separate
folders unless they are very low volume or are of a more timely
nature, such as relating to current events. I also use it to
attempt to deal with spam. There is no way to block it
all, and there are other ways to
minimize it, but this works for most of the spam that
I get.
Originally I started with "dougmc's spam catcher", to which I have
lost the original source. The first 8 rules are unchanged (I
think). I have added 20+ more rules however, some of which are
still being perfected. My .procmailrc includes this from $HOME/.procmail/rc.spam
.
NB: I cannot guarantee that, by using these rules, you will not
lose email or even delete your whole mailbox! Caveat emptor!
Filtering Pop-Up Ads with IPCHAINS
Pop-up ads have become a growing annoyance. At home, behind my
Linux NAT firewall, I can block out whole swaths of IP territory
from which such pop-up ads originate, using the Linux ipchains
tool. I have a large set of rules defined in /etc/rc.d/rc.firewall
. Since my NAT
box is running a 2.2 kernel, I use ipchains for this.
NB: I cannot guarantee that, by using these rules, you will not
completely fubar your whole network configuration. Beware that
the layout of this file is not logical - there is stuff commented
out in there from various sources, each of which use different
ways of going about this. The uncommented stuff however, does
make sense. I just keep the other in there for reference. Caveat
emptor!
(I have removed the link to this for now, as I'm not sure I'm
comfortable with how much it reveals about my home LAN.. contact
me if you are interested in the nitty gritty of it.)
Area Codes
This is a script I use to look up areacodes
on the command line. It has a long history as documented in the
comments, but I gratuitously converted it to Perl in 1997, making
it also able to accept city/state names, and more than one at a
time. It needs to be updated with the area code additions/changes
of the last year or two.
TkClassmail
TkClassmail was a tcl/tk tool I wrote as
a CS junior at the University of Minnesota. Simple GUI for
adding/deleting oneself from course mailing lists, with a
self-sufficient backend system for maintaining the list files.
The GUI designed its layout dynamically, based on the list files
present. See examples #1
and #2. It was used for
many years by the Institute of Technology.
locatefile
: Exact Matching for GNU
locate
locatefile
is a Perl wrapper around GNU
locate which returns only files that match exactly. You can
also soft link "locatebin" or "locatedir" to this for exact
matching on executable files or directories only.
ScanAssassin
I got tired of seeing almost daily ssh brute force attempts on my
webserver. So I wrote ScanAssassin. I
need to update it to work with ProFTPD also.
It might also be a good idea to use SpeakEasy.
Collection of Quotes
I have a large collection of quotes,
originally just those from the BSD
Unix fortune(6) program, but I have collected more from
various sources and added some of my own. The original fortune
"quotes" generally are silly or geeky jokes, dating back to the
early early days of the Internet. However, many of them are quite
apropos and good. I wrote a Perl script called
sigsetup
that I use to put a new random quote in my
.signature every time it is accessed. I'll make that available
here sometime too.
filecnt
This is a quickie script I wrote to produce
a count of the number of files in a given directory. With no
argument, it defaults to the current directory but can accept any
number of directories on the command line.
NetHack
Empire
Led Zeppelin
mget
rpmupdate
sa-edit
including notes on replacing a cable for my Sony KV-32XBR100
television.
Upgrading Linux in-line with Yum
I have been upgrading Fedora Core in-line using yum since RedHat
8.0 - I have not had to do an absolutely fresh install of Linux
since then. However in this method, absolutely new packages that
are not dependencies of existing packages do not get
installed.
So in an effort to make sure I have a Full Install, I developed
this command to run post-install:
yum grouplist | grep '^ ' | perl -ne 'foreach (<>) { chomp;
$_ =~ s/^\s+//; print "yum -y groupinstall \"$_\"\n" }' |
sudo sh -x
igal
I have been using igal to
generate some random image galleries. There is a bug in how
it calculates image heights for animated gifs, such that it
isalways wrong (and far too large). Fixing it was going to take
more than five minutes so I use this Perl command line to fix the
index.html whenever I generate a gallery:
perl -pi -e 's/height=\d\d\S+/height=75/' index.html
fedora legacy rpm's
Eric D. Hendrickson
Last modified: Fri Feb 23 14:56:49 CST 2007