Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl -w
use strict;
use Fcntl qw(:DEFAULT :flock );
use Getopt::Std;
sub usage {
print <<USAGE
Usage:
SCRIPT.pl -f LOCKFILE
#!/usr/bin/perl
use strict;
use Net::DNS::Async;
use NetAddr::IP;
# rbllookup_async.pl - Thu Aug 20 13:13:35 EDT 2009
#
# Author: pblair(at)tucows(dot)com
# Updated: Thu Aug 20 13:14:14 EDT 2009
#
#!/usr/bin/perl
#
# Simple script to extract certain parts of a SPF record
# and send those addresses out the the stdoutput.
#
# Useful for integrating into other scripts
#
# Author: pblair(at)tucows(dot)comt
# Updated: Mon Nov 30 10:41:16 EST 2009
#
#!/usr/bin/perl
#
# Attempt to match modulus of SSL CERTs/KEYs/CSRs
#
# author: pblair(AT)tucows(dot)com
# updated: Fri Aug 28 09:47:10 EDT 2009
my( $KEY,$CRT,$CSR );
for my $key ( @ARGV ){
#!/usr/bin/perl
#
# Little application to retrieve the certficate from a remote
# system, and check the expiry date of that cert against the
# time of the local system.
#
# Author: pblair(at)tucows(dot)com
# Last Modified: Tue Sep 1 10:19:20 EDT 2009
#
use strict;
/(a?dsl|dhcp|dyn(amic)?|ppp)?.+?([.-][0-9]{1,3}){4}.+?(a?dsl|dhcp|dyn(amic)?|ppp)?/ REJECT No connection from dynamic space
/(^a?dsl|a?dsl(\.|-)|(\.|-)a?dsl|(\.|-)d(yn|ip|ial)(\.|-)|(\.|-)cable(\.|-)|(\.|-)user(\.|-)|^dynamic|(\.|-)dynamic|dynamic(\.|-)|(\.|-)ppp(oe)?(\.|-|)|^ppp)/ REJECT No connection from dynamic space
#include<opendkim/dkim.h>
#include<assert.h>
#include<stdio.h>
#include<string.h>
#include<memory.h>
#include<malloc.h>
// Test the init
static void *init() {
return (dkim_init(NULL, NULL));
#!/usr/bin/perl
use threads;
use Thread::Queue;
my $TC = 50; # Thread Count
my $q = new Thread::Queue;
my $q_print = new Thread::Queue;
# Read all of the input work
while (<>) {
#!/usr/bin/perl
use Net::CIDR::Lite;
use Getopt::Std;
my %options=();
my $cidr = Net::CIDR::Lite->new;
getopts("n:f:",\%options);
if( defined $options{f} ){
#!/usr/bin/perl
# Finds all of the Received: lines in an email and spits out the
# epoch of each parsed line
use strict;
use Time::ParseDate; # libtime-modules-perl
while( <> ){
chomp;
last if /^$/;
next unless /^Received:/;