Skip to content

Instantly share code, notes, and snippets.

@li9ht
Last active May 3, 2020 12:56
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save li9ht/8931256 to your computer and use it in GitHub Desktop.
Save li9ht/8931256 to your computer and use it in GitHub Desktop.
configure virtual memory on debian 7x64 digital ocean
#!/bin/sh
sudo fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab
sysctl -w vm.swappiness=30
free
chmod +x to file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment