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! |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
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(): |
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' |
IPython Installation | |
1. Install Git | |
1. sudo apt-get install git | |
2. Install IPython from GitHub server | |
1. git clone --recursive https://github.com/ipython/ipython.git (this clones the git repo into a directory called ‘ipython’ located in the directory you run the command from) | |
3. Run the IPython setup script | |
1. cd into the ‘ipython’ directory created in the previous step | |
2. sudo python setup.py install | |
4. Set up a self-signed certificate for SSL (still results in warning in the browser but allows for SSL) |
##VGG16 model for Keras
This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.
It has been obtained by directly converting the Caffe model provived by the authors.
Details about the network architecture can be found in the following arXiv paper:
Very Deep Convolutional Networks for Large-Scale Image Recognition
K. Simonyan, A. Zisserman
# Note – this is not a bash script (some of the steps require reboot) | |
# I named it .sh just so Github does correct syntax highlighting. | |
# | |
# This is also available as an AMI in us-east-1 (virginia): ami-cf5028a5 | |
# | |
# The CUDA part is mostly based on this excellent blog post: | |
# http://tleyden.github.io/blog/2014/10/25/cuda-6-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/ | |
# Install various packages | |
sudo apt-get update |
import threading | |
from IPython.display import display | |
import ipywidgets as widgets | |
import time | |
def get_ioloop(): | |
import IPython, zmq | |
ipython = IPython.get_ipython() | |
if ipython and hasattr(ipython, 'kernel'): | |
return zmq.eventloop.ioloop.IOLoop.instance() | |
ioloop = get_ioloop() |