Created
November 2, 2017 11:04
-
-
Save random-robbie/01a85161ac83244aff7f3747bbe79dfc to your computer and use it in GitHub Desktop.
2GB Swap for a 512mb Ram VPS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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... [*]" |
Author
random-robbie
commented
Nov 2, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment