Skip to content

Instantly share code, notes, and snippets.

@dvdoliveira
Last active February 17, 2016 00:24
Show Gist options
  • Select an option

  • Save dvdoliveira/236920043789a3db4c25 to your computer and use it in GitHub Desktop.

Select an option

Save dvdoliveira/236920043789a3db4c25 to your computer and use it in GitHub Desktop.
Change your Macbook Mac Address to avoid wifi time limit on airports
function mac {
echo `openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
}
function change_mac {
sudo ifconfig en0 ether `mac`
}
# New implementation found on:
# http://apple.stackexchange.com/a/183370/165855
change_mac_address {
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z
sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/./0/2; s/.$//')
networksetup -detectnewhardware
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment