Skip to content

Instantly share code, notes, and snippets.

View johnrnelson's full-sized avatar
🏠
Working from home

John Nelson johnrnelson

🏠
Working from home
View GitHub Profile
#!/usr/bin/env node
"use strict";
/*
Easy script to bounce a box after updating it.
Make sure this file is executable and run it as root...
*/
@johnrnelson
johnrnelson / gist:fe99dda745d20d6a3b094a696d8729c2
Created December 19, 2016 17:08
Example of how to Setup up IP Tables for port 443-8080 and 80-8000
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8000
@johnrnelson
johnrnelson / forwarding-example.md
Created December 25, 2015 17:09 — forked from f1sherman/forwarding-example.md
Port Forwarding Example in OS X El Capitan

Add the following to /etc/pf.anchors/myname:

rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 4000
rdr pass on lo0 inet proto tcp from any to any port 443 -> 127.0.0.1 port 4001

Add the following to /etc/pf-myname.conf:

rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/myname"