This file contains 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
$ java -version | |
openjdk version "1.8.0_131" | |
OpenJDK Runtime Environment (build 1.8.0_131-b12) | |
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode) | |
Rundeck 2.8.4-1 | |
2017-07-28 19:43:16,399 [grailsTopicExecutor-3] WARN org.grails.plugin.platform | |
.events.registry.DefaultEventsRegistry - Failing call to class rundeck.services. | |
ExecutionEventsService.executionComplete with args rundeck.services.events.Execu |
This file contains 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; | |
my @op = ('+', '-', ''); | |
for my $i (0..3**8-1) { | |
my $str = "1"; | |
for my $k (0 .. 7) { | |
$str .= $op[($i/(3**$k)) % 3].($k+2); |
This file contains 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 Modern::Perl; | |
my $Skip_re = undef; | |
for my $tn (1234567890, 2223334444, 3838383838 ) { | |
say +(defined $Skip_re && $tn =~ /$Skip_re/ .. $tn =~ /not a tn/)?"yes":"no"; | |
next unless ((defined $Skip_re && $tn =~ /$Skip_re/) .. $tn =~ /not a tn/); | |
say "after next $tn"; | |
} | |
say "after loop"; |
This file contains 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
#!/bin/bash | |
docker ps -q | | |
xargs docker inspect | | |
perl -MJSON -E ' | |
undef $\; | |
$x = decode_json <>; | |
say $_->{NetworkSettings}{IPAddress} for (@$x)' |
This file contains 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
#!/bin/bash | |
echo "Content-Type: text/plain" | |
echo | |
exec 2>&1 | |
set -x | |
env | |
ifconfig | |
uptime |
This file contains 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
while ( <DATA> ){ | |
if (/start/ .. /end/) { | |
print "flip flop true: $_"; | |
} | |
else { | |
print "flip flop false: $_"; | |
} | |
} | |
__END__ |
This file contains 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::XS; | |
use autodie; | |
my %alpha = qw( | |
A Alfa | |
B Bravo | |
C Charlie | |
D Delta |
This file contains 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
scpan () { | |
u=`perl -MURI::Escape -wle 'print "http://metacpan.org/search?q=". | |
uri_escape(join " ", @ARGV)' $@` | |
/usr/bin/w3m -no-mouse -F $u | |
} |
This file contains 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 Mojo::JSON::Pointer; | |
my $pointer = Mojo::JSON::Pointer->new({foo => [23, 'bar']}); | |
say $pointer->get('/foo/1'); | |
say 'Contains "/foo".' if $pointer->contains('/foo'); | |
__END__ |
This file contains 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 Time::Piece; | |
my $ts = Time::Piece->strptime( | |
'Thu Apr 17 20:51:48 UTC 2014', | |
'%a %b %d %T %Z %Y', | |
); | |
say $ts->epoch; |
NewerOlder