Last active
October 9, 2015 05:54
-
-
Save msaggiorato/42ed2ffe9a57d6b03748 to your computer and use it in GitHub Desktop.
Install WebServer
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 | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
echo ':: Setting up SWAP' | |
fallocate -l 2G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
echo "/swapfile none swap sw 0 0" >> /etc/fstab | |
echo "vm.swappiness=10" >> /etc/sysctl.d/99-better-swap.conf | |
echo "vm.vfs_cache_pressure=50" >> /etc/sysctl.d/99-better-swap.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment