Skip to content

Instantly share code, notes, and snippets.

View dialtone's full-sized avatar

Valentino Volonghi dialtone

View GitHub Profile
#!/bin/bash
TMPDIR=
TMPFILE=
TMPDIR=`mktemp -t tmp/adroll -d`
TMPFILE=`mktemp -t adroll`
git diff --cached --name-only --diff-filter=ACMR | xargs git checkout-index --prefix=$TMPDIR/ --
pyflakes $TMPDIR >$TMPFILE 2>&1
grep -v "unable to detect undefined names" $TMPFILE >$TMPFILE.2
sed "s/^${TMPDIR//\//.}.//" $TMPFILE.2 >$TMPFILE
egrep -v "migrations.*'(datetime|models)' imported but unused" $TMPFILE >$TMPFILE.2
#!/usr/bin/env python
import os
import urllib
import boto
from boto import ec2
def get_seeds(conn, cluster):
all_instances = conn.get_all_instances(filters={"tag:type": "*", "tag:cluster": cluster})
seeds = []
for reservation in all_instances:
#!/usr/bin/env python
import os
import shutil
import socket
from optparse import OptionParser
from boto import ec2
BASE = """
Jun 13 23:00:51 ip-10-169-65-173 kernel: [6391575.940887] INFO: task jsvc:4846 blocked for more than 120 seconds.
Jun 13 23:00:51 ip-10-169-65-173 kernel: [6391575.940902] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Jun 13 23:00:51 ip-10-169-65-173 kernel: [6391575.940910] jsvc D ffff8803bffa3b00 0 4846 4831 0x00000000
Jun 13 23:00:51 ip-10-169-65-173 kernel: [6391575.940916] ffff88039e535e68 0000000000000286 ffff88039e535fd8 ffff88039e534000
Jun 13 23:00:51 ip-10-169-65-173 kernel: [6391575.940922] 0000000000013b00 ffff8803a0e247e0 ffff88039e535fd8 0000000000013b00
Jun 13 23:00:51 ip-10-169-65-173 kernel: [6391575.940928] ffff8803a12d5b00 ffff8803a0e24440 0000000000000246 ffff8803a0e24440
Jun 13 23:00:51 ip-10-169-65-173 kernel: [6391575.940934] Call Trace:
Jun 13 23:00:51 ip-10-169-65-173 kernel: [6391575.940948] [<ffffffff815dbddd>] rwsem_down_failed_common+0xcd/0x170
Jun 13 23:00:51 ip-10-169-65-173 kernel: [6391575.940955] [<ffffffff8100779d>] ? xen_fo
def funpath(fun):
return ".".join([fun.__module__, fun.__name__])
def getm(fun):
return namedAny(funpath(fun))
class LockMap(object):
"""
The LockMap object doesn't really have any active part in
the execution of tasks. It is however useful for the user