rulururu

post Set Manipulation of files with uniq & sort

March 22nd, 2008

Filed under: Linux, Operating Systems — Brenton Alker @ 01:24

I often find myself performing operations on single column CSV files to perform tasks such as merging member id lists, or email addresses, counting unique entries, finding duplicates etc.

By applying some set theory (remember that from math class) and some standard linux/unix command line tools, almost any operation I have ever wanted to achieve in this vain is possible. And I have found a post, over at Linux By Examples that provides a simple list of operations and examples of how to achieve them on text files using sort and uniq.

post Manually Deliver Email to Maildir

March 14th, 2008

Filed under: Linux, Operating Systems — Brenton Alker @ 11:12

I have, on occasion, had need to manually drop an email into a users inbox. For example, when an over-zealous virus scanner dumps mail into "quarantine".

After confirming that the email are, in fact, virus free, the emails are able to be injected into the users maildir with the help of safecat, which guarantees atomic copying (even from a slow standard input stream) and unique file naming.

The basic format of the command is:

safecat  .Maildir/new/ < msg.eml


with the only restriction being that tmp_dir must be on the same file system, as the algorithm uses hard links to guarantee instant availability of the complete file.

ruldrurd
Powered by WordPress, Web Design by Laurentiu Piron
Entries (RSS) and Comments (RSS)