Skip to content

Instantly share code, notes, and snippets.

@labiak
Forked from kissarat/swap.sh
Created February 4, 2019 16:11
Show Gist options
  • Save labiak/fc18ce50159d751b0ab6bf8b55b89480 to your computer and use it in GitHub Desktop.
Save labiak/fc18ce50159d751b0ab6bf8b55b89480 to your computer and use it in GitHub Desktop.
FILENAME=/tmp/swap-$(date +%s)
dd if=/dev/zero of=${FILENAME} bs=1M count=$1
mkswap ${FILENAME}
chmod 600 ${FILENAME}
swapon ${FILENAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment