saving time by spending time

domm on 2005-01-11T20:50:59

During the holidays I finally took the time to implement some time-savers:

  • fetchattach.pl: I read my mail using mutt, which running at a machine in the office. Most of the time I'm working from home. Everthing's fine, except if I have to view an attachment. Previously, I had to save the file to my office machine, remember the filename (or fiddle around with the mouse to copy it) and issue a longish scp command (hopefully with the correct filename / the filename still in the paste buffer) :
    scp domm2.zsi.at:~/somefile.bar . 
    The whole procedure takes about 30 seconds.
    Thats about 20 characters. So I wrote a small script using Net::SHH and NET::SCP that looks into a special folder on my office machine, downloads everything from this folder into cwd and deletes the files from the special folder. It's about 300 characters long, and I probably typed twice as much due to debugging etc. It took me about 30 minutes. So, my investment will pay off after aprox 60 downloads, or about 2 months (at one attachment a day, which is aproximitly the amount I get). (Uhm, writing about it now probably cost me another month, or the other way round, I get a 'free' journal entry every month)

  • marking SPAM as read: I get all spams caught by spamassasin delivered into one maildir called Spam (surprisingly..). Previously, I opened the folder up in the morning, at hit CTL-r until all mails where marked read (so they'll be moved to an archive folder by another script I wrote some time ago..). That was annoying. So I took some time to study some manpages and did a bit of googling to discover:
    SHIFT-t new
    ;w r
    Tag all new mail, set all tagged mail to read.
    Easy, saves another minute a day...

  • TODO: Script to remove spam from mailinglist I admin: I assume this will mean some screenscraping and fiddling with cookies.


That last script actually exists...

BooK on 2005-01-12T00:00:22

...but I never took the time to post it on CPAN.

I wrote it because clicking through 60+ spam a day in the only mailing-list I lazily admin is too much for me. So I wrote the script as an example in my series of articles (in French) about LWP and friends: LWP, Avanced LWP stuff and WWW::Mechanize.

The script you want is section 3 of the third article: Un exemple pas à pas : le formulaire de Mailman.

I'd have put it on CPAN, but then I'd have to maintain it, add useful features like interactive selection of the few non-spam mails, etc. Let me know if you think it's worth the extra work.

Re:That last script actually exists...

domm on 2005-01-14T08:04:28

Oh, great. I'll give it a try and report back to you.

One funny thing: Contrary to your intended audience I need the Perl code to make sense of your (french) writing (as I don't speak french) ...