Last active
October 19, 2015 01:20
-
-
Save luqmaan/35c5ed39c6381256da8d to your computer and use it in GitHub Desktop.
change your wifi mac address to something random on os x yosemite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newmac() { | |
m0=$(ifconfig en0 | grep ether | sed 's/\s*ether //g' | sed 's/ $//g' | sed 's/ /:/g') | |
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z | |
m1=$(od -An -N6 -t xC /dev/urandom | sed -e 's/^\s*//g' | sed -e 's/\s*$//g' | sed -e 's/ /:/g') | |
echo "changing mac from $m0 to $m1" | |
sudo ifconfig en0 ether $m1 | |
sudo networksetup -detectnewhardware | |
echo "clearing safari" | |
clearsafari | |
} | |
clearsafari() { | |
mv ~/Library/Safari ~/Desktop/Safari-`date +%Y%m%d%H%M%S`; \ | |
rm -Rf ~/Library/Caches/Apple\ -\ Safari\ -\ Safari\ Extensions\ Gallery; \ | |
rm -Rf ~/Library/Caches/Metadata/Safari; \ | |
rm -Rf ~/Library/Caches/com.apple.Safari; \ | |
rm -Rf ~/Library/Caches/com.apple.WebKit.PluginProcess; \ | |
rm -Rf ~/Library/Cookies/Cookies.binarycookies; \ | |
rm -Rf ~/Library/Preferences/Apple\ -\ Safari\ -\ Safari\ Extensions\ Gallery; \ | |
rm -Rf ~/Library/Preferences/com.apple.Safari.LSSharedFileList.plist; \ | |
rm -Rf ~/Library/Preferences/com.apple.Safari.RSS.plist; \ | |
rm -Rf ~/Library/Preferences/com.apple.Safari.plist; \ | |
rm -Rf ~/Library/Preferences/com.apple.WebFoundation.plist; \ | |
rm -Rf ~/Library/Preferences/com.apple.WebKit.PluginHost.plist; \ | |
rm -Rf ~/Library/Preferences/com.apple.WebKit.PluginProcess.plist; \ | |
rm -Rf ~/Library/PubSub/Database; \ | |
rm -Rf ~/Library/Saved\ Application\ State/com.apple.Safari.savedState | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment