Skip to content

Instantly share code, notes, and snippets.

@tamagokun
Created August 9, 2016 13:12
Show Gist options
  • Save tamagokun/1c8a11d5ad058a28baeedc8c6c47a45f to your computer and use it in GitHub Desktop.
Save tamagokun/1c8a11d5ad058a28baeedc8c6c47a45f to your computer and use it in GitHub Desktop.
Create a swap file on Amazon EC2
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
sudo chmod 600 /var/swap.1
# Add to /etc/fstab
/var/swap.1 swap swap defaults 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment