Instantly share code, notes, and snippets.

Embed
What would you like to do?
2GB Swap for a 512mb Ram VPS
#!/bin/bash
echo "[*] Swap Setup for VPS with 512mb... [*]"
swapon -s
dd if=/dev/zero of=/swapfile bs=1024 count=2048k
mkswap /swapfile
swapon /swapfile
echo 10 | sudo tee /proc/sys/vm/swappiness
echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
chown root:root /swapfile
chmod 0600 /swapfile
echo "[*] Swap Setup Complete... [*]"
@random-robbie

This comment has been minimized.

Owner

random-robbie commented Nov 2, 2017

curl -L https://gist.github.com/random-robbie/01a85161ac83244aff7f3747bbe79dfc/raw//swap.sh | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment