Skip to content

Instantly share code, notes, and snippets.

View flymia's full-sized avatar
🏠
Working from home

Marc flymia

🏠
Working from home
View GitHub Profile
#!/usr/bin/env bash
# Thanks to: https://askubuntu.com/a/852027
# Takes the following string: '\000\001\000\001\037\305\371\341\001\002\003\004\005\006' (example from /var/lib/dhcp/...)
# and converts it to a readable DHCPv6 DUID.
# usage: ./duid-converter.sh '\000\001\000\001\037\305\371\341\001\002\003\004\005\006'
printf $1 | hexdump -e '14/1 "%02x " "\n"' | sed 's/ /:/g'