Skip to content

Instantly share code, notes, and snippets.

@goodfeel
Last active August 29, 2015 14:25
Show Gist options
  • Save goodfeel/fa36536a58c58924259d to your computer and use it in GitHub Desktop.
Save goodfeel/fa36536a58c58924259d to your computer and use it in GitHub Desktop.
setup swap for aws ami
#!/bin/bash
sudo /bin/dd if=/dev/zero of=/var/swap1 bs=512M count=2
sudo /sbin/mkswap /var/swap1
sudo chmod 0600 /var/swap1
sudo /sbin/swapon /var/swap1
sudo echo "/var/swap1 swap swap defaults 0 0" >> /etc/fstab
sudo reboot now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment