FilesByWeek is a small script that counts the number of files in a folder that were created (or last modified) in X week of the year. It’s designed for use with Linux/Postfix Maildirs (and thus excludes the standard .Sent folder and any Dovecot/Courier IMAP files from the find query), but should work just fine on any kind of directory.

Get the latest version here. Or, if you just want to see what the fuzz is about:

#!/bin/bash
typeset -i YEAR WEEK COUNT
 
WEEK=$1
# Comment out the following line if the year starts on a Monday
WEEK=$((WEEK-1))
# Use current system year by default. This can be changed to e.g.: YEAR=2008
YEAR=`date +%Y`
TGTDIR=$2
COUNT=0
 
\find ${TGTDIR} \
-type d \( -name "*.sent" -o -name "*.Sent" -o -name "courierimapkeywords" -o -name "courierimaphieracl" \) -prune -o \
-type f \( ! -name "subscriptions" ! -name "courierimapsubscribed" ! -name "dovecot.index.log*" ! -name "dovecot.index" ! -name "maildirfolder" ! -name "dovecot-keywords" ! -name "dovecot.index.cache" ! -name "courierimapacl" ! -name "courierimapuiddb" ! -name "dovecot-uidlist" \) \
-print |
{
    while read FILENAME; do
        if [[ `\date +%Y-%W -r "${FILENAME}"` == ${YEAR}-${WEEK} ]]; then
            # Uncomment to show the names of matching files
            # echo ${FILENAME}
            let COUNT++
        fi
    done
 
    echo Week $1 -- ${TGTDIR}: ${COUNT}
}
 
exit 0

{ 0 comments }

Erik Naggum, R.I.P

June 21, 2009

I didn’t know Erik, but after reading his critique of XML and one of his emails, I’m sure I would’ve liked to.

if you know what other people should have done in the past, you never have any clue what you or anyone else ought to do in the future, and if you are concerned with what you yourself ought to do in the future, you generally leave other people alone to figure out what they ought to do in the future, too.

people who partition the world population into “the good” and “the bad” always make the mistake of believing that they fall into the “the good” partition.

I keep telling people that you only really grow up and become a human being (as opposed to a mere animal) when you realize that most of what you think and almost all you feel is wrong.

Update: More by Erik Naggum.

{ 0 comments }

Surprise, the warrant that was issued for a college student’s stuff on the basis that he was using an operating system with “white font on a black screen” has been thrown out, as no probable cause existed.

On May 21, 2009, Justice Botsford of the Supreme Judicial Court of Massachusetts granted our client Riccardo Calixte’s motion to quash the illegal search warrant with which it seized Calixte’s computers, phones, ipods, camera and other personal property. Not only is this an enormous victory for Calixte himself, but the ruling is also the highest state court opinion to repudiate the nascent law enforcement “trend” of charging internet users who violate websites’ terms of service as criminals. (Case page with background documents here.)

{ 0 comments }

Interesting automated software test system concept. The goal is to design this for the Linux kernel, but it should be very useful in other regards as well.

{ 0 comments }

Help, it’s white font on a black screen

April 14, 2009

On Friday, EFF and the law firm of Fish and Richardson filed an emergency motion to quash and for the return of seized property on behalf of a Boston College computer science student whose computers, cell phone, and other property were seized as part of an investigation into who sent an e-mail to a school [...]

1 comment Read the full article →

Death to the Space Infidels!

April 13, 2009

Interesting piece by Jeff Atwood on spaces versus tabs in code. I specifically enjoyed the reference to Whitespace and thank Jeff for introducing me to such a wonderful programming language. Out you go, Python.

0 comments Read the full article →

Elevated by Rgba and TBC

April 13, 2009

Procedurally generated landscape flyby demo with impressive graphics and audio, and oh yeah — a total size of four kilobytes! Absolutely mind-blowing. You can run the original 4kb demo application (Windows) yourself if you have a powerful machine.
When you’re watching the flyby, keep in mind that it’s 41 times smaller than Notepad and 625 times [...]

0 comments Read the full article →

Why is programming fun?

April 13, 2009

This is an extract from Fred Brooks’ (Frederick P. Brooks, Jr.) book, The Mythical Man-Month. This is one of the best explanations of why programming is so interesting. It touches on all aspects of the mystique of programming. If you haven’t read the book, go out, buy it, and read it. The book was first [...]

0 comments Read the full article →

Malzilla – Malware Hunting Tool

April 12, 2009

Very good JavaScript deobfuscator for Windows. Especially useful for decoding packer functions. Example screenshot here.

0 comments Read the full article →

Conficker: The Neverending Story

April 12, 2009

Looks like Conficker (Kido, Downadup, etc.) finally decided to get nasty. I’m already noticing a significant increase in spam on my accounts (good thing I have a proper spam filter) and “Spyware Protect 2009″ and its bastard siblings have got to be the most irritating pieces of software on the planet.
You can check if your [...]

0 comments Read the full article →