Skip to content

Instantly share code, notes, and snippets.

vadimg / gist:3344325
Created Aug 13, 2012
nginx access log GET request extractor
View gist:3344325
#!/usr/bin/env python
import sys
import re
def iterpings(filename):
for line in open(filename):
m ='] GET (.*?) ', line)
if m is not None:
vadimg /
Created Jun 9, 2012
python timeout decorator
import threading
import functools
import logging
def timeout(duration, default=None):
def decorator(func):
class InterruptableThread(threading.Thread):
def __init__(self, args, kwargs):
self.args = args