Skip to content

Instantly share code, notes, and snippets.

@briancline
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briancline/02bc14754d06f9ab513a to your computer and use it in GitHub Desktop.
Save briancline/02bc14754d06f9ab513a to your computer and use it in GitHub Desktop.
Useful random junk

Python Stuff

pip install https://github.com/briancline/repo/archive/7aa7cea9cb2d425362cda6bc0e8ac94924436752.zip

Linux Containers (LXC) Stuff

export MIRROR="http://mirror01.sys.local/ubuntu/"
export SECURITY_MIRROR="$MIRROR"
lxc-create -n ctr01 -t trusty
lxc-start -n ctr01 -d  # in the background
lxc-attach -n ctr01  # become root within ctr01
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 8080 -j DNAT --to-destination 10.237.1.101:8080

Linux Namespacing Stuff

ip netns add c01
ip netns exec c01 ip link set lo up

ip link add veth-c01-r00 type veth peer name veth-c01-r01
ip addr add 10.237.1.1/28 dev veth-c01-r00
ip link set veth-c01-r00 up

ip link set veth-c01-r01 netns c01
ip netns exec c01 ip addr add 10.237.1.14/28 dev veth-c01-r01
ip netns exec c01 ip link set veth-c01-r01 up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment