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
from twisted.web import http | |
from twisted.internet import protocol, reactor | |
from twisted.internet.error import CannotListenError, ConnectError | |
from twisted.internet.interfaces import IReactorTCP | |
from zope.interface import implements | |
from twisted.python import log | |
class ProxyConnectError(ConnectError): |
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
from twisted.web.proxy import Proxy, ProxyRequest | |
from twisted.internet.protocol import Protocol, ClientFactory | |
import urlparse | |
from twisted.python import log | |
class ConnectProxyRequest(ProxyRequest): | |
"""HTTP ProxyRequest handler (factory) that supports CONNECT""" | |
connectedProtocol = None |
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
from PySide.QtCore import Slot | |
from PySide.QtGui import QApplication, QMainWindow, QDialog, QVBoxLayout | |
from PySide.QtWebKit import QWebView, QWebPage, QWebSettings | |
import sys | |
from functools import partial | |
from argparse import ArgumentParser | |
ap = ArgumentParser() | |
ap.add_argument('app_id', type=int) |
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 | |
from __future__ import absolute_import | |
from argparse import ArgumentParser | |
from getpass import getuser, getpass | |
ap = ArgumentParser() | |
ap.add_argument('key') | |
ap.add_argument('user', default=getuser(), nargs='?', | |
help='username [%(default)s]') | |
ap.add_argument('--clear', action='store_true') |
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 ftplib | |
import socket | |
import socks # socksipy (https://github.com/mikedougherty/SocksiPy) | |
class FTP(ftplib.FTP): | |
def __init__(self, host='', user='', passwd='', acct='', | |
timeout=socket._GLOBAL_DEFAULT_TIMEOUT, | |
proxyconfig=None): | |
"""Like ftplib.FTP constructor, but with an added `proxyconfig` kwarg |
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
from sparts.vservice import VService | |
from sparts.vtask import TryLater | |
from sparts.tasks.poller import PollerTask | |
from sparts.sparts import option | |
import whois | |
import re | |
import twilio.rest | |
def parse_whois(data): | |
result = {} |
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 os | |
import os.path | |
import re | |
from collections import defaultdict | |
from pygments.lexers.web import CssLexer, JavascriptLexer | |
from .json import dumps | |
import random |