Skip to content

Instantly share code, notes, and snippets.

@adgaudio
adgaudio / ssh_tunnel.py
Last active December 15, 2015 07:18
SSH tunnel through a gateway to another machine. I know there are plenty of implementations, but none I found just worked and returned a "localhost:port" string like this does. I've been using this successfully for several months with no problems. However, I have noticed that sometimes, --encrypted is required (this may have something to do with…
"""SSH tunnel through a gateway to another machine.
USAGE:
python ./ssh_tunnel.py -h
or
>>> import ssh_tunnel
>>> ssh_tunnel.main('gateway_username', 'dest_host_addr')
@adgaudio
adgaudio / add_to_security_group.py
Last active December 15, 2015 05:19 — forked from robbyt/secgroup.py
Inspired by https://gist.github.com/robbyt/2493423 This StarCluster plugin grants all tcp, udp and icmp privileges for 10.0.0.0/8 between the current cluster's security group and the given security group, in both directions for cidr block 10.0.0.0/8. This would be particularly useful for using StarCluster within Amazon VPC.
"""
Based on https://gist.github.com/robbyt/2493423
This StarCluster plugin grants all tcp, udp and icmp privileges for 10.0.0.0/8
between the current cluster's security group and the given security group,
in both directions
"""
from starcluster.clustersetup import ClusterSetup
from starcluster.logger import log
# Tmux Configuration
# By Alex Gaudio
# April 15, 2012
# HACKS
#######
#######
## Unfortunately, the osx system clipboard integration sucks. But there's a well documented workaround.
# OS X: pbcopy and pbpaste workaround from ChrisJohnsen
# code available at: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.git