Created
June 2, 2017 06:57
-
-
Save LovingMelody/87399d28bc2b8cecf4a0982612cace64 to your computer and use it in GitHub Desktop.
Creates a swapfile of 4gb of ram
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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