Skip to content

Instantly share code, notes, and snippets.

@rbanffy
Created October 18, 2018 10:48
Show Gist options
  • Save rbanffy/5e3b04ca4555d37d744a1f0b5756e9a2 to your computer and use it in GitHub Desktop.
Save rbanffy/5e3b04ca4555d37d744a1f0b5756e9a2 to your computer and use it in GitHub Desktop.
Make a sane hostname for my VMs
echo vm-$(ifconfig | fgrep ether | head -n 1 | awk '{ print $2 }' | sed -r s/[:]/-/g) > /etc/hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment