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
# Steps to install ThingSpeak server on Raspbian Jessie, based on info taken from, in no particular order: | |
# https://gist.github.com/blacktm/8302741 | |
# https://gist.github.com/sourceperl/b84ab0d723bda21321fc/ | |
# https://github.com/iobridge/thingspeak | |
# http://www.esp8266-projects.com/2015/11/raspberry-pi2-thingspeak-on-jessie.html | |
# http://www.esp8266-projects.com/2015/05/raspberry-pi-standalone-thingspeak.html | |
# http://www.cnx-software.com/2016/12/07/how-to-install-thingspeak-in-ubuntu-16-04/ | |
# install requirements | |
sudo apt-get -y update |
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 update | |
sudo apt-get -y install deborphan > /dev/null 2>&1 | |
sudo apt-get -y upgrade | |
sudo apt-get -y dist-upgrade | |
deborphan -sz | |
sudo apt-get -y autoremove | |
sudo apt-get -y remove --purge $(deborphan) | |
sudo apt-get -y clean | |
sudo chown -R pi.pi ~/.node-red/node_modules |
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 | |
# Starts and stops Blynk-Server | |
# /etc/init.d/blynk | |
### BEGIN INIT INFO | |
# Provides: Blynk-Server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Blynk-Server initialisation |
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
# add to .bashrc | |
# format: |current time|user (white: normal, red: root)@hostname (green: last command successful, red: error occurred):[current folder]-(num files and total size)-Cores: (num active cores) at (cpu temperature)> | |
# CPU readings thanks to DietPi (/DietPi/dietpi/dietpi-cpuinfo) | |
CPU_TEMP_CURRENT='Unknown' | |
CPU_TEMP_PRINT='Unknown' | |
ACTIVECORES=$(grep -c processor /proc/cpuinfo) | |
#Array to store possible locations for temp read. | |
aFP_TEMPERATURE=( |
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
# to remove old version: | |
sudo dpkg -r grafana grafana-data | |
sudo apt-get -y autoremove | |
sudo rm -rf /etc/grafana /var/lib/grafana /var/log/grafana /etc/rc5.d/S02grafana /etc/rc6.d/K01grafana /etc/rc3.d/S02grafana /etc/rc2.d/S02grafana /etc/rc4.d/S02grafana /etc/rc1.d/K01grafana /etc/default/grafana /etc/init.d/grafana /etc/rc0.d/K01grafana /usr/lib/systemd/system/grafana-server.service /etc/systemd/system/grafana-server.service /etc/systemd/system/grafana.service /etc/systemd/system/multi-user.target.wants/grafana.service /etc/apt/sources.list.d/grafana.list /etc/default/grafana-server /etc/init.d/grafana-server /var/lib/systemd/deb-systemd-helper-enabled/grafana-server.service /var/lib/systemd/deb-systemd-helper-enabled/grafana.service.dsh-also /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/grafana.service /var/lib/systemd/deb-systemd-helper-masked/grafana.service /home/pi/grafana_2.6.0+dfsg-3_armhf.deb /home/pi/grafana-data_2.6.0+dfsg-3_all.deb | |
# to install latest: | |
curl https://bintray. |
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
# if you don't have it, install ccze | |
sudo apt-get install -y ccze | |
# add this alias at the end of your $HOME/.bashrc | |
# idea from: https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-log | |
alias nrlog="sudo journalctl -f -n 50 -u nodered -o cat | ccze -A" | |
# source .bashrc, to make the alias available immediately, or just reboot your system... | |
. $HOME/.bashrc |
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
lib_name='trap' | |
lib_version=20121026 | |
stderr_log="/dev/shm/stderr-$(date +%s).log" | |
# | |
# TO BE SOURCED ONLY ONCE: | |
# | |
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~## |
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
git clone https://github.com/bemeurer/beautysh | |
cd beautysh | |
sudo python setup.py install | |
cd | |
sudo rm -rf beautysh | |
beautysh -f script.sh |
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 | |
# credits to DietPi | |
# to check it constantly, run: watch bash temp.sh | |
CPU_TEMP_CURRENT='Unknown' | |
CPU_TEMP_PRINT='Unknown' | |
ACTIVECORES=$(grep -c processor /proc/cpuinfo) | |
#Array to store possible locations for temp read. | |
aFP_TEMPERATURE=( |
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 | |
# | |
# Watch your Pi! RPi foundation knows that Micro USB for DC-IN | |
# is sh*t but also doesn't give a sh*t. Voltage drops caused by | |
# average USB cables cause all sorts of instabilities and also | |
# data corruption but instead of fixing the problem they masked | |
# it in their 'firmware'. The main CPU on the Raspberry monitors | |
# voltage drops and then acts on accordingly. If heavy voltage | |
# drops directly after startup are monitored the firmware lowers | |
# the core voltage available to CPU cores and also caps CPU |
OlderNewer