Just hacked up this little script to do the needful:
Categories: Computers, Perl, Programming
Tagged: dns, pattern matching, perl, programming, work
Just hacked up this little script to do the needful:
Categories: Computers, Perl, Programming
Tagged: dns, pattern matching, perl, programming, work
It’s super easy:
#/usr/bin/perl
use strict;
use Digest::MD5 qw( md5_hex );
my $email = shift || die("Please provide email address\n");
my $hash = md5_hex lc($email);
print "http://gravatar.com/avatar/${hash}.jpg\n";
I use them at work for showing tooltip displays upon email receipt etc. They’re fun and handy to add to any little application.
Categories: Perl
Tagged: email, perl, programming
We only run linux at home, but my kids have a few game titles that I’ve stored (err, protected) on disk as ISO files. It’s a real PITA to write down the command line options for my wife to execute when they feel like playing a game, so I’ve thrown together a few quick [...]
Categories: Computers, Perl, Programming, UNIX
Hacked together a little ACL package for creating dynamic ACLs based on a few simple ideas:
Sys-Admins like Perl style Regex
Must be versatile enough to handle many types of applications
Should be robust enough to handle auto-generated ACLs
I was sitting at $WORK, thinking of a way to restrict access to certain API calls from a shared script. [...]
Tagged: ACL, pattern matching, perl, programming, unix, work
In my last post, I spoke about tools to prettify vim and perl. Today I’m trying to tackle the problem of fat fingers when refactoring Perl code in VIM.
I’m always on the lookout for refactoring tools for VIM and Perl. Today I found APP::EditorTools which allows you to rename variables etc.
The power of [...]
Categories: Perl, Programming
Tagged: perl, programming, vim
At $WORK I programme mostly in Perl, using VIM as my primary editor. In order to make my life a little easier when it comes to looking at the sometimes horribly ugly syntax of Perl, and to ensure that I maintain a consistent style, I use Perltidy and a little VIM hackery to get the [...]
Categories: Computers, Perl, Programming, UNIX
Tagged: programming, vim, work
Many people don’t do this, but whenever you’re working with files that can be touched by multiple processes, be sure to lock those files!
#!/usr/bin/perl -w
use strict;
use Fcntl qw(:DEFAULT :flock);
my $filename = ‘/tmp/test_lock_file’;
open FD, "<$filename" or die( "Cannot open $filename: $!\n" );
unless( flock( FD, LOCK_EX | LOCK_NB ) ){
[...]
Categories: Perl
Tagged: perl, programming
I maintain all of the private keys and certs for work, and one of the things that makes my life a lot easier is when I receive a CRT back from GeoTrust, and I want to ensure that the CRT indeed came from the supplied CSR, which indeed was generated from my private KEY.
I use [...]
Tagged: perl, programming, unix, work
I’ve just written two simple little scripts to check if your outbound relays are on any known blacklists.
The first script “spf_lookup.pl” is used to extract CIDR ranges from a domains SPF record. This output is used to drive the rbl lookups of our next script.
The second part is our “rbllookup_async.pl” script, which checks a series [...]
Categories: Email, Perl, Programming, UNIX