Skip to content

Instantly share code, notes, and snippets.

View bhcopeland's full-sized avatar

Benjamin Copeland bhcopeland

View GitHub Profile
@bertrandom
bertrandom / ephemswap
Created March 20, 2012 04:56
Creates a 4 gig swap file and mounts it as swap space, used for EC2 small instances for on-boot ephemeral swap space, put it somewhere in boot init
#!/bin/bash
if swapon -s | grep -q /mnt/swapfile
then
echo "Swapfile already mounted"
else
if [ -e /mnt/swapfile ]
then
echo "Mounting swapfile"
swapon /mnt/swapfile