Skip to content

Instantly share code, notes, and snippets.

www.richardharman.com 3
digg.com 2
www.digg.com 1
$tree = bless( {
'root' => {
'.' => {},
'com' => {
'digg' => {
'www' => {
'.' => {
@warewolf
warewolf / gist:1307531
Created October 23, 2011 16:08
Net::DNS::Resolver::Programmable
#!/usr/bin/perl
# vim: foldmethod=marker filetype=perl ts=4 sw=2
use strict;
use warnings;
use Net::DNS::Nameserver;
use Net::DNS::Resolver::Programmable;
use Net::DNS::Resolver;
@warewolf
warewolf / Other commands
Created November 13, 2011 18:27
new processes started in procmon log file
$ ./procmon ~/logfile.xml
Too few arguments
Usage:
procmon procmon.xml [commands] [arguments]
Commands:
xpath:
Search with a freeform XPath expression.
xpath --expression="/xpath/node[criteria='selection']"
@warewolf
warewolf / tivo2avi.pl
Created November 23, 2011 15:17
tivo2avi
#!/usr/bin/env perl
use strict;
use warnings;
while (my $in_file = shift @ARGV)
{
my $out_file = $in_file;
$out_file =~ s/tivo$/avi/i;
unlink("divx2pass.log");
foreach my $pass (qw(1 2 3)) {
@warewolf
warewolf / gist:1394584
Created November 25, 2011 22:37
unsticking firefox
(gdb) bt
#0 0x00c1f673 in js::Interpret (cx=0xb759c360, entryFrame=0xb35fe038, interpMode=js::JSINTERP_NORMAL)
at /usr/src/debug/xulrunner-8.0/mozilla-release/js/src/jsinterp.cpp:3515
#1 0x00c2a69c in js::Invoke (cx=0xb759c360, argsRef=..., construct=js::NO_CONSTRUCT)
at /usr/src/debug/xulrunner-8.0/mozilla-release/js/src/jsinterp.cpp:687
#2 0x00c2ad9c in Invoke (construct=js::NO_CONSTRUCT, args=..., cx=0xb759c360)
at /usr/src/debug/xulrunner-8.0/mozilla-release/js/src/jsinterp.h:169
#3 js::ExternalInvoke (cx=0xb759c360, thisv=..., fval=..., argc=3, argv=0xbf9a08ec, rval=0xbf9a07d0)
at /usr/src/debug/xulrunner-8.0/mozilla-release/js/src/jsinterp.cpp:809
#4 0x00b9f1d3 in JS_CallFunctionValue (cx=0xb759c360, obj=0xb198b3a0, fval=18446743556998087896, argc=3, argv=0xbf9a08ec, rval=0xbf9a07d0)
#!/usr/bin/perl
# vim: foldmethod=marker sw=2 commentstring=\ #\ %s
use strict;
use warnings;
use Getopt::Long;
use Pod::Usage;
use XML::LibXML;
#use Carp::Always;
use Sys::Virt;
@warewolf
warewolf / parsebmp.pl
Created May 10, 2012 02:42
perl reading bmp
#!/usr/bin/perl
use strict;
use warnings;
use Data::ParseBinary;
use Data::ParseBinary::Graphics::BMP qw{$bmp_parser};
use Data::Dumper;
my $filename = shift @ARGV;
@warewolf
warewolf / gist:2650815
Created May 10, 2012 03:15
string 2 numbers
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
# my $string = this OR that
my $string = shift @ARGV || "hello";
# split(m//,$string) says "split apart each individual character"
$ ./dhcpdb_search.pl
Search mode required, mac, hostname, or IP
Usage:
dhcpdb_search.pl [options] [search_criteria] [date_criteria]
Options:
-help brief help message
-man full documentation
Output formatting:
@warewolf
warewolf / gist:3285790
Created August 7, 2012 14:25
perl mail mangling
#!/usr/bin/perl
use MIME::Parser;
my $parser = new MIME::Parser;
my ($msg,$entity,$header,$head,%email);
open (MESSAGE,"<$ARGV[0]");
while (<MESSAGE>) { push (@{$msg},$_) };
close MESSAGE;