mainly used in start-up script
iptables -t nat -A PREROUTING -s 192.168.1.2 -i eth0 -j MASQUERADE
#!/bin/bash | |
set -ex | |
UBUNTU_VERSION="14.04" | |
mkdirs(){ | |
lxc delete hadoop-master --force | |
lxc delete hadoop-slave-1 --force | |
lxc delete hadoop-slave-2 --force | |
rm -rf /tmp/* |
;; Elisp session in REPL IELM | |
;; | |
;; | |
;; | |
ELISP> (defmacro inc (var) | |
(list 'setq var (list '1+ var))) | |
inc | |
ELISP> (setq x 0) | |
0 (#o0, #x0, ?\C-@) |
import asyncio | |
import socket | |
BIND_IP = "127.0.0.1" | |
TCP_PORT = 1234 | |
SOCK_BACKLOG = 32 | |
IP_TRANSPARENT = 19 | |
desc = f""" | |
Anybind; "bind" on many IPs and many Ports. |
#!/usr/bin/env python | |
"""Extend Python's built in HTTP server to save files | |
curl or wget can be used to send files with options similar to the following | |
curl -X PUT --upload-file somefile.txt http://localhost:8000 | |
wget -O- --method=PUT --body-file=somefile.txt http://localhost:8000/somefile.txt | |
__Note__: curl automatically appends the filename onto the end of the URL so |
# sourcing this file will define a bash functions that | |
# tries to run subsequent calls to emacs with 24 bit color. | |
# | |
# It sets TERM=xterm-emacs-leg if | |
# - we've created a user-local terminfo record for xterm-emacs-leg, and | |
# - we're using iTerm2 or something has set COLORTERM=truecolor | |
# | |
# This will cause emacs to use 24 bit color only when it will work, | |
# inside or outside of tmux. I haven't found a way to auto-detect Blink.sh yet. | |
# |
#! /usr/bin/env bash | |
# | |
# Run parallel commands and fail if any of them fails. | |
# | |
set -eu | |
pids=() | |
for x in 1 2 3; do |