Skip to content

Instantly share code, notes, and snippets.

@tito
Created February 20, 2025 21:30
Show Gist options
  • Save tito/fddb0bbb244dc93e1b965eb218f796b1 to your computer and use it in GitHub Desktop.
Save tito/fddb0bbb244dc93e1b965eb218f796b1 to your computer and use it in GitHub Desktop.
Digitalocean swap
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
swapon --show
free -h
cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment