summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/morse/COPYING14
-rw-r--r--modules/morse/README32
-rwxr-xr-xmodules/morse/morse.sh160
-rw-r--r--modules/noise/Makefile16
-rw-r--r--modules/noise/TODO60
-rwxr-xr-xmodules/noise/cron/bin/zeit18
-rwxr-xr-xmodules/noise/init.d/noise48
-rwxr-xr-xmodules/noise/modules/cat14
-rwxr-xr-xmodules/noise/modules/chat33
-rwxr-xr-xmodules/noise/modules/date6
-rwxr-xr-xmodules/noise/modules/echo6
-rwxr-xr-xmodules/noise/modules/ein_mal_eins37
-rwxr-xr-xmodules/noise/modules/espeak34
-rwxr-xr-xmodules/noise/modules/help24
-rwxr-xr-xmodules/noise/modules/join15
-rwxr-xr-xmodules/noise/modules/lang22
-rwxr-xr-xmodules/noise/modules/mpc14
-rwxr-xr-xmodules/noise/modules/names22
-rwxr-xr-xmodules/noise/modules/nick10
-rwxr-xr-xmodules/noise/modules/part15
-rwxr-xr-xmodules/noise/modules/ping24
-rwxr-xr-xmodules/noise/modules/play36
-rwxr-xr-xmodules/noise/modules/pong26
-rwxr-xr-xmodules/noise/modules/query23
-rwxr-xr-xmodules/noise/modules/send_to_channel17
-rwxr-xr-xmodules/noise/modules/sendmail55
-rwxr-xr-xmodules/noise/modules/shackstatus104
-rwxr-xr-xmodules/noise/modules/sleep10
-rwxr-xr-xmodules/noise/modules/stream64
-rwxr-xr-xmodules/noise/modules/temp56
-rwxr-xr-xmodules/noise/modules/test13
-rwxr-xr-xmodules/noise/modules/twitter125
-rwxr-xr-xmodules/noise/modules/vvs17
-rwxr-xr-xmodules/noise/modules/wall8
-rwxr-xr-xmodules/noise/modules/zeit19
-rwxr-xr-xmodules/noise/noise182
-rwxr-xr-xmodules/noise/noise-as-user4
-rwxr-xr-xmodules/noise/noise-server4
-rw-r--r--modules/retiolum/README13
-rwxr-xr-xmodules/retiolum/build_arch.sh14
-rwxr-xr-xmodules/retiolum/build_debian.sh11
-rwxr-xr-xmodules/retiolum/build_ec2.sh16
-rw-r--r--modules/retiolum/build_no.de.sh1
-rw-r--r--modules/retiolum/hosts/Lassulus9
-rw-r--r--modules/retiolum/hosts/alphalabs9
-rw-r--r--modules/retiolum/hosts/also9
-rw-r--r--modules/retiolum/hosts/foobaz8
-rw-r--r--modules/retiolum/hosts/kaah11
-rw-r--r--modules/retiolum/hosts/krebs10
-rw-r--r--modules/retiolum/hosts/miefda9019
-rw-r--r--modules/retiolum/hosts/miefdahome9
-rw-r--r--modules/retiolum/hosts/miefdat10
-rw-r--r--modules/retiolum/hosts/no_omo9
-rw-r--r--modules/retiolum/hosts/pa_sharepoint7
-rw-r--r--modules/retiolum/hosts/pfleidi9
-rw-r--r--modules/retiolum/hosts/pornocauster9
-rw-r--r--modules/retiolum/hosts/supernode10
-rw-r--r--modules/retiolum/hosts/tart6
-rwxr-xr-xmodules/retiolum/install.sh68
-rwxr-xr-xmodules/streams/deepmix3
-rwxr-xr-xmodules/streams/groove4
-rw-r--r--modules/temper/.gitignore1
-rw-r--r--modules/temper/99-tempsensor.rules1
-rw-r--r--modules/temper/Makefile14
-rw-r--r--modules/temper/temper.c277
-rw-r--r--modules/temper/temper.h39
-rwxr-xr-xmodules/webcams/cam1.sh2
67 files changed, 1985 insertions, 0 deletions
diff --git a/modules/morse/COPYING b/modules/morse/COPYING
new file mode 100644
index 00000000..d28e4178
--- /dev/null
+++ b/modules/morse/COPYING
@@ -0,0 +1,14 @@
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ Version 23, December 1984
+
+ Copyright (C) 2011 tv@shackspace
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
+
diff --git a/modules/morse/README b/modules/morse/README
new file mode 100644
index 00000000..67951c00
--- /dev/null
+++ b/modules/morse/README
@@ -0,0 +1,32 @@
+MORSE(1) MORSE(1)
+
+NAME
+ morse.sh - morse code generator
+
+SYNOPSIS
+ morse [-l N] [-f N] [-c|-x] [text...]
+
+DESCRIPTION
+ Generate visible or audible from text or stdin.
+
+OPTIONS
+ -l N use N milliseconds as length of dit. Default: 60 ms
+
+ -f N beep at N Hz. Default: 2000 Hz
+
+ -c compile only. Morse will output morse-executable morse code.
+
+ -x execute only. Interpret text as morse code, i.e. do not try
+ to convert text or stdin.
+
+BUGS
+ None.^_^
+
+REPORTING BUGS
+ Please use Github's issue tracking system.
+
+AUTHOR
+ This program was written by tv@shackspace and is distributed under the
+ Do What The Fuck You Want To Public License.
+
+ April 2011 MORSE(1)
diff --git a/modules/morse/morse.sh b/modules/morse/morse.sh
new file mode 100755
index 00000000..c84538ca
--- /dev/null
+++ b/modules/morse/morse.sh
@@ -0,0 +1,160 @@
+#! /bin/sh
+set -euf
+
+freq=2000
+dit=60
+mode=compile+execute
+
+## plain stupid options "parser"
+while test $# -gt 0; do
+ case "$1" in
+ (-l) dit=$2; shift 2;;
+ (-f) freq=$2; shift 2;;
+ (-c) mode=compile; shift 1;;
+ (-x) mode=execute; shift 1;;
+ (*) break 2;;
+ esac
+done
+
+# Ein Dah ist dreimal so lang wie ein Dit.
+dah=`echo "$dit * 3" | bc`
+
+## Convert a character to the corresponting morse code.
+## Note: any unknown characters are left unaltered.
+char2morse() {
+tr [a-z] [A-Z] |
+sed '
+ # Die Pause zwischen Wörtern beträgt sieben Dits. (1/2)
+ s:[[:space:]]\+::g
+
+ # Zwischen Buchstaben in einem Wort wird eine Pause von Dah eingeschoben.
+ s:[^ ]:& :g
+
+ # Die Pause zwischen Wörtern beträgt sieben Dits. (2/2)
+ s: : :g
+' |
+sed '
+ # Lateinische Buchstaben
+ # Die Pause zwischen zwei gesendeten Symbolen ist ein Dit lang.
+ s:A:· −:g
+ s:B:− · · ·:g
+ s:C:− · − ·:g
+ s:D:− · ·:g
+ s:E:·:g
+ s:F:· · − ·:g
+ s:G:− − ·:g
+ s:H:· · · ·:g
+ s:I:· ·:g
+ s:J:· − − −:g
+ s:K:− · −:g
+ s:L:· − · ·:g
+ s:M:− −:g
+ s:N:− ·:g
+ s:O:− − −:g
+ s:P:· − − ·:g
+ s:Q:− − · −:g
+ s:R:· − ·:g
+ s:S:· · ·:g
+ s:T:−:g
+ s:U:· · −:g
+ s:V:· · · −:g
+ s:W:· − −:g
+ s:X:− · · −:g
+ s:Y:− · − −:g
+ s:Z:− − · ·:g
+' |
+sed '
+ # Ziffern
+ # Die Pause zwischen zwei gesendeten Symbolen ist ein Dit lang.
+ s:0:− − − − −:g
+ s:1:· − − − −:g
+ s:2:· · − − −:g
+ s:3:· · · − −:g
+ s:4:· · · · −:g
+ s:5:· · · · ·:g
+ s:6:− · · · ·:g
+ s:7:− − · · ·:g
+ s:8:− − − · ·:g
+ s:9:− − − − ·:g
+' |
+sed '
+ # TODO Sonder- und Satzzeichen
+ #s:À, Å:· − − · −
+ #s:Ä:· − · −
+ #s:È:· − · · −
+ #s:É:· · − · ·
+ #s:Ö:− − − ·
+ #s:Ü:· · − −
+ #s:ß:· · · − − · ·
+ #s:CH:− − − −
+ #s:Ñ:− − · − −
+ #s:. (AAA) · − · − · −
+ #s:, (MIM) − − · · − −
+ #s:: − − − · · ·
+ #s:; − · − · − ·
+ #s:? (IMI) · · − − · ·
+ #s:- − · · · · −
+ #s:_ · · − − · −
+ #s:( − · − − ·
+ #s:) − · − − · −
+ #s:'\'' · − − − − ·
+ #s:= − · · · −
+ #s:+ · − · − ·
+ #s:/ − · · − ·
+ #s:@ (AC) · − − · − ·
+' |
+sed '
+ # TODO Signale
+ # KA
+ # (Spruchanfang) − · − · −
+ # BT
+ # (Pause) − · · · −
+ # AR
+ # (Spruchende) · − · − ·
+ # VE
+ # (verstanden) · · · − ·
+ # SK
+ # (Verkehrsende) · · · − · −
+ # SOS
+ # (internationaler
+ # (See-)Notruf) · · · − − − · · ·
+ # HH
+ # (Fehler; Irrung;
+ # Wiederholung
+ # ab letztem
+ # vollständigen Wort) · · · · · · · ·
+'
+}
+
+## Convert morse code to beep(1) arguments.
+morse2beeparg() {
+sed "
+ s: : -n -f 1 -l $dit:g
+ s:·: -n -f $freq -l $dit:g
+ s:−: -n -f $freq -l $dah:g
+" |
+ sed '
+ 1s:^:beep -f 1 -l 1:
+'
+}
+
+compile() {
+ char2morse
+}
+
+execute() {
+ `morse2beeparg`
+}
+
+## main - process either [any non-option] arguments or stdin.
+if test $# -gt 0; then
+ echo "$*"
+else
+ cat
+fi |
+case "$mode" in
+ (compile) compile;;
+ (execute) execute;;
+ (compile+execute) compile | execute;;
+ (*) echo bad mode: $mode >&2; exit 23;;
+esac
diff --git a/modules/noise/Makefile b/modules/noise/Makefile
new file mode 100644
index 00000000..ab9709ac
--- /dev/null
+++ b/modules/noise/Makefile
@@ -0,0 +1,16 @@
+
+.PHONY: all
+all: select-target
+
+.PHONY: infest
+infest:
+ apt-get install --yes expect beep alsa-utils ucspi-tcp espeak
+ f=/usr/bin/beep; chown krebs:krebs $$f && chmod 4755 $$f
+ getent passwd noise || useradd noise
+ ln -vsnf /krebs/modules/noise/init.d/noise /etc/init.d/noise
+ update-rc.d -f noise defaults
+ ##
+ amixer sset 'Master' 100 unmute
+ amixer sset 'PCM' 100 unmute
+ amixer sset 'PC Speaker' 100 unmute || \
+ amixer sset 'Beep' 100 unmute
diff --git a/modules/noise/TODO b/modules/noise/TODO
new file mode 100644
index 00000000..a20f74e9
--- /dev/null
+++ b/modules/noise/TODO
@@ -0,0 +1,60 @@
+#### file:noise/TODO
+
+- /channels
+- /hist N -- zum anzeigen von N letzten Nachrichten
+ - Log? Es werden maximal chat_histsize Zeilen gespeichert.
+- Anbindung ans MoinMoin
+- IRC <-> 23.shack - Brücke
+- when nick changes say "You're now known as XXX" to yourself
+- twitter: push new tweets as they arrive to all connected clients with
+ the variable tweet_me set to ON
+
+- Author, Maintainer etc. direkt in die Module in der erweiterten Hilfe, also
+ in /help MODULENAME -> man sollte sich auf ein einheitliches Dokmentierungs-
+ Format einigen.
+ - All modules should contain:
+ - Author(s) w/ e-mail, Copyright, License
+ - Maintainer(s) w/ e-mail
+ - Module-Version
+ - last tested System-Version
+ - we need to export the system version
+- GIT commits tweeten (shack und root)
+- /kick [CHANNEL] # from channel / telnet
+- /ban # :-)
+- /op
+- USER-A: /ping USER-B
+ - USER-B: /pong
+ - write time to USER-{A,B}
+- style-sheets for everything MOAR!!1
+- libraries
+- HTTP-interface
+- /whois, /whoami, /whowas
+- join,part&co. should support multiple channels
+- /TODO,/bug,/issue or something should be added as tracking-system
+- /part should say something like "X has left."
+- /join should say something like "X has joined."
+ # it's obvious that the channels is meant...
+ - or else say: "X has joined channel Y." when we can join more than one
+ channel
+- /part should unset chat_channel (somehow) else keeping /part'ing will
+ broadcast to chat_channel that X has quit...
+- split /twitter into /tweet and X, to make it clear when tweets are fired
+- POP3 mail off googlemail and show them to curious telnetters
+- /set x 23 -> blah $x
+
+- /rewrite -- e.g. /rewrite "!%s" "/play %s" oder sowasi
+- Zugriff per ssh
+- module to standard unix-commands (name like /system)
+ - unix-commands should simply link to system
+- /save TOKEN, /load TOKEN
+- /op # NUR VIA SSH! (s.o.)
+- MODULE-TEST-SUITE [blackbox]
+- sub-modules like /chat-join which may be abbreviated as /join when
+ $default_command is set to /chat, YAY
+ - unclutter /help:
+ - /help -> show all (main) modules
+ - /help MODULE -> show help of MODULE and show all sub-modules
+ - /help MODULE SUB-MODULE -> show help of SUB-MODULE and show all sub^2...
+- watchdog
+
+#### end of file.
diff --git a/modules/noise/cron/bin/zeit b/modules/noise/cron/bin/zeit
new file mode 100755
index 00000000..7282c409
--- /dev/null
+++ b/modules/noise/cron/bin/zeit
@@ -0,0 +1,18 @@
+#! /bin/sh
+
+beep -l 1000 -f 4000
+sleep 1
+/krebs/modules/morse/morse.sh -l 100 -f 700 `date +%k`
+sleep 1
+expect >/dev/null <<EOF
+spawn nc localhost telnet
+expect READY.
+send "/zeit\r"
+expect READY.
+# pitch set to 10
+expect READY.
+# Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono
+expect READY.
+# pitch changed from 10 to 100
+expect READY.
+EOF
diff --git a/modules/noise/init.d/noise b/modules/noise/init.d/noise
new file mode 100755
index 00000000..66be9bd9
--- /dev/null
+++ b/modules/noise/init.d/noise
@@ -0,0 +1,48 @@
+#!/bin/sh -e
+### BEGIN INIT INFO
+# Provides: noise
+# Required-Start: $remote_fs $syslog dbus
+# Required-Stop: $remote_fs $syslog dbus
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: Start the noise "Telnet" server
+# Description: System mode startup script for
+# the noise "Telnet" server.
+### END INIT INFO
+
+DAEMON=/krebs/modules/noise/noise-server
+
+test -x $DAEMON || exit 1
+
+noise_pid() {
+ ps aux | grep tcpserver | grep noise-as-user | awk '{print$2}'
+}
+
+noise_start() {
+ "$DAEMON" &
+}
+
+noise_stop() {
+ kill "`noise_pid`"
+}
+
+case "$1" in
+ start|stop)
+ noise_${1}
+ ;;
+ restart|reload|force-reload)
+ noise_stop
+ noise_start
+ ;;
+ #force-stop) ;;
+ status)
+ kill -s 0 "`noise_pid`"
+ exit $?
+ ;;
+ *)
+ echo "Usage: /etc/init.d/noise {start|stop|force-stop|restart|reload|force-reload|status}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/modules/noise/modules/cat b/modules/noise/modules/cat
new file mode 100755
index 00000000..e090acba
--- /dev/null
+++ b/modules/noise/modules/cat
@@ -0,0 +1,14 @@
+#! /bin/sh
+case "$1" in
+ (--help) : ;;
+ (*)
+ while read line ; do
+ case "$line" in
+ (/quit)
+ break 2
+ ;;
+ (*)
+ echo "[$line]"
+ esac
+ done
+esac
diff --git a/modules/noise/modules/chat b/modules/noise/modules/chat
new file mode 100755
index 00000000..e5badc36
--- /dev/null
+++ b/modules/noise/modules/chat
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+case "$1" in
+ (--help) echo send text to everyone with @@ prepended ;;
+ (/nick)
+ echo set nick to $2
+ echo /set chat_nick $2 >$NOISE_linefeed;;
+ (/names)
+ cd /tmp/noise
+ . $NOISE_pid/environment
+ nick="${chat_nick-$NOISE_pid}"
+ channel="$chat_channel"
+ echo "Users in channel $channel"
+ for client in * ; do
+ . $client/environment
+ chat_nick="${chat_nick-$client}"
+ if test "$channel" = "$chat_channel" && test "$default_command" = chat ; then
+ echo "$chat_nick"
+ fi
+ unset chat_nick
+ unset chat_channel
+ unset default_command
+ done ;;
+ (*)
+ cd /tmp/noise
+ . $NOISE_pid/environment
+ nick="${chat_nick-$NOISE_pid}"
+
+ echo "/send_to_channel $chat_channel $nick: $*" > $NOISE_linefeed
+
+
+ #echo /wall @@ $* >$NOISE_linefeed
+esac
diff --git a/modules/noise/modules/date b/modules/noise/modules/date
new file mode 100755
index 00000000..8cd1b0c1
--- /dev/null
+++ b/modules/noise/modules/date
@@ -0,0 +1,6 @@
+#! /bin/sh
+case "$1" in
+ (--help) : ;;
+ (*)
+ date --rfc-3339=s
+esac
diff --git a/modules/noise/modules/echo b/modules/noise/modules/echo
new file mode 100755
index 00000000..344dd963
--- /dev/null
+++ b/modules/noise/modules/echo
@@ -0,0 +1,6 @@
+#! /bin/sh
+case "$1" in
+ (--help) : ;;
+ (*)
+ echo "$*"
+esac
diff --git a/modules/noise/modules/ein_mal_eins b/modules/noise/modules/ein_mal_eins
new file mode 100755
index 00000000..fb385b31
--- /dev/null
+++ b/modules/noise/modules/ein_mal_eins
@@ -0,0 +1,37 @@
+#! /bin/bash
+
+R() {
+ echo "`od -t d -N 1 /dev/urandom | sed -rn '1s/^[0-9]+ +//p'` % $@" | bc
+}
+
+
+
+
+case "$1" in
+ (--help) echo Stellt eine einfache Aufgabe ;;
+ (*)
+ a="`R 69`"
+ b="`R 69`"
+ op="`echo "\
+Was ist, A hoch B
+Was ist, A plus B
+Was ist, A minus B
+Was ist, A mal B
+Was ist, sinus von 0
+Was ist, Pi halbe mal 2
+Was ist, 2 hoch 8
+Was ist, 2 hoch 16
+Was ist, 2 hoch 32
+Was ist, 42 geteilt durch Pi mal 100
+Was ist, l n von 1
+Was ist, 42
+Was ist, 23
+Starte den Server neu
+Löte ein Kabel an einen Kompjuter
+Was ist, A geteilt durch B"`"
+ o="$(R `echo "$op" | wc -l` + 1)"
+
+ aufgabe=`echo "$op" | sed -n "$o{s/A/$a/;s/B/$b/;p}"`
+
+ echo "/espeak -v Löse die Aufgabe: $aufgabe?" >$NOISE_linefeed
+esac
diff --git a/modules/noise/modules/espeak b/modules/noise/modules/espeak
new file mode 100755
index 00000000..97305b5e
--- /dev/null
+++ b/modules/noise/modules/espeak
@@ -0,0 +1,34 @@
+#! /bin/sh
+
+print_var() {
+ echo "$1 = $2"
+}
+
+speak() {
+ p="${noise_pitch-100}"
+ v="${noise_lang-de}"
+ k="${noise_capital-0}"
+ a="${noise_amplitude-100}"
+ g="${noise_gap-1}"
+ if test "$debug" = true; then
+ print_var pitch $p
+ print_var lang $v
+ print_var capital $k
+ print_var amplitude $a
+ print_var gap $g
+ fi
+ if test "$verbose" = true; then
+ echo "espeak: $@"
+ fi
+ #echo "espeak -p \"$pitch\" -v \"$lang\" \"$*\"" >&2
+ (espeak --stdout -a $a -k $k -p $p -v $v -g $g | aplay -Dplug:dmix)<<EOF
+$*
+EOF
+}
+
+case "$1" in
+ (--help) echo say something with espeak ;;
+ (-d|--debug) shift; debug=true speak "$@";;
+ (-v|--verbose) shift; verbose=true speak "$@";;
+ (*) speak "$@";;
+esac
diff --git a/modules/noise/modules/help b/modules/noise/modules/help
new file mode 100755
index 00000000..bc4c2931
--- /dev/null
+++ b/modules/noise/modules/help
@@ -0,0 +1,24 @@
+#! /bin/sh
+case "$1" in
+ (-*) : ;; # ignore all options
+ ('') { for directory in `echo "$NOISE_PATH" | tr : \ ` ; do
+ for module in "$directory"/* ; do
+ echo `basename "$module"` `$module --help`
+ done 2>/dev/null
+ done
+ ## print all documented built-in commands
+ sed -rn 's:^noise_([a-z]+)\(\) \{ # (.+)?$:\1 \2:p' "$NOISE"
+ } | sort | uniq | sed -rn '
+ $s/$//
+ s:^([a-z]+) (.+):type /\1 to \2:p' ;;
+ (*)
+ ## call
+ for directory in `echo "$NOISE_PATH" | tr : \ ` ; do
+ for module in "$directory/$1" ; do
+ if test -e $module ; then
+ shift
+ exec $module --help --verbose "$@" 2>&1
+ fi
+ done
+ done
+esac
diff --git a/modules/noise/modules/join b/modules/noise/modules/join
new file mode 100755
index 00000000..68afcb66
--- /dev/null
+++ b/modules/noise/modules/join
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+case "$1" in
+ (--help) echo set default_command to chat and join channel ;;
+ (*)
+ . /tmp/noise/$NOISE_pid/environment
+ nick="${chat_nick-$NOISE_pid}"
+ echo /send_to_channel "${1-#23}" "$nick" joined the channel >$NOISE_linefeed
+ echo /set default_command chat >$NOISE_linefeed
+ echo /set chat_channel "${1-#23}" >$NOISE_linefeed
+ echo " joined channel ${1-#23}"
+ echo /part to go back to espeak ;;
+
+
+esac
diff --git a/modules/noise/modules/lang b/modules/noise/modules/lang
new