Skip to content

Instantly share code, notes, and snippets.

@r4nd1
Last active July 5, 2021 05:43
Show Gist options
  • Save r4nd1/6152ec99e41d01d8aa80b747c8f91f3d to your computer and use it in GitHub Desktop.
Save r4nd1/6152ec99e41d01d8aa80b747c8f91f3d to your computer and use it in GitHub Desktop.
#!/bin/bash
dd if=/dev/zero of=/swapfile count=2048 bs=1M
ls / | grep swapfile
chmod 600 /swapfile
ls -lh /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab
free -m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment