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
#!/bin/sh | |
#spins down a disk. put this in /etc/cron.hourly so that it runs last | |
#cronjobs are run in alphabetical order so zzspindown is a sure bet... | |
#licence: public domain | |
DISK=sda | |
SGSTART=/usr/bin/sg_start | |
if [ ! -x $SGSTART ] | |
then |
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
#!/bin/sh | |
FILE=/etc/rc.local | |
grep -q enable_zram $FILE && echo Zram already enabled && exit 1 | |
#remove the exit 0 line. Hopefully it's the last line. | |
sed -i -e "/^exit 0/ d" $FILE | |
cat >>$FILE <<END | |
#enable_zram | |
modprobe zram | |
#a good size is about 10-20% of physical ram. | |
echo 52428800 > /sys/block/zram0/disksize |