Skip to content

Instantly share code, notes, and snippets.

@ghecho
Created September 6, 2015 03:07
Show Gist options
  • Save ghecho/ff56c49bb69634db47d0 to your computer and use it in GitHub Desktop.
Save ghecho/ff56c49bb69634db47d0 to your computer and use it in GitHub Desktop.
Bash function that remaps the computer's MAC
# taken from: http://jezenthomas.com/free-internet-on-trains/
# it goes into the .bashrc
function remac {
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z
sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
sudo networksetup -detectnewhardware
echo $(ifconfig en0 | grep ether)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment