Skip to content

Instantly share code, notes, and snippets.

@f1sherman
f1sherman / notify-new-hosts
Last active April 4, 2017 02:05
Send an email when a new host joins the local network
#!/usr/bin/env ruby
# Scans the network and sends an email whenever new hosts are detected. Uses MAC address to identify hosts.
# Published here: https://gist.github.com/f1sherman/1c6c5e5f31c1fab33bbd1028c15d88e1
EMAIL = 'you@example.com'
require 'set'
require 'yaml'
require 'net/smtp'
@f1sherman
f1sherman / forwarding-example.md
Last active March 12, 2021 00:21
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"
@f1sherman
f1sherman / animated-gif.md
Created May 8, 2015 16:04
Generating an animated gif from
#!/bin/bash
# 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
VMX='/path/to/file.vmx'
BACKUP_DIR='/path/to/backup/directory'
VMRUN='/Applications/VMware Fusion.app/Contents/Library/vmrun'
NUM_BACKUPS_TO_KEEP=3