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/local/bin/perl | |
| # DoS tool for memcached | |
| # ulimit -n 15000; perl memcachedos.pl 127.0.0.1 11211 3 | |
| # original: http://gist.github.com/522741 | |
| # This is Public Domain Software | |
| use strict; | |
| use warnings; | |
| use AnyEvent; |
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
| # vim: ft=perl: | |
| use strict; | |
| use warnings; | |
| use Plack::Builder; | |
| use Plack::App::WrapCGI; | |
| use Plack::App::URLMap; | |
| builder { | |
| enable 'Static', |
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
| diff --git a/lib/Starman/InputStream.pm b/lib/Starman/InputStream.pm | |
| new file mode 100644 | |
| index 0000000..e0cfc38 | |
| --- /dev/null | |
| +++ b/lib/Starman/InputStream.pm | |
| @@ -0,0 +1,121 @@ | |
| +use strict; | |
| +use warnings; | |
| + | |
| +# ----------------------------------- |
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
| =head1 NAME | |
| Plack::Loader - (auto)load PSGI/Plack Servers | |
| =head1 SYNOPSIS | |
| #!/usr/bin/env perl | |
| # printenv-like app in PSGI, F?CGI, AnyEvent, Coro, POE or Danga::Socket | |
| use strict; | |
| use warnings; |
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 Data::Dumper; | |
| my @r; | |
| my $text = q{@hoge http://example.com/#@hoge/ aaa #hash aaa @hogehoge aaa http://example.com/}; | |
| my $re = qr{(http://[A-Za-z0-9_\-\~\.\%\?\#\@/]+(?{push @r, ["HTTP", @-,@+] })|(?:^|\s)\@[A-Za-z0-9_]+(?{push @r,["AT", @-,@+]})|(?:^|\s)#[A-Za-z0-9_]+(?{push @r,["HashTag",@-,@+]}))}; | |
| warn $text; | |
| () = $text =~/$re/g; | |
| warn Dumper @r; |
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; | |
| my $input = shift or die "Usage: $0 Masayoshi"; | |
| my %phoetic_alphabet; | |
| while(<DATA>) { | |
| chomp; | |
| my ($letter, $word) = split(/\s+/, $_, 2); |
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
| require 'rubygems' | |
| require 'mongo' | |
| module MongoPubSub | |
| QUEUES_COLLECTION = 'queues' | |
| class EndSubscriptionException < Exception; end | |
| class Publisher | |
| def initialize(queue_name, mongo_connection) | |
| # Initialize queue collection as a capped collection | |
| if not mongo_connection[QUEUES_COLLECTION].collection_names.include?(queue_name) |
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 Pod::Usage; | |
| use Text::Markdown 'markdown'; | |
| use HTML::TreeBuilder; | |
| use List::Util 'max'; |
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
| <div id="post-assets"></div> | |
| <div class="module-header" id="loading-more-assets"><img src="http://static.typepad.com/.shared:v20110208.01-0-gebb190b:typepad:en_us/images/spinner.gif"/></div> | |
| <style> | |
| .entry-content { | |
| border-bottom: solid 1px #CCC; | |
| padding-bottom: 10px; | |
| margin-bottom: 10px; | |
| padding-top: 10px; | |
| } |
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 File::Basename; | |
| use Plack::Builder; | |
| use Plack::App::CGIBin; | |
| my $basedir = dirname(__FILE__); |