Skip to content

Instantly share code, notes, and snippets.

View thowe's full-sized avatar

Tim Howe thowe

View GitHub Profile
#!/usr/bin/env raku
use DB::Pg;
sub MAIN( Str $file = 'default.txt',
Str :$host = '',
Str :$username = '',
Str :$password = '',
Str :$database = '', ) {
#!/usr/bin/env perl
use Mojo::Base -strict;
use Mojo::UserAgent;
use Getopt::Long;
#edit these to your data
my $api_key = 'fffffff-ffff-ffff-ffff-fffffffff';
my $id = 'libd_id_0000';
my $tn;
@thowe
thowe / get_interfaces.pl
Created November 1, 2017 23:36
find interfaces and output Nagios config
#!/usr/bin/env perl
#
use 5.010;
use strict;
use warnings;
use Net::SNMP;
use Getopt::Long;
use List::MoreUtils qw(firstidx);
-- getting a list of tables
select d.datname as name from pg_catalog.pg_database d
WHERE d.datname != 'template1' AND d.datname != 'template0'
AND d.datname != 'postgres';
@thowe
thowe / thfilter.pl
Created November 22, 2014 18:01
simple Email::Filter example
#!/usr/bin/env perl
#
# Only forward certain messages to some additional users.
#
# For postfix, you need a transport entry. For example in
# /etc/postfix/transport a line like:
# thfilter.example.com thfilter:
#
# Then you would also need an entry in master.cf like so:
# thfilter unix - n n - - pipe
@thowe
thowe / block_test1
Last active August 29, 2015 14:04
Can't call a block within a block, how to recurse? Updated with working example
#!/usr/bin/env perl
use Mojolicious::Lite;
# Documentation browser under "/perldoc"
#plugin 'PODRenderer';
get '/' => sub {
my $c = shift;
my $thing = [ { 'name' => 'Parent',