Skip to content

Instantly share code, notes, and snippets.

f1sherman / notify-new-hosts
Last active Apr 4, 2017
Send an email when a new host joins the local network
View notify-new-hosts
#!/usr/bin/env ruby
# Scans the network and sends an email whenever new hosts are detected. Uses MAC address to identify hosts.
# Published here:
EMAIL = ''
require 'set'
require 'yaml'
require 'net/smtp'
f1sherman /
Last active Mar 12, 2021
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 -> port 4000
rdr pass on lo0 inet proto tcp from any to any port 443 -> port 4001

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

rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/myname"
f1sherman /
Created May 8, 2015
Generating an animated gif from
# Fail this script if any commands fail (-e) or if any uninitialized variables are referenced (-u)
set -e -u
# Set the following variables based on your environment