Skip to content

Instantly share code, notes, and snippets.

[nrh@toki ~] cd projects/range
[nrh@toki ~/projects/range (stdlayout)] autoreconf -if && ./configure --enable-perl --enable-mod-range && make install
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
glibtoolize: copying file `build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
glibtoolize: copying file `m4/libtool.m4'
glibtoolize: copying file `m4/ltoptions.m4'
glibtoolize: copying file `m4/ltsugar.m4'
glibtoolize: copying file `m4/ltversion.m4'
glibtoolize: copying file `m4/lt~obsolete.m4'
#!/bin/bash
for file in dot.*; do
dest=`grep '^[\"\#\/].*.file:' "$file"|awk -F'[:\ ]' '{print \$3}'`
dest=$(eval echo $dest)
lwd=${PWD#$HOME/}
if [ -r "${HOME}/${dest}" ]; then
if ! cmp -s "$file" "${HOME}/${dest}"; then
mv "${HOME}/${dest}" "${HOME}/${dest}.orig"
2011-03-29 13:03:37,976 - INFO [Snapshot Thread:FileTxnSnapLog@208] - Snapshotting: e00586bff
2011-03-29 13:04:14,149 - WARN [NIOServerCxn.Factory:2181:NIOServerCnxn@518] - Exception causing close of session 0x12e9d7429400008 due to java.io.IOException: Read error
2011-03-29 13:04:14,150 - INFO [NIOServerCxn.Factory:2181:NIOServerCnxn@857] - closing session:0x12e9d7429400008 NIOServerCnxn: java.nio.channels.SocketChannel[connected local=/127.0.0.1:2181 remote=/127.0.0.1:58072]
2011-03-29 13:04:14,184 - WARN [NIOServerCxn.Factory:2181:NIOServerCnxn@518] - Exception causing close of session 0x12e9d7429400004 due to java.io.IOException: Read error
2011-03-29 13:04:14,184 - INFO [NIOServerCxn.Factory:2181:NIOServerCnxn@857] - closing session:0x12e9d7429400004 NIOServerCnxn: java.nio.channels.SocketChannel[connected local=/127.0.0.1:2181 remote=/127.0.0.1:58075]
2011-03-29 13:04:14,207 - WARN [NIOServerCxn.Factory:2181:NIOServerCnxn@518] - Exception causing close of session 0x12e9d7429400002 due to java.io.I
[nrh@toki ~/projects/pogo] cat .git/hooks/pre-commit
#!/usr/local/bin/perl -w
use Perl6::Slurp;
my $status = slurp '-|', 'git status';
# only want what is going to be commited
$status =~ s/Changed but not updated.*$//s;
diff -rupN /opt/local/lib/perl5/site_perl/5.8.9/AnyEvent/HTTPD/HTTPConnection.pm ./HTTPD/HTTPConnection.pm
--- /opt/local/lib/perl5/site_perl/5.8.9/AnyEvent/HTTPD/HTTPConnection.pm 2011-01-08 14:31:26.000000000 -0600
+++ ./HTTPD/HTTPConnection.pm 2011-01-08 14:30:44.000000000 -0600
@@ -361,9 +361,9 @@ sub push_header_line {
if ($line =~ /(\S+) \040 (\S+) \040 HTTP\/(\d+)\.(\d+)/xso) {
my ($meth, $url, $vm, $vi) = ($1, $2, $3, $4);
- if (not grep { $meth eq $_ } qw/GET HEAD POST OPTIONS/) {
+ if (not grep { $meth eq $_ } qw/GET HEAD POST/) {
$self->error (501, "not implemented",
@nrh
nrh / gist:762903
Created January 2, 2011 22:55
patch to AnyEvent::HTTPD @ 79ca598
diff --git a/MANIFEST b/MANIFEST
index 6b03cd5..918824f 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,7 +1,7 @@
Changes
MANIFEST
Makefile.PL
-README
+TODO
322 if (job.runs)
323 {
324 for (var i = 0; i < job.runs.length; i++)
325 {
326 logger("shitballs");
327 logger(Y.dump(job.runs));
328 // the first start time will be our job start time
329 if (!jobStart && job.runs[i].s)
330 {
331 jobStart = Math.round( job.runs[i].s * 1000 );
[
{
"status" : "OK",
"version" : "V3",
"action" : "jobsnapshot",
"hostname" : "pd2.mail.corp.ac4.yahoo.com"
},
[
"13",
"{\"smtp146.mail.ukl.yahoo.com\":{\"msg\":\"exited with status 2\",\"runs\":[{\"e\":1291253951.66542,\"m\":\"exited with status 2\",\"x\":\"2\",\"s\":1291252960.08221,\"o\":\"http://pw1.mail.corp.sp1.yahoo.com/pogo_output/p0000013002/smtp146.mail.ukl.yahoo.com.0.txt\"}],\"state\":\"failed\",\"host\":\"smtp146.mail.ukl.yahoo.com\"},\"smtp147.mail.ukl.yahoo.com\":{\"msg\":\"exited with status 2\",\"runs\":[{\"e\":1291253965.4172,\"m\":\"exited with status 2\",\"x\":\"2\",\"s\":1291252960.21977,\"o\":\"http://pw1.mail.corp.sp1.yahoo.com/pogo_output/p0000013002/smtp147.mail.ukl.yahoo.com.0.txt\"}],\"state\":\"failed\",\"host\":\"smtp147.mail.ukl.yahoo.com\"},\"job\":{\"msg\":\"no more hosts to run\",\"runs\":[{\"e\":1291253966.42493,\"s\":1291252959.34947,\"o\":null}],\"range\":[\"smtp146.mail.ukl.yahoo.com,smtp147.mail.ukl.yahoo.com\"],\"state\":\"fin
[
{
"status" : "OK",
"version" : "V3",
"action" : "jobsnapshot",
"hostname" : "toki.local"
},
[
40,
"{\"foo10.example.com\":{\"msg\":\"ok\",\"runs\":[{\"e\":1293928572.1374,\"m\":\"ok\",\"x\":\"0\",\"s\":1293928562.18889,\"o\":\"http://localhost:8081/static/p0000000002/foo10.example.com.0.txt\"}],\"state\":\"finished\",\"host\":\"foo10.example.com\"},\"foo2.example.com\":{\"msg\":\"ok\",\"runs\":[{\"e\":1293928584.54668,\"m\":\"ok\",\"x\":\"0\",\"s\":1293928574.18567,\"o\":\"http://localhost:8081/static/p0000000002/foo2.example.com.0.txt\"}],\"state\":\"finished\",\"host\":\"foo2.example.com\"},\"foo1.example.com\":{\"msg\":\"ok\",\"runs\":[{\"e\":1293928572.17602,\"m\":\"ok\",\"x\":\"0\",\"s\":1293928562.21005,\"o\":\"http://localhost:8081/static/p0000000002/foo1.example.com.0.txt\"}],\"state\":\"finished\",\"host\":\"foo1.example.com\"},\"job\":{\"msg\":\"no more hosts to run\",\"target\":\"[\\\"foo[1-10].example.com\\\"]\",\"runs\":[{\"e\":1293928621.46285}],\"s
@nrh
nrh / gist:755131
Created December 26, 2010 00:56
pogofail1
[nrh@toki projects/pogo/t] POGO_PERSIST=1 perl -Ilib -e 'use PogoTester; PogoTester::start_zookeeper(); sleep 2; PogoTester::start_dispatcher(); PogoTester::start_worker();'
[10234] DEBUG PogoTester::start_zookeeper:109 using 'java -Dzookeeper.log.dir="." -Dzookeeper.root.logger="INFO,CONSOLE" -cp "/Users/nrh/projects/pogo/t/../build/zookeeper/bin/../build/classes:/Users/nrh/projects/pogo/t/../build/zookeeper/bin/../build/lib/*.jar:/Users/nrh/projects/pogo/t/../build/zookeeper/bin/../zookeeper-3.3.1.jar:/Users/nrh/projects/pogo/t/../build/zookeeper/bin/../lib/log4j-1.2.15.jar:/Users/nrh/projects/pogo/t/../build/zookeeper/bin/../lib/jline-0.9.94.jar:/Users/nrh/projects/pogo/t/../build/zookeeper/bin/../src/java/lib/*.jar:/Users/nrh/projects/pogo/t/../build/zookeeper/bin/../conf:" -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain "/Users/nrh/projects/pogo/t/conf/zookeeper.conf"
'
[10234] INFO PogoTester::start_zookeeper:122 spawned