commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
I liked vaporub's suggestion, here a little simplification of the sed command.
There is 1 alternative - vote for the best!
Original author unknown (I believe off of a wifi hacking forum).
Used in conjuction with ifconfig and cron.. can be handy (especially spoofing AP's)
Use the following variation for FreeBSD:
openssl rand 6 | xxd -p | sed 's/\(..\)/\1:/g; s/:$//'
Just increase the 1 at the end if you want to generate more than one.
(Alternative to "| head -n N" you could use the -b flag of od: -b $[6*N]
- The last sed expression ensures the unicast/multicast bit is set to zero
- The greedy space replacements are for portability across UNIX seds (note there's TWO spaces and not just one, as this web shows, in s/^ */)
If you can do better, submit your command here.
You must be signed in to comment.