Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@monobilisim
Last active June 23, 2016 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save monobilisim/8896430 to your computer and use it in GitHub Desktop.
Save monobilisim/8896430 to your computer and use it in GitHub Desktop.
#!/bin/sh
# count=4096k -> 4G
sudo dd if=/dev/zero of=/swapfile bs=1024 count=4096k
mkswap /swapfile
swapon /swapfile
chown root:root /swapfile
chmod 0600 /swapfile
sysctl vm.swappiness=10
cat /proc/sys/vm/swappiness
echo "/swapfile swap swap defaults 0 0" > /etc/fstab
echo "vm.swappiness = 0" > /etc/sysctl.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment