Skip to content

Instantly share code, notes, and snippets.

@hayeah
Created May 1, 2015 02:21
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 hayeah/d6f6f10a16bcd27cddae to your computer and use it in GitHub Desktop.
Save hayeah/d6f6f10a16bcd27cddae to your computer and use it in GitHub Desktop.
setup-swap
grep '/swapfile' /proc/swaps > /dev/null && echo swap already setup && exit
dd if=/dev/zero of=/swapfile bs=1M count=$[1024 * 2] && \
mkswap /swapfile && \
swapon /swapfile && \
echo '/swapfile swap swap auto 0 0' | tee -a /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment