Table of contents
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 off: https://gist.github.com/naholyr/4275302 | |
set -e | |
template=$'#!/bin/sh\n### BEGIN INIT INFO\n# Provides: <NAME>\n# Required-Start: $local_fs $remote_fs $network $named $time $syslog\n# Required-Stop: $local_fs $remote_fs $network $named $time $syslog\n# Default-Start: 2 3 4 5\n# Default-Stop: 0 1 6\n# Description: <DESCRIPTION>\n### END INIT INFO\n\nSCRIPT=<COMMAND>\nRUNAS=<USERNAME>\n\nPIDFILE=/var/run/<NAME>.pid\nLOGFILE=/var/log/<NAME>.log\n\nstart() {\n if [ -f /var/run/$PIDNAME ] && kill -0 $(cat /var/run/$PIDNAME); then\n echo \'Service already running\' >&2\n return 1\n fi\n echo \'Starting service…\' >&2\n local CMD="$SCRIPT &> \\"$LOGFILE\\" & echo \\$!"\n su -c "$CMD" $RUNAS > "$PIDFILE"\n echo \'Service started\' >&2\n}\n\nstop() {\n if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then\n echo \'Service not running\' >&2\n return 1\n fi\n echo \'Stopping service…\' >&2\n pkill -P $(cat "$PIDFILE") && rm -f "$PIDFILE"\n |
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 | |
# /etc/init.d/fan | |
### BEGIN INIT INFO | |
# Provides:fan | |
# Required-Start:$remote_fs $syslog | |
# Required-Stop:$remote_fs $syslog | |
# Default-Start:2 3 4 5 | |
# Default-Stop:0 1 6 |
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
#!/usr/bin/python3 | |
import sys | |
import time | |
from gpiozero import LED # doc: https://gpiozero.readthedocs.io/ | |
from systemd import journal | |
# define the GPIO to control the transistor's B pin | |
fan = LED(17) | |
def cpu_temp(): |
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
"use strict"; | |
var addEventCallback = require('addEventCallback'); | |
var callInWindow = require('callInWindow'); | |
var makeString = require('makeString'); | |
addEventCallback(function (containerId, eventData) { | |
var tags = eventData.tags.map(function (tag) { | |
return { | |
containerId: containerId, |
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
[ | |
"Albania", | |
"Andorra", | |
"Austria", | |
"Belarus", | |
"Belgium", | |
"Bosnia and Herzegovina", | |
"Bulgaria", | |
"Croatia", | |
"Cyprus", |