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/perl -w | |
use strict; | |
use Data::Dumper; | |
use YAML; | |
use FindBin qw/$Bin/; | |
use Net::Telnet::Cisco; | |
++$|; | |
umask 012; | |
$0 =~ s{.*/}{}; |
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/perl | |
use common::sense; | |
use Text::Password::Pronounceable; | |
printf "%s\n", Text::Password::Pronounceable->generate(6,10); |
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
--- gvrpad.c 2007-06-12 04:28:04.000000000 +0400 | |
+++ gvrpad.c.orig 2010-06-21 12:21:54.000000000 +0400 | |
@@ -417,6 +417,7 @@ | |
int exclude = 0; | |
int interval = 0; | |
int leaveint = 0; | |
+ ether_addr addr; | |
FILE *f; | |
/* |
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
package MyMail; | |
use common::sense; | |
use MIME::Lite; | |
use MIME::Words qw(:all); | |
use Data::Dumper; | |
use Carp qw(croak); | |
sub _defaults { |
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/perl | |
use Mojo::Client; | |
BEGIN { | |
my %nano; | |
my %mktk; | |
my %failed; | |
} | |
my $client = Mojo::Client->new; |
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
any '/fast-ping' => sub { | |
my $self = shift; | |
my $request = $self->req->json || return $self->render_json( { 'status' => 'Request error' } ); | |
my $remote_addr = $self->tx->remote_address; | |
app->log->info("$remote_addr requested ".Dumper($request)); | |
my $prefix = $request->{'prefix'}; | |
return $self->render_json( { 'status' => 'Have no network prefix in request, nothing to do!' } ) unless $prefix; |
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/perl | |
use strict; | |
use warnings; | |
use POE qw(Wheel::Run Filter::Reference); | |
sub MAX_CONCURRENT_TASKS () { 25 } | |
use Net::Netmask; | |
use Data::Dumper; |
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 Mojolicious::Lite; | |
use Mojo::ByteStream 'b'; | |
use Mojo::JSON; | |
use utf8; | |
... | |
our $dbh = DBI->connect("dbi:mysql:dbname=cli;host=localhost", |
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 Mojo::ByteStream 'b'; | |
... | |
$rows = $dbh->selectall_arrayref(q{ .. }); | |
# Decode bytestream to string for each item in arrays | |
grep { grep { $_ = b($_)->decode('UTF-8') } @$_ } grep { $_ } @$rows ; |
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/perl | |
use DBI; | |
our $dbh = DBI->connect("dbi:mysql:dbname=mydb;host=localhost", | |
'user', 'pass', | |
{ PrintError => 0, RaiseError => 1, mysql_enable_utf8 => 1 }); | |
for (@{ $dbh->selectall_arrayref(q{ | |
SHOW VARIABLES LIKE 'character\_set\_%' }) } ) { |
OlderNewer