Skip to content

Instantly share code, notes, and snippets.

View dscannell's full-sized avatar

David Scannell dscannell

View GitHub Profile
#!/bin/bash
# How to use: Pass to cloud-init as user data, or run as a script. When
# port 80 is open, your cloud is ready.
set -e
MYIP=`ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'`
# Fix hosts
echo 127.0.0.1 $(hostname) | sudo tee -a /etc/hosts