Skip to content

Instantly share code, notes, and snippets.

View NullBhikkhu's full-sized avatar

NullBhikkhu NullBhikkhu

View GitHub Profile
@NullBhikkhu
NullBhikkhu / swap-to-ram.bash
Created May 2, 2017 03:07
Transfer swapped data back to RAM
#!/usr/bin/env bash
###################
mem=$(LC_ALL=C free | awk '/Mem:/ {print $4}')
swap=$(LC_ALL=C free | awk '/Swap:/ {print $3}')
if [ "$EUID" -ne 0 ]; then
echo "ERROR: Not running as root. Nothing done." >&2
exit 1
fi