Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# install:
# curl -s https://gist.githubusercontent.com/giddyhup/7013eb8d022e0ce94d68519d3cc32f68/raw/c77828c8b53f57840ef728a9923c6db942256e89/installohmyzsh_unattended.sh | bash
usershell=$(grep $USER /etc/passwd | grep zsh)
if [[ $? == 0 ]]; then
echo "zsh is already the user's shell, to stay on the safe side we're aborting"
exit
fi
if sudo -n true 2>/dev/null; then
# execute with sudo or as root
systemctl disable NetworkManager
systemctl stop NetworkManager
systemctl disable NetworkManager-wait-online.service
systemctl stop NetworkManager-wait-online.service
systemctl disable NetworkManager-dispatcher.service
systemctl stop NetworkManager-dispatcher.service
systemctl disable network-manager.service
systemctl stop network-manager.service
systemctl enable systemd-networkd
#!/bin/bash
export DISPLAY=:0
while getopts ":ofb:" opt; do
case $opt in
o) # on
sudo sh -c "echo 0 > /sys/class/backlight/rpi_backlight/bl_power"
;;
f) # off
sudo sh -c "echo 1 > /sys/class/backlight/rpi_backlight/bl_power"