Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
import struct | |
import SocketServer | |
from base64 import b64encode | |
from hashlib import sha1 | |
from mimetools import Message | |
from StringIO import StringIO | |
class WebSocketsHandler(SocketServer.StreamRequestHandler): | |
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' |
from threading import Timer | |
def debounce(wait): | |
""" Decorator that will postpone a functions | |
execution until after wait seconds | |
have elapsed since the last time it was invoked. """ | |
def decorator(fn): | |
def debounced(*args, **kwargs): | |
def call_it(): |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
OH NO! It turns out that simple one-port SSH Tunnels won't work for FTP since it uses another random port to actually transfer data. No problem! SOCKS Proxy to the rescue! | |
This assumes that you have SSH access to a server that can successfully connect to the FTP server you want access to. | |
On your local execute (if you have a woople ssh alias setup): | |
ssh -ND 1234 woople | |
You'll need an FTP client that supports SOCKS Proxies. I recommend Filezilla. Enter localhost:1234 as your SOCKS proxy server and connect to the FTP server using its regular internet address (as though you were connecting from your production server). SWEEEET! |