Skip to content

Instantly share code, notes, and snippets.

@utamas
Created January 1, 2016 17:37
Show Gist options
  • Save utamas/36f97a63ff59891a0950 to your computer and use it in GitHub Desktop.
Save utamas/36f97a63ff59891a0950 to your computer and use it in GitHub Desktop.
set-hostname
set-hostname() {
local hostname=$1
sudo hostname $hostname
echo "$hostname" | sudo tee /etc/hostname
echo "127.0.0.1 $hostname" | sudo tee -a /etc/hosts
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment