Skip to content

Instantly share code, notes, and snippets.

@LovingMelody
Created June 2, 2017 06:57
Show Gist options
  • Save LovingMelody/87399d28bc2b8cecf4a0982612cace64 to your computer and use it in GitHub Desktop.
Save LovingMelody/87399d28bc2b8cecf4a0982612cace64 to your computer and use it in GitHub Desktop.
Creates a swapfile of 4gb of ram
#!/usr/bin/env bash
####################################
# This script is really just a joke#
# please just upgrade your hardware#
# -Fuzen-py #
####################################
mkdir -p /getram
NUM = 0
while [-f "/getram/ram-{$NUM}" ]:
do
((NUM=NUM+1))
done
dd if=/dev/zero of="/getram/ram-{$NUM}" bs=1M count=4096
mkswap "/getram/ram-{$NUM}"
chmod 600 "/getram/ram-{$NUM}"
swapon "/getram/ram-{$NUM}"
echo "/getram/ram-{$NUM} none swap sw 0 0" >> /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment