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 | |
# "pflog" enhancement for parsing maillog of postfix 2.3 or higher version. | |
# "pflog" see: http://www.tmtm.org/ruby/pflog/pflog-0.3 | |
use strict; | |
use warnings; | |
use Time::Local; | |
use Getopt::Long; | |
#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
#!/bin/bash | |
# Usage: | |
# # crontab: need to run some-command at end-of-month. | |
# 0 15 28-31 * * end-of-month.sh && some-command | |
set -o errexit | |
arg=$1 | |
if [ $(date +%m -d "$arg tomorrow" ) != $(date +%m -d "$arg" ) ] ; then | |
exit 0; |
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 | |
# written by @xtetsuji at 2012/02/04 | |
use v5.10; | |
use strict; | |
use warnings; | |
use utf8; | |
use IO::Handle; | |
use Encode; |
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
# -*- cperl -*- | |
# ogata 2012/07/22 | |
# ogata 2012/07/27 | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use Scalar::Util qw(reftype readonly); |
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 MyApache2::Hello2; | |
use strict; | |
use warnings; | |
use Apache2::RequestRec; | |
use Apache2::RequestIO; | |
use Apache2::Const -compile => qw(OK); | |
use MyApache2::Sinatratic; |
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 | |
# ogata 2012/08/07 | |
# perl map syntax implement by perl itself without using CORE::map. | |
sub map2 (&@) { | |
my $code = shift; | |
my @args = @_; | |
require Scalar::Util; | |
my $type = Scalar::Util::reftype($code); | |
unless($type and $type eq 'CODE') { |
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 | |
# require: factor | |
# note: Debian coreutils includes factor command and using it first setup. | |
for((i=1;;i++)) ; do factor $i | grep -E '^[0-9]+: [0-9]+$' >/dev/null 2>&1 && echo 'JOJO!' || echo $i ; sleep 1 ; done |
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 | |
# ogata 2012/08/28 | |
# Show almost every Apache2::Const having constants. | |
use strict; | |
use warnings; | |
use Apache2::Const -compile => qw( | |
:cmd_how | |
:common |
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 strict; | |
use warnings; | |
use utf8; | |
use Encode; | |
use LWP::UserAgent; | |
use Web::Scraper; | |
binmode STDOUT, ':utf8'; |
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 | |
# Emulate __DATA__ section for mod_perl Registry/PerlRun script, and so on. | |
use strict; | |
use warnings; | |
### In tail of this file, its "data" exists and defines inside BEGIN { ... } block. | |
my $DATA; | |
open \*DATA, '<', \$DATA; |
OlderNewer