Skip to content

Instantly share code, notes, and snippets.

Peter Ruibal fmoo

Block or report user

Report or block fmoo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fmoo
fmoo / rsrc.py
Created Sep 7, 2013
my rsrc.py "py-haste" clownery. Features include: (1) Static css / js analyzer (syntax parsing provided by pygments) (2) Tracks @requires and @provides dependencies. (3) Makes it easier to implement javelin behaviors. (4) Makes it *super* easy to use react components.
View rsrc.py
import os
import os.path
import re
from collections import defaultdict
from pygments.lexers.web import CssLexer, JavascriptLexer
from .json import dumps
import random
@fmoo
fmoo / whoiswatch.py
Last active Dec 20, 2015
sparts service that uses twilio to send an SMS whenever a domain's WHOIS State changes
View whoiswatch.py
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 = {}
@fmoo
fmoo / ftplib_simple_proxy.py
Created Dec 29, 2012 — forked from anonymous/ftplib_simple_proxy
An FTP client implementation that supports sending and receiving data via SOCKS proxy using PASV transfers
View ftplib_simple_proxy.py
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
@fmoo
fmoo / keyring-get.py
Created Nov 14, 2012
Clowny CLI script to get stuff out of the keyring
View keyring-get.py
#!/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')
@fmoo
fmoo / gist:4057731
Created Nov 12, 2012
Getting a Facebook Access Token in python via QWebView + Facebook Javascript SDK
View gist:4057731
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)
@fmoo
fmoo / server.py
Created Mar 18, 2012
CONNECT-enabled HTTP Proxy Server
View server.py
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
@fmoo
fmoo / gist:2018384
Created Mar 11, 2012
Tunneling arbitrary TCP connections over HTTP CONNECT requests with Twisted
View gist:2018384
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):
You can’t perform that action at this time.