Skip to content

Instantly share code, notes, and snippets.

@stansidel
Last active August 29, 2015 13:56

Revisions

  1. stansidel revised this gist Jun 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion activate_swap.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k
    sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024k
    sudo mkswap /swapfile
    sudo swapon /swapfile
    echo "/swapfile none swap sw 0 0 " | sudo tee -a /etc/fstab
  2. stansidel revised this gist Feb 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion activate_swap.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k
    sudo mkswap /swapfile
    sudo swapon /swapfile
    sudo echo "/swapfile none swap sw 0 0 " >> /etc/fstab
    echo "/swapfile none swap sw 0 0 " | sudo tee -a /etc/fstab
    echo 0 | sudo tee /proc/sys/vm/swappiness
    echo vm.swappiness = 0 | sudo tee -a /etc/sysctl.conf
    sudo chown root:root /swapfile
  3. stansidel created this gist Feb 6, 2014.
    9 changes: 9 additions & 0 deletions activate_swap.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k
    sudo mkswap /swapfile
    sudo swapon /swapfile
    sudo echo "/swapfile none swap sw 0 0 " >> /etc/fstab
    echo 0 | sudo tee /proc/sys/vm/swappiness
    echo vm.swappiness = 0 | sudo tee -a /etc/sysctl.conf
    sudo chown root:root /swapfile
    sudo chmod 0600 /swapfile
    swapon -s