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
check process repcached | |
matching "repcached -d -m" | |
start program = "/usr/bin/repcached -d -m 256 -p 11211 -u root -P /var/run/memcachedrep.pid -l$ | |
stop program = "/bin/kill -9 $(pidof repcached)" | |
if failed host 172.16.62.104 port 11211 type tcp then restart |
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
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep x11 | sed s/install//` | |
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep python | sed s/install//` | |
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep sound | sed s/install//` | |
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep gnome | sed s/install//` | |
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep lxde | sed s/install//` | |
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep gtk | sed s/install//` | |
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep desktop | sed s/install//` | |
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep gstreamer | sed s/install//` | |
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep avahi | sed s/install//` | |
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | gr |
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
echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | sudo tee /etc/apt/apt.conf.d/clean |
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
sed -i 's/PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config | |
service ssh restart |
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
echo "Acquire::http::Proxy \"http://<ip>:<port>\";" > /etc/apt/apt.conf.d/01proxy |
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
echo "Starting letsencrypt - please wait a while.. might take a couple of minutes!" | |
letsencrypt \ | |
--standalone \ | |
--duplicate certonly \ | |
-d z.example.com \ | |
-d y.example.com \ | |
-d x.example.com \ | |
--standalone-supported-challenges http-01 --http-01-port 54321 |
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
nano ~/.ssh/config | |
add at the end of file: | |
Host favorite | |
HostName some.host.org | |
Port 3563 | |
then you can use ssh user@favorite |
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
echo "SUBSYSTEM==\"tty\", ATTRS{idVendor}==\"0658\", ATTRS{idProduct}==\"0200\", SYMLINK+=\"zwave\", RUN+=\"/bin/x-hass-restart-zwave-replug\"" > /etc/udev/rules.d/99-zwave-stick.rules |
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/bash | |
LOCALPORT=/dev/zwave | |
REMOTEPORT=10.11.12.222:7676 | |
TIMEWAIT=10 | |
echo "checking socat..." | |
if [[ $(ps ax | grep -v grep | grep tcp:$REMOTEPORT | wc -l) -eq 0 ]] | |
then | |
echo " ... restarting" | |
/usr/bin/socat pty,link=$LOCALPORT,raw,group=root,mode=777 tcp:$REMOTEPORT & |
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/bash | |
# based on | |
# https://learn.adafruit.com/read-only-raspberry-pi/ | |
# CREDIT TO THESE TUTORIALS: | |
# petr.io/en/blog/2015/11/09/read-only-raspberry-pi-with-jessie | |
# hallard.me/raspberry-pi-read-only | |
# k3a.me/how-to-make-raspberrypi-truly-read-only-reliable-and-trouble-free | |
if [ $(id -u) -ne 0 ]; then |