This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
#my $basedir = "/home/cfedde/src/"; | |
my $basedir = "/var/www/mojo/"; | |
plugin 'Config'; | |
plugin Mount => ( '/lrn' => "$basedir/lrn_perl_webservice/lrn_query" ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Modern::Perl; | |
use BCV::DB; | |
use Search::Elasticsearch; | |
use JSON; | |
my $DB = BCV::DB->new($ENV{BOOTLOGDB}//'BCVcore'); | |
my $e = Search::Elasticsearch->new( nodes => 'bcvdb02:9200' ); | |
my $index = 'crfbootlogdata'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Modern::Perl; | |
use YAML; | |
my $line = "08/15/2013, 15:58:47: (1234-567890) Changes made: Service end changed to 9999-12-31 (was 2013-10-12), Payment end changed to 9999-12-31 (was 2013-09-15), Renewal changed to 2013-09-12 (was 9999-12-31), srvid#=33324 modified by: Someguy Testuser (TST)"; | |
my $re = qr|(?x) | |
(?<date> \d+/\d+/\d+),\s+ | |
(?<time> \d+:\d+:\d+):\s+ | |
\( (?<acct> \d+-\d+) \) \s+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/bcv/bin/perl | |
use Mojolicious::Lite; | |
plugin 'basic_auth'; | |
get '/' => sub { | |
my $self = shift; | |
return $self->render_text('ok') | |
if $self->basic_auth( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/bcv/bin/perl | |
use Modern::Perl; | |
use XML::Compile::WSDL11; # use WSDL version 1.1 | |
use XML::Compile::SOAP12; | |
system 'wget -O - http://www.webservicex.com/globalweather.asmx?WSDL > globalweather.wsdl'; | |
my $wsdl = XML::Compile::WSDL11->new('globalweather.wsdl'); | |
say for ($wsdl->operations()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use Modern::Perl; | |
use YAML; | |
local $/; | |
my %hash = <DATA> =~ /(\w+)\s=\s(\w+)/g; | |
say Dump \%hash; | |
__END__ | |
this = that | |
some = stuff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Fcntl ':flock'; # import LOCK_* constants | |
unless ( flock DATA, LOCK_EX | LOCK_NB ) { | |
print STDERR "Found duplicate script run. Stopping\n"; | |
exit(0); | |
} | |
... | |
__DATA__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
explain analyze | |
select to_char(count(bucket)/60.00, '999.99') as cps, | |
max(max_loss) as max_loss, bucket from summary_5_minute_device_sn | |
group by bucket | |
order by bucket; | |
QUERY PLAN | |
-------------------------------------------------------------------------------------------------------------------------------------------------------- | |
Sort (cost=2063766.71..2063793.82 rows=10844 width=12) (actual time=31076.144..31079.901 rows=24264 loops=1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/me/bin/perl | |
use strict; | |
use warnings; | |
use CGI; | |
use CGI::Carp qw(fatalsToBrowser); | |
use Data::Dumper; | |
print "Content-Type: text/html\n\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone [email protected]:ingydotnet/example-bash.git | |
Cloning into 'example-bash'... | |
X11 forwarding request failed on channel 0 | |
remote: Counting objects: 17, done. | |
remote: Compressing objects: 100% (13/13), done. | |
remote: Total 17 (delta 2), reused 17 (delta 2) | |
Receiving objects: 100% (17/17), done. | |
Resolving deltas: 100% (2/2), done. | |
18:26:25 cfedde@files:~ | |
$ cd example-bash/ |