index rss mastodon twitter github linkedin email
Álvaro Ramírez
sponsor

Álvaro Ramírez

21 May 2019 Changing MAC address in org

Via Minko Gechev's tweet. Saving in an org block, just because…

changeMAC() {
    local mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
    ifconfig en0 ether $mac
    ifconfig en0 down
    ifconfig en0 up
    echo "Your new physical address is $mac"
}

changeMAC
Your new physical address is aa:36:ee:d2:ee:66

ps. Also see Execute org blocks as root.