Last active
August 29, 2015 14:24
-
-
Save jamesbee/8b42ba3f9971b76ba531 to your computer and use it in GitHub Desktop.
Revisions
-
jamesbee revised this gist
Jul 15, 2015 . 1 changed file with 11 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,15 @@ #! /bin/bash sudo -i echo "Create '/swapfile'" fallocate -l "$1G" /swapfile chmod 600 /swapfile mkswap /swapfile swapon /swapfile echo "" echo "Swap status:" swapon -s echo "" echo "" @@ -17,12 +18,12 @@ free -m echo "" echo "Mount swap to fstab." echo '/swapfile none swap sw 0 0' >> /etc/fstab echo "Set swapniess to 10" sysctl vm.swappiness=10 echo vm.swappiness=10 >> /etc/sysctl.conf echo "Set vfs cache pressure to 50" sysctl vm.vfs_cache_pressure=50 echo vm.vfs_cache_pressure = 50 >> /etc/sysctl.conf -
jamesbee revised this gist
Jul 15, 2015 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,11 +6,13 @@ sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo "" echo "Swap status:" sudo swapon -s echo "" echo "" echo "Mem status:" free -m echo "" @@ -19,8 +21,8 @@ sudo echo '/swapfile none swap sw 0 0' >> /etc/fstab echo "Set swapniess to 10" sudo sysctl vm.swappiness=10 sudo echo vm.swappiness=10 >> /etc/sysctl.conf echo "Set vfs cache pressure to 50" sudo sysctl vm.vfs_cache_pressure=50 sudo echo vm.vfs_cache_pressure = 50 >> /etc/sysctl.conf -
jamesbee created this gist
Jul 15, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ #! /bin/bash echo "Create '/swapfile'" sudo fallocate -l "$1G" /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo "Swap status:\n" sudo swapon -s echo "" echo "Mem status:\n" free -m echo "" echo "Mount swap to fstab." sudo echo '/swapfile none swap sw 0 0' >> /etc/fstab echo "Set swapniess to 10" sudo sysctl vm.swappiness=10 echo vm.swappiness=10 >> /etc/sysctl.conf echo "Set vfs cache pressure to 50" sudo sysctl vm.vfs_cache_pressure=50 echo vm.vfs_cache_pressure = 50 >> /etc/sysctl.conf