This file contains hidden or 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 | |
# Of course, the author does not guarantee safety. | |
# I did my best by using SQLite's online backup API. | |
from __future__ import print_function | |
import sys, ctypes | |
from ctypes.util import find_library | |
SQLITE_OK = 0 | |
SQLITE_ERROR = 1 | |
SQLITE_BUSY = 5 |
This file contains hidden or 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 gc, os, subprocess, requests | |
gc.disable() # Just to make sure - I have seen this with gc enabled | |
for x in range(20): | |
requests.head("http://www.google.de/") | |
print "Open sockets after 20 head requests:" | |
pid = os.getpid() | |
subprocess.call("lsof -p%d -a -iTCP" % (pid,), shell=True) |
NewerOlder