Then symlinked them back to /System/bin. This puts these scripts under version control
--- /dev/null
+#!/bin/bash
+#
+# Simple script to backup email store
+backupDir=/System/Backups/Email
+
+exclusions=--exclude=.*
+
+ssh defaria.com tar $exclusions -cjf - mail > $backupDir/mail.tar.bz2.$$
+
+mv $backupDir/mail.tar.bz2.$$ $backupDir/mail.tar.bz2
--- /dev/null
+#!/bin/bash
+expireTime=1200
+systems="\
+ earth\
+ mars\
+ defaria.com\
+"
+
+function notify {
+ #zenity --notification --text "$1" 2> /dev/null
+ notify-send --expire-time=$expireTime "$1"
+}
+
+function yesno {
+ question=$1
+
+ zenity --question --text "$question" --width=300 2> /dev/null
+}
+
+update=$1;
+
+for system in $systems; do
+ notify "Checking $system for updates"
+ ssh $system sudo apt-get -qq update
+ ssh $system apt list --upgradeable 2> /dev/null | grep -v "^Listing" > /tmp/check4update.list
+
+ if [ $(wc -l /tmp/check4update.list 2> /dev/null | cut -f1 -d' ') -ne 0 ]; then
+ cat /tmp/check4update.list
+
+ if yesno "There are updates for $system\nApply them now?" ]; then
+ ssh $system sudo /opt/clearscm/bin/update-system
+ else
+ notify "$system not updated"
+ fi
+ else
+ notify "$system is up to date"
+ fi
+
+ rm -f /tmp/check4update.list
+done
--- /dev/null
+#!/bin/bash
+dropbox stop > /dev/null 2>&1
+dbus-launch dropbox start -i > /dev/null 2>&1
--- /dev/null
+#!/bin/bash
+# Fixes screen when the gnome-panel gets stuck on the right side.
+xrandr --output HDMI-0 --primary
--- /dev/null
+#!/bin/bash
+#
+# Simple script to restart gnome-panel since it keeps dying on me.
+gnome-panel --replace > /dev/null 2>&1 &
--- /dev/null
+#!/bin/bash
+
+codename=$(cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2)
+
+if [ "$codename" == "impish" ]
+then
+source="/usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource"
+else
+echo "
+----------------------------------------
+Sorry, Script is only for Ubuntu 21.10
+Exiting...
+----------------------------------------"
+exit 1
+fi
+
+pkg=$(dpkg -l | grep libglib2.0-dev >/dev/null && echo "yes" || echo "no")
+if [ "$pkg" == "no" ]
+then
+echo "
+-----------------------------------------------------------------------------------------------------
+Sorry, the package 'libglib2.0-dev' is not installed. Install the package and then run this Script.
+For now, Exiting...
+-----------------------------------------------------------------------------------------------------"
+exit 1
+fi
+
+############################################################################################
+case "$1" in ###############################################################################
+############################################################################################
+--set)
+############################################################################################
+
+if [ "$UID" != "0" ]
+then
+echo "This Script must be run with sudo"
+exit 1
+fi
+
+echo "
+-------------------------------------------------------------------------------------------------------
+Please note that after setting login screen background,
+>>>>>>>>> Reboot is highly recomonded to see the changes <<<<<<<<<<<<
+
+Do you want to proceed now? [Yes/no] Type n to exit, or press enter to proceed.
+-------------------------------------------------------------------------------------------------------"
+read answer
+
+if [ "$answer" == "n" ] || [ "$answer" == "N" ]
+then
+echo "Exiting..."
+exit 1
+fi
+
+echo "
+Please Choose any one number from below.
+-------------
+1. for Image
+2. for Color
+-------------"
+read a
+
+if [ -z $a ]
+then
+echo "Option is not selected.
+Exiting..."
+exit 1
+fi
+
+if [ "$a" == "1" ]
+then
+echo "Enter Image Path for Login Screen
+----------------------------------------------------
+Example1: /usr/share/backgrounds/2.jpg
+Example2: /usr/local/share/backgrounds/spaceship.png
+Example3: /home/impish/Downloads/myBG.jpeg
+----------------------------------------------------"
+read b
+
+elif [ "$a" == "2" ]
+then
+echo "
+Enter Hex Color Code for Login Screen (you may note down colors of your choice from this link https://www.color-hex.com/)
+-------------------------------------------------------------------------------------------------------------------------
+Example1: #00ff00
+Example2: #fca
+Example3: #456789
+Example4: #123
+Example5: #FF00FF
+-------------------------------------------------------------------------------------------------------------------------"
+read c
+fi
+
+if [ -z $b ] && [ -z $c ]
+then
+echo "Input is not Provided.
+Exiting..."
+exit 1
+fi
+
+if [ -z $c ]
+then
+color="#042320"
+else
+color="$c"
+fi
+
+if ! [ -z $c ]
+then
+ if ! [[ $c =~ ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ ]]; then
+ echo "
+------------------------------------------------------------------------------------------------------------
+ Sorry it is not a valid Hex color, Please choose the valid HEX color first and then run this script.
+------------------------------------------------------------------------------------------------------------"
+ exit 1
+ fi
+fi
+
+if ! [ -z $b ]
+then
+ if ! [ -e $b ]; then
+ echo "
+---------------------------------------------------------------------------------------------------
+Image path you entered does not exist, script defined background color is going to be used for now.
+Please notedown the correct file path of the Image and then run this script.
+---------------------------------------------------------------------------------------------------"
+ fi
+fi
+
+prefix="/org/gnome/shell/theme"
+dest="/usr/local/share/gnome-shell/theme/impishgdm"
+
+install -D /dev/null $dest/gdm.css
+install -D /dev/null $dest/impishgdm.gresource.xml
+install -d $dest/icons/scalable/actions
+
+gresource extract $source $prefix/gdm.css > $dest/original.css
+gresource extract $source $prefix/checkbox.svg > $dest/checkbox.svg
+gresource extract $source $prefix/checkbox-off.svg > $dest/checkbox-off.svg
+gresource extract $source $prefix/checkbox-focused.svg > $dest/checkbox-focused.svg
+gresource extract $source $prefix/checkbox-off-focused.svg > $dest/checkbox-off-focused.svg
+gresource extract $source $prefix/toggle-on.svg > $dest/toggle-on.svg
+gresource extract $source $prefix/toggle-off.svg > $dest/toggle-off.svg
+gresource extract $source $prefix/icons/scalable/actions/pointer-drag-symbolic.svg > $dest/icons/scalable/actions/pointer-drag-symbolic.svg
+gresource extract $source $prefix/icons/scalable/actions/keyboard-enter-symbolic.svg > $dest/icons/scalable/actions/keyboard-enter-symbolic.svg
+gresource extract $source $prefix/icons/scalable/actions/keyboard-hide-symbolic.svg > $dest/icons/scalable/actions/keyboard-hide-symbolic.svg
+gresource extract $source $prefix/icons/scalable/actions/pointer-secondary-click-symbolic.svg > $dest/icons/scalable/actions/pointer-secondary-click-symbolic.svg
+gresource extract $source $prefix/icons/scalable/actions/keyboard-shift-filled-symbolic.svg > $dest/icons/scalable/actions/keyboard-shift-filled-symbolic.svg
+gresource extract $source $prefix/icons/scalable/actions/keyboard-caps-lock-filled-symbolic.svg > $dest/icons/scalable/actions/keyboard-caps-lock-filled-symbolic.svg
+gresource extract $source $prefix/icons/scalable/actions/pointer-primary-click-symbolic.svg > $dest/icons/scalable/actions/pointer-primary-click-symbolic.svg
+gresource extract $source $prefix/icons/scalable/actions/keyboard-layout-filled-symbolic.svg > $dest/icons/scalable/actions/keyboard-layout-filled-symbolic.svg
+gresource extract $source $prefix/icons/scalable/actions/eye-not-looking-symbolic.svg > $dest/icons/scalable/actions/eye-not-looking-symbolic.svg
+gresource extract $source $prefix/icons/scalable/actions/pointer-double-click-symbolic.svg > $dest/icons/scalable/actions/pointer-double-click-symbolic.svg
+gresource extract $source $prefix/icons/scalable/actions/eye-open-negative-filled-symbolic.svg > $dest/icons/scalable/actions/eye-open-negative-filled-symbolic.svg
+
+echo '@import url("resource:///org/gnome/shell/theme/original.css");
+ #lockDialogGroup {
+ background: '$color' url(file://'$b');
+ background-repeat: no-repeat;
+ background-size: cover;
+ background-position: center; }' > $dest/gdm.css
+
+echo '<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/shell/theme">
+ <file>original.css</file>
+ <file>gdm.css</file>
+ <file>toggle-off.svg</file>
+ <file>checkbox-off.svg</file>
+ <file>toggle-on.svg</file>
+ <file>checkbox-off-focused.svg</file>
+ <file>checkbox-focused.svg</file>
+ <file>checkbox.svg</file>
+ <file>icons/scalable/actions/pointer-drag-symbolic.svg</file>
+ <file>icons/scalable/actions/keyboard-enter-symbolic.svg</file>
+ <file>icons/scalable/actions/keyboard-hide-symbolic.svg</file>
+ <file>icons/scalable/actions/pointer-secondary-click-symbolic.svg</file>
+ <file>icons/scalable/actions/keyboard-shift-filled-symbolic.svg</file>
+ <file>icons/scalable/actions/keyboard-caps-lock-filled-symbolic.svg</file>
+ <file>icons/scalable/actions/pointer-primary-click-symbolic.svg</file>
+ <file>icons/scalable/actions/keyboard-layout-filled-symbolic.svg</file>
+ <file>icons/scalable/actions/eye-not-looking-symbolic.svg</file>
+ <file>icons/scalable/actions/pointer-double-click-symbolic.svg</file>
+ <file>icons/scalable/actions/eye-open-negative-filled-symbolic.svg</file>
+ </gresource>
+</gresources>' > $dest/impishgdm.gresource.xml
+
+cd $dest
+glib-compile-resources impishgdm.gresource.xml
+mv impishgdm.gresource ..
+rm -r $dest
+update-alternatives --quiet --install /usr/share/gnome-shell/gdm-theme.gresource gdm-theme.gresource /usr/local/share/gnome-shell/theme/impishgdm.gresource 0
+update-alternatives --quiet --set gdm-theme.gresource /usr/local/share/gnome-shell/theme/impishgdm.gresource
+
+check=$(update-alternatives --query gdm-theme.gresource | grep Value | grep /usr/local/share/gnome-shell/theme/impishgdm.gresource >/dev/null && echo "pass" || echo "fail")
+if [ "$check" == "pass" ]
+then
+echo "
+ ---------
+ |Success|
+ ---------"
+else
+echo Failure
+exit 1
+fi
+;;
+############################################################################################
+--reset) ###################################################################################
+############################################################################################
+
+if [ -e /usr/local/share/gnome-shell/theme/impishgdm.gresource ]
+then
+rm /usr/local/share/gnome-shell/theme/impishgdm.gresource
+update-alternatives --quiet --set gdm-theme.gresource "$source"
+cd /usr/local/share
+rmdir --ignore-fail-on-non-empty -p gnome-shell/theme
+echo "
+ ---------------
+ |Reset Success|
+ ---------------"
+else
+echo "
+-----------------------------------------------------------------------------
+No need, Already Reset. (or unlikely background is not set using this Script.)
+-----------------------------------------------------------------------------"
+exit 1
+fi
+;;
+############################################################################################
+*) #########################################################################################
+############################################################################################
+echo "Use the parameter '--set' or '--reset'; example: './impishgdm --set' or './impishgdm --reset'"
+exit 1
+esac
--- /dev/null
+#!/bin/bash
+#
+# Simple script to save an image in the clipboard to a file
+save_file=/tmp/image.jpg
+
+xclip -selection clipboard -t image/jpeg -o > $save_file
--- /dev/null
+#!/bin/bash
+host=$(hostname)
+
+if [ "$1" = "-a" ]; then
+ if [ $host = "mars" ]; then
+ setsid ssh earth lightsout.sh &
+ elif [ $host = "earth" ]; then
+ setsid ssh mars lightsout.sh &
+ fi
+fi
+
+if [ $host = "earth" ]; then
+ export DISPLAY=:1
+else
+ export DISPLAY=:0
+fi
+
+sleep 2
+/usr/local/bin/setdpms.sh
+xset dpms force off
--- /dev/null
+#!/bin/bash
+# This will set the audio system to be able to record both the mic and what
+# is going on in the speakers. This might cause feedback to turn down the
+# speakers. Also, you'll probably here an echo, ugh.
+#
+#
+module=$(pactl load-module module-loopback latency_msec=1)
+echo "Note you must do pactl unload-module $module to turn this off"
+
--- /dev/null
+#!/bin/sh
+if [ "$1" = "on" ]; then
+ pactl load-module module-loopback
+elif [ "$1" = "off" ]; then
+ pactl unload-module module-loopback
+else
+ echo "Usage $0 <on|off>"
+ exit 1
+fi
+
--- /dev/null
+#!/bin/bash
+
+# We need our sj function...
+source ~/.rc/functions
+
+# Get the PID of the running setbg process
+setbgPID=$(sj setbg | awk '{print $2}')
+
+# Check to make sure it's not blank, meaning no setbg process running
+if [ -s "$setbgPID" ]; then
+ echo "There is no setbg process running"
+ exit 1
+fi
+
+# Check to see if setbgPID has multiple processes. Multiple processes
+# should never happen but if we get more than one PID back then they
+# will be listed side by side with spaces, so check that.
+echo $setbgPID | grep -q ' '
+
+if [ $? = 0 ]; then
+ echo "There are multiple setbg processes???"
+ exit 1
+fi
+
+setbgPicture=$(cat ~/.setbg)
+rm "$setbgPicture" && kill -USR1 $setbgPID
--- /dev/null
+#/bin/bash
+# Need to set PULSE_RUNTIME_PATH under cron
+export PULSE_RUNTIME_PATH=/run/user/$(id -u)/pulse
+pactl -- set-sink-volume @DEFAULT_SINK@ $1%
--- /dev/null
+#!/bin/bash
+timeout=5000 # 5 seconds
+
+# This just toggles the creation of the /opt/clearscm/bin/shh file
+if [ -f /opt/clearscm/bin/shh ]; then
+ rm /opt/clearscm/bin/shh
+ cp ~/.icons/ShhOff.png ~/.icons/Shh.png
+ notify-send -t $timeout "Announcements turned on"
+else
+ touch /opt/clearscm/bin/shh
+ cp ~/.icons/ShhOn.png ~/.icons/Shh.png
+ # Note that a -t 0 will keep the notification up. This way we can
+ # be visually reminded that we are not receiving audio announcements
+ notify-send -t 0 "Announcements turned off"
+fi
--- /dev/null
+#!/bin/bash
+eog "$(cat ~/.setbg)"
--- /dev/null
+#!/usr/bin/python3
+# -*- coding: utf-8 -*-
+import re
+import sys
+from speedtest import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
--- /dev/null
+#!/bin/sh
+exec sudo -u andrew /System/bin/speedtest $@
--- /dev/null
+#!/bin/bash
+mkdir ~/system76
+journalctl > ~/system76/journal.log
+dmesg > ~/system76/dmesg.log
+cp /var/log/Xorg.1.log ~/system76/Xorg.1.log
+sudo dmidecode > ~/system76/demidecode
+sudo lspci -vv > ~/system76/lscpi.log
+sudo lsusb -vv > ~/system76/lsusb.log
+uname -a > ~/system76/uname.log
+df -h / > ~/system76/df
+lsblk -f > ~/system76/lsblk
+cp /etc/fstab ~/system76/fstab
+cp /etc/os-release ~/system76/os-release
+tar czf system76-log.tgz ~/system76/*
+rm ~/system76/*
+rmdir ~/system76
--- /dev/null
+#!/bin/bash
+# Test internet speed
+
+speedtest=/System/bin/speedtest.sh
+datafile=/System/Data/$(hostname).speedtest.csv
+
+# If creating file initially add csv headers
+if [ ! -f $datafile ]; then
+ $speedtest --csv-header > $datafile
+fi
+
+# Now test speed
+$speedtest --csv >> $datafile
--- /dev/null
+#!/bin/bash
+#
+# Simple script to use ssh to tunnel ports for SMTP (1025 -> 25) to
+# defaria.com so I can read and write email to my home server.
+#
+# Note -Nf puts ssh in the background after establishing the tunnel.
+#
+# This is for use on Synology only
+tunnel_running=$(ps -ef | grep ssh | grep defaria.com:25)
+
+if [ -z "$tunnel_running" ]; then
+ ssh -Nf -L192.168.0.251:1025:defaria.com:25 andrew@defaria.com
+fi
--- /dev/null
+#!/bin/sh
+#
+# This is for use on Synology only
+exec sudo -u andrew /System/bin/tunnel $@
--- /dev/null
+#!/bin/bash
+
+# Odd. Seems the following causes wget to use IPv6 instead of IPv4. Well
+# recently we turned off IPv6 because we suspect this causes our WiFi
+# dropout problem. But then this hangs.
+#wget -O /tmp/calendar.$$.ics 'https://www.google.com/calendar/ical/adefaria%40gmail.com/public/basic.ics' >> /tmp/updateCalendar.$$.log 2>&1
+wget --no-check-certificate -O /tmp/calendar.$$.ics 'https://172.217.11.174/calendar/ical/adefaria%40gmail.com/public/basic.ics' >> /tmp/updateCalendar.$$.log 2>&1
+wget -O /tmp/meetups.$$.ics 'http://www.meetup.com/events/ical/10426135/8dfdd0ffaaedecf720c5faf0cf3871b7ee5f5c1e/going' >> /tmp/updateCalendar.$$.log 2>&1
+
+wget -4 -O /tmp/tripit.$$.ics 'http://www.tripit.com/feed/ical/private/06C4F90D-EFEFB9C5FDB17EC5FCB327DE31A54D96/tripit.ics' >> /tmp/updateCalendar.$$.log 2>&1
+
+# Now let's combine the files. First strip off the END:CALENDAR from the main
+# file.
+filesize=$(wc -l /tmp/calendar.$$.ics | cut -f1 -d' ')
+let lines=filesize-1
+head -n $lines /tmp/calendar.$$.ics > /tmp/calendar2.$$.ics
+mv /tmp/calendar2.$$.ics /tmp/calendar.$$.ics
+
+# Now extract the middle of the next calendar
+# Note, if we have nothing RSVPed here for Meetup then the file should be skipped.
+# We will get an .ics file but it'll be short - less than 27 lines
+filesize=$(wc -l /tmp/meetups.$$.ics | cut -f1 -d' ')
+
+if [ $filesize -gt 27 ]; then
+ let lines=filesize-27
+
+ # Get the top portion...
+ tail -n $lines /tmp/meetups.$$.ics > /tmp/meetups2.$$.ics
+
+ # Now strip off END:VCALENDAR
+ let lines=filesize-27-1
+
+ head -n $lines /tmp/meetups2.$$.ics >> /tmp/calendar.$$.ics
+
+ # Clean up meetups2
+ rm -f /tmp/meetups2.$$.ics
+fi
+
+# Now extract the middle of the next calendar
+filesize=$(wc -l /tmp/tripit.$$.ics | cut -f1 -d' ')
+
+if [ $filesize -gt 27 ]; then
+ let lines=filesize-27
+
+ # Get the top portion...
+ tail -n $lines /tmp/tripit.$$.ics > /tmp/tripit2.$$.ics
+
+ # Now strip off END:VCALENDAR
+ let lines=filesize-27-1
+
+ head -n $lines /tmp/tripit2.$$.ics >> /tmp/calendar.$$.ics
+
+ # Cleanup tripit2
+ rm -f /tmp/tripit2.$$.ics
+fi
+
+# Now add END:VCALENDAR to calendar.ics
+echo "END:VCALENDAR" >> /tmp/calendar.$$.ics
+
+# Move into place
+mv /tmp/calendar.$$.ics ~/Documents/calendar.ics
+
+# Get rid of stupid CRs
+dos2unix -q ~/Documents/calendar.ics
+
+# Restart rainlendar2
+export DISPLAY=:1
+killall rainlendar2
+rainlendar2 > /tmp/rainlendar2.log 2>&1 &
+
+# Cleanup
+rm -rf \
+ /tmp/meetups.$$.ics \
+ /tmp/tripit.$$.ics \
+ /tmp/updateCalendar.$$.log
--- /dev/null
+#!/bin/bash
+ssh home "cd /opt/songbook && git pull && cd /opt/media && git pull"