This file contains 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 python | |
import sys | |
import re | |
def iterpings(filename): | |
for line in open(filename): | |
m = re.search(r'] GET (.*?) ', line) | |
if m is not None: | |
yield m.group(1) |
This file contains 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
import threading | |
import functools | |
import logging | |
def timeout(duration, default=None): | |
def decorator(func): | |
class InterruptableThread(threading.Thread): | |
def __init__(self, args, kwargs): | |
threading.Thread.__init__(self) | |
self.args = args |