Skip to content

Instantly share code, notes, and snippets.

@hashimotor
Last active December 16, 2015 19:39
Show Gist options
  • Save hashimotor/5486751 to your computer and use it in GitHub Desktop.
Save hashimotor/5486751 to your computer and use it in GitHub Desktop.
AWS User data
#!/bin/bash -e
exec > >(tee >(logger -t "user-data")) 2> >(tee >(logger -t "user-data: ERROR") >&2)
echo user-data: BEGIN
date '+%Y-%m-%d %H:%M:%S'
dd if=/dev/zero of=/swap bs=1M count=1024
mkswap /swap
swapon /swap
echo "/swap none swap defaults 0 0" | tee -a /etc/fstab
echo "Asia/Tokyo" > /etc/timezone
echo LC_ALL=\"en_US.UTF-8\" | tee -a /etc/default/locale
aptitude update
aptitude -y upgrade
aptitude -y install python-pip python-dev python-virtualenv git build-essential
echo user-data: END
date '+%Y-%m-%d %H:%M:%S'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment