Category : PERL snippets


gron transforms JSON into discrete assignments to make it easier to grep for what you want and see the absolute ‘path’ to it. It eases the exploration of APIs that return large blobs of JSON but have terrible documentation. ▶ gron “https://api.github.com/repos/tomnomnom/gron/commits?per_page=1” | fgrep “commit.author” json[0].commit.author = {}; json[0].commit.author.date = “2016-07-02T10:51:21Z”; json[0].commit.author.email = “mail@tomnomnom.com”; json[0].commit.author.name ..

Read more


Traverses all integer columns checking for capacity limits. #!/usr/bin/env perl #use 5.010; #use strict; #use warnings; # Richard L. Byrd, written sometime in the 90s and improved bit by bit over the next 20 years # # 2009-01-27: While originally written to take a configfile input on the CLI (–configfile=xxxxx.cfg) I’ve hacked # that out ..

Read more


This is a simple script that interactively converts an IP address to its decimal equivalent. This can sometimes be used to bypass web content filtering devices as not all will convert the decimal to an IP and then a hostname. #!/usr/bin/perl # # prompt for an IP print “Enter an IP Address: “; # get ..

Read more


Quickie to add a semicolon to end of non-commented lines (useful paired with the SHOW GRANTS bash script) #!/usr/bin/perl — open DATA, “$ARGV[0]”; while () { $liner=$_; if (“$liner” =~ /^#/) { print $liner; } else { chomp($liner); print “$liner” . “;n”; } } c..

Read more