Use the following variation for FreeBSD:
openssl rand 6 | xxd -p | sed 's/\(..\)/\1:/g; s/:$//'
Replace (as opposed to insert) hex opcodes, data, breakpoints, etc. without opening a hex editor. HEXBYTES contains the hex you want to inject in ascii form (e.g. 31c0) OFFSET is the hex offset (e.g. 49cf) into the binary FILE
Replace all instances of "A" with "B" in file "source" saved as file "destination". !! IF A/B is multi-byte, then separate bytes with spaces like so: "s/20\ 0A/00/g". Show Sample Output
just set macdst to the mac address of the system you wish to wake up, the macsrc is optional but helps use tcpreplay to broadcast or wireshark to view
xxd can convert a hexdump back to binary using the -r option which can be useful for patching or editing binary files.
end_w_nl filename
will check if the last byte of filename is a unix newline character. tail -c1 yields the file's last byte and xxd converts it to hex format.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: