Skip to content

Instantly share code, notes, and snippets.

@jk0
Last active April 29, 2020 14:43
Show Gist options
  • Save jk0/49affebfdf26ce3fafc9cf6d8d405675 to your computer and use it in GitHub Desktop.
Save jk0/49affebfdf26ce3fafc9cf6d8d405675 to your computer and use it in GitHub Desktop.
RPI Tweaks
# Enable SSH, disable GUIs, set Memory Split to 16
sudo raspi-config
sudo apt install vim
sudo apt purge libreoffice* wolfram-engine minecraft-pi sonic-pi
sudo apt clean
sudo apt autoremove
# Improve SD card performance
sudo vim /etc/fstab
tmpfs /tmp tmpfs defaults,noatime,nosuid,size=100m 0 0
tmpfs /var/tmp tmpfs defaults,noatime,nosuid,size=30m 0 0
tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=100m 0 0
tmpfs /var/run tmpfs defaults,noatime,nosuid,mode=0755,size=2m 0 0
tmpfs /var/spool/mqueue tmpfs defaults,noatime,nosuid,mode=0700,gid=12,size=30m 0 0
# Setup CEC
sudo apt install cec-utils
sudo apt clean
sudo su
mount /dev/mmcblk0p1 /mnt
echo hdmi_ignore_cec_init=1 >> /mnt/config.txt
echo hdmi_ignore_cec_init=1 >> /boot/config.txt
umount /mnt
^D
# Cron
crontab -e
0 7 * * MON-FRI echo on 0 | cec-client -s >/dev/null 2>&1
0 18 * * MON-FRI echo standby 0 | cec-client -s >/dev/null 2>&1
# SleepWatcher on macOS
brew install sleepwatcher
sudo cp /usr/local/opt/sleepwatcher/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
sudo launchctl load /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
sudo /usr/local/sbin/sleepwatcher -d -t 18000 \
-i "ssh -f pi@rpiz -- 'echo standby 0 | cec-client -s -d 1 >/dev/null 2>&1'" \
-R "ssh -f pi@rpiz -- 'echo on 0 | cec-client -s -d 1 >/dev/null 2>&1'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment