Skip to content

Instantly share code, notes, and snippets.

@th0th
Created November 22, 2017 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save th0th/a34525b62dd86cee41dfac808939b87b to your computer and use it in GitHub Desktop.
Save th0th/a34525b62dd86cee41dfac808939b87b to your computer and use it in GitHub Desktop.
Create swap file (2 GB) and activate
#!/bin/sh
dd if=/dev/zero of=/swapfile bs=1M count=2048
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment