Better Living Through Thinking |
|
Making 'find' go fasterWed, 24 Oct 2007
The mysterious Unix So here is this and a few things I've learned over the years to make
... Finding Mail SendersThu, 17 May 2007mailsender finds all of the email addresses sending to a given recipient (e.g., joe@here.tld) in one or more logfiles (assumes modern sendmail-style log format with 'sm-mta' lines, etc.) This will not work for any other kind of MTA (e.g., exim, postfix, qmail, etc.) Usage: mailsender joe@here.tld /var/log/maillog /var/log/maillog.0.gz ... ... Tell Even from Odd DaysTue, 17 Apr 2007Here's a small utility to tell even from odd days (useful in some crontabs): #!/usr/bin/perl -s exit(((localtime)[3]+($odd||0)) % 2); Save this to /usr/local/sbin/evenday, chmod 755 /usr/local/sbin/evenday and chown root:wheel /usr/local/sbin/evenday ... histmbox - an mbox histogram generatorFri, 13 Apr 2007*updated: Fri Apr 13 11:39:12 MDT 2007* histmbox reads one or more mbox-style mailbox files and prints out a histogram of how many message were received per day. This is useful for testing whether new mail filters are effective or not, for example. Sample usage: ... procsum - procmail log summaryWed, 17 Jan 2007*updated: Wed Jan 17 10:10:04 MST 2007* procsum is a simple procmail log file summary tool. Current version: 0.50 (released 2007/01/11 18:06:34) Read the manpage: Download procsum: rascals - stop brute force network attacksTue, 02 Jan 2007*updated: Tue Jan 2 10:35:51 MST 2007* Important update: rascals versions older than 1.10 (version
1.10 and newer are not affected) do not handle auth.log files
that span a calendar year (i.e., go through December into
January). This bug results in older attacks being revived as new
attacks.
Beginning with version 1.10, rascals correctly handles this ... Find files older than a given timeTue, 05 Dec 2006We want to find files that are older than a specified time. We use the '-newer' option to 'find' and invert it. The BSD 'find(1)' manpage states: -newerXY file True if the current file has a more recent last access time (X=a), change time (X=c), or modification time (X=m) than the last access time (Y=a), change time (Y=c), or modification time (Y=m) of file. In addition, if Y=t, then file is instead interpreted as a direct ... qmon - monitor user quotasTue, 30 May 2006*updated: Tue May 30 10:28:03 MDT 2006* qmon reports users who have reached a specified threshold percentage of their quota (default = 95%). You can change this threshold, as well as exclude specific users. If no users are over the quota threshold, no report will be given (making qmon suitable for putting into a crontab). Current version: 1.1 (2006/05/30 16:25:37) ... Installing mod_davMon, 23 Jan 2006This document describes (briefly) how to setup mod_dav for a FreeBSD system. 1) Install mod_encoding.so # cd /usr/ports/www/mod_encoding # make && make install Note: this step is only necessary if you have Windows XP clients ... retouchTue, 13 Sep 2005retouch makes one or more files have the same date as another file. Why would you want to do this? Here's what I do with it: sometimes I need to edit a blog entry (I use blosxom) but editing the entry changes the timestamp. I'm an emacs user, which renames the original file with a tilde (~) at the end. So now I can just do this: ... |
Audio Broadcast(standby)Moon StatusPhase: 10.93%Illuminated: 11.34% Age (days): 3.23
Fri Mar 19 01:32:49 MDT 2010 |