Software Page

I have not done any complete work for some time. The last main projects I did were for the N900 and Maemo OS. I host a Blog where I put random tidbits of knowledge I come across, but that only see's an update about once a year.

I will update this page as I figure out what to do with it, either with code or other project downloads.

Helpful code

I have realized over time when dealing with exceedingly large numbers (hundreds of thousands to millions) of files in directories, perl is far more efficient and returns faster than standard shell commands like LS and RM, largely because of the fact that perl does not need to grab the stat() of the file before performing an operation like unlink(). Because of that, I wrote some helpful perl one-liners intended to be run on a shell to replace some simple scripts.

Count all files in a directory (eq: ls -l | wc -l)

perl -le 'opendir D, "."; print scalar((@files=readdir D)); closedir D;'

Delete files, exclude certain names (eq: ls | egrep '^backup' | xargs rm -f)

perl -e 'opendir D, "."; @files = readdir D; closedir D; @new_files = grep { /^backup/ } @files; undef @files; unlink(@new_files);'