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
# for perl | |
my @allowd_tags = qw/redpre pre code notextile/; | |
my $str = '<html><body> <p><pre>fufufu</pre></p> </body></html>'; | |
$str =~ | |
s{<(\/?([!\w]+)[^<>\n]*)(>?)} | |
{ | |
if(grep /^$2$/ , @allowd_tags ){ | |
"<$1$3"; | |
}else{ |
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 strict; | |
use warnings; | |
use Getopt::Long qw/GetOptions :config auto_help/; | |
use Config::Pit; | |
use Net::Amazon::EC2; | |
use Term::ReadLine; | |
# デフォルト値の設定 | |
my $pitname = 'aws_info'; |
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 strict; | |
use warnings; | |
use Encode qw /encode_utf8 decode_utf8 from_to/; | |
use AnyEvent::Cron; | |
use AnyEvent::IRC::Client; | |
use Data::Dumper; | |
use Web::Scraper; | |
use URI; | |
use 5.10.0; |
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 strict; | |
use lib; | |
use Time::Piece; | |
use Calendar::Japanese::Business; | |
my $c = Calendar::Japanese::Business->new; | |
use Getopt::Long qw/GetOptions :config auto_help/; | |
my $work_day; |
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/perl -w | |
# -*- cperl -*- | |
=head1 NAME | |
plack_status - Munin plugin to show the connection status for plack | |
=encoding utf8 | |
=head1 APPLICABLE SYSTEMS |
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 strict; | |
use warnings; | |
use Benchmark qw(timethese cmpthese); | |
my $count = shift || 1; | |
my $message = 'Blah, blah'; | |
#perl -MV=Log::Dispatch,Log::Handler,Log::Log4perl,Log::Minimal | |
######## Log::Dispatch |
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
# perlversion = 5.14.1 | |
# Text::Xslate = 1.3000 | |
use strict; | |
use Text::Xslate; | |
my $tx = Text::Xslate->new(); | |
my %vars = ( | |
title => 'A list of books', |
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 strict; | |
use Scrappy; | |
my $s = Scrappy->new; | |
# 1秒間隔でクロール | |
$s->pause(1); | |
# クロール実行 | |
$s->crawl('http://f.hatena.ne.jp/hotfoto', | |
# 1. root |
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 strict; | |
use Scrappy; | |
my $s = Scrappy->new; | |
# 1秒間隔でクロール | |
$s->pause(1); | |
# ファイルにログを保存 | |
$s->logger->file('scrappy.log'); | |
# クロール実行 |
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/perl | |
use strict; | |
use warnings; | |
use Linux::Smaps; | |
my $proc_name = 'plackup';#shift or die "usage: $0 PROC_NAME"; | |
my $proc_list = `ps ax|grep $proc_name` || ''; | |
my @pid_list; |