Skip to content

Instantly share code, notes, and snippets.

@thomasloven
Last active June 2, 2020 12:00
Show Gist options
  • Save thomasloven/ede19551cf2b00baec6c719ebe684c8d to your computer and use it in GitHub Desktop.
Save thomasloven/ede19551cf2b00baec6c719ebe684c8d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
MD5="md5"
HOSTNAME=`hostname -s`
if [[ -n $1 ]]; then HOSTNAME=$1; fi
HASH=`echo ${HOSTNAME} | ${MD5}`
echo -n -e "\033[38;05;$((0x${HASH:4:6}))m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment