Skip to content

Instantly share code, notes, and snippets.

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;
+
+# -----------------------------------
# vim: ft=perl:
use strict;
use warnings;
use Plack::Builder;
use Plack::App::WrapCGI;
use Plack::App::URLMap;
builder {
enable 'Static',
@mala
mala / memcachedos.pl
Created August 13, 2010 11:49
DoS for memcached
#!/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;
package Plack::Middleware::Random;
use strict;
use warnings;
use parent qw(Plack::Middleware);
use POSIX qw(floor);
my $known_requests = [];
sub call {
#!/usr/bin/perl
use strict;
use warnings;
use MozRepl;
use Net::Pcap::Easy;
my ($ustream_url, $file, $stop, $device) = @ARGV;
my $usage = <<USAGE;
package Plack::Middleware::Parallel::Scoreboard;
use strict;
use warnings;
use parent qw(Plack::Middleware);
use Plack::Util::Accessor qw(board base_dir path);
use Parallel::Scoreboard;
our $VERSION = '0.01';
sub prepare_app {
my $self = shift;
#!/usr/bin/env perl
use strict;
use warnings;
# Usage: cpan-outdated -v | diffchanges.pl
use LWP::UserAgent;
use Algorithm::Diff;
my $ua = LWP::UserAgent->new;
from google.appengine.ext import webapp
def _adjust_path_info(script_path, environ):
if environ["PATH_INFO"].startswith(script_path):
environ["SCRIPT_NAME"] += script_path
environ["PATH_INFO"] = environ["PATH_INFO"][len(script_path):]
def as_handler(wsgi):
class WSGIHandler(webapp.RequestHandler):
diff --git a/lib/Plack/App/WrapCGI.pm b/lib/Plack/App/WrapCGI.pm
index 7f0a7a7..925b2e9 100644
--- a/lib/Plack/App/WrapCGI.pm
+++ b/lib/Plack/App/WrapCGI.pm
@@ -2,7 +2,7 @@ package Plack::App::WrapCGI;
use strict;
use warnings;
use parent qw(Plack::Component);
-use Plack::Util::Accessor qw(script _app);
+use Plack::Util::Accessor qw(script run_on_shell _app);
@uasi
uasi / fastpack.sh
Created April 30, 2010 19:42
fastpack - a simple App::FatPacker helper
#!/bin/sh
#
# fastpack - a simple App::FatPacker helper
#
if [ -z "$1" ]; then
echo "usage: fastpack script.pl > script.packed.pl"
exit 0
fi