Skip to content

Instantly share code, notes, and snippets.

@msaggiorato
Last active October 9, 2015 05:54
Show Gist options
  • Save msaggiorato/42ed2ffe9a57d6b03748 to your computer and use it in GitHub Desktop.
Save msaggiorato/42ed2ffe9a57d6b03748 to your computer and use it in GitHub Desktop.
Install WebServer
#!/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