Skip to content

Instantly share code, notes, and snippets.

@kwdowicz
Created December 24, 2011 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwdowicz/1517102 to your computer and use it in GitHub Desktop.
Save kwdowicz/1517102 to your computer and use it in GitHub Desktop.
## remove old
sed '/vuserbox/d' /etc/hosts > /tmp/hosts
cat /tmp/hosts > /etc/hosts
## add new
nmap -v -sT 192.168.1.50/24 -p 2222 | grep Discovered | awk '{print $NF"\tvuserbox"}' >> /etc/hosts
## flush cache
dscacheutil -flushcache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment