From a0f23b72769deac88e414b1cfdfdbde5882ba704 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Sep 2011 16:41:58 +0200 Subject: Adding mpd stream --- streams/stream.db | 1 + 1 file changed, 1 insertion(+) diff --git a/streams/stream.db b/streams/stream.db index 5efeb9ea..47ccf7b5 100644 --- a/streams/stream.db +++ b/streams/stream.db @@ -6,3 +6,4 @@ http://somafm.com/illstreet.pls illstreet http://localhost:8000/stream.ogg icecast http://stream2.jungletrain.net:8000 jungletrain http://playlist.tormentedradio.com/tormentedradio.pls tormented +http://filebitch.shack:8000 mpd -- cgit v1.2.3 From f6086703a2ff8ef36db6921958e338c784e2d6e1 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Sep 2011 16:49:29 +0200 Subject: Adding mpd to news --- cholerab/news/Candidate | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cholerab/news/Candidate b/cholerab/news/Candidate index 8abc0b00..fc9fab6f 100644 --- a/cholerab/news/Candidate +++ b/cholerab/news/Candidate @@ -46,4 +46,12 @@ gewaehrleisten sollen verwendet werden. [1.1] : https://github.com/krebscode/painload/tree/master/retiolum/bin/get-tinc-dir -## 2. KNUT - Die Krebs Notification Utility Toolchain +## 2. Krebs MPD + http stream + +KM momo hat sich heute (01.09.2011) gegen die streams gewehrt und auf der filebitch einen mpd Server eingerichtet. +Der MPD streamt jetzt via http(vorbis) auf http://filebitch.shack:8000. +Eine Integration in //streams ist bereits vorgenommen. +Der MPD lauert auf filebitch.shack:6600 auf MPD Clients die ihn bedienen. +Ein Webinterface ist noch nicht geplant. + +## 3. KNUT - Die Krebs Notification Utility Toolchain -- cgit v1.2.3 From a6c6b16fabdff46f4746132ae73f2937d6e2594d Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Sep 2011 16:54:59 +0200 Subject: adding instructions --- cholerab/news/Candidate | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cholerab/news/Candidate b/cholerab/news/Candidate index fc9fab6f..1b52abe4 100644 --- a/cholerab/news/Candidate +++ b/cholerab/news/Candidate @@ -54,4 +54,6 @@ Eine Integration in //streams ist bereits vorgenommen. Der MPD lauert auf filebitch.shack:6600 auf MPD Clients die ihn bedienen. Ein Webinterface ist noch nicht geplant. +Die Musiksammlung kann in incoming/Musik auf der Filebitch erweitert werden. + ## 3. KNUT - Die Krebs Notification Utility Toolchain -- cgit v1.2.3 From 83d85e16dbd11a13f1af15fedef87150571cf391 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 1 Sep 2011 20:33:33 +0200 Subject: gitmodules: go away beam!^_^ --- .gitmodules | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index cbc61522..3677b710 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,9 +13,6 @@ [submodule "submodules/github/tautologistics/node-htmlparser"] path = submodules/github/tautologistics/node-htmlparser url = https://github.com/tautologistics/node-htmlparser -[submodule "krebsbeam/c-beam"] - path = krebsbeam/c-beam - url = git://dev.c-base.org/c-beam/c-beam.git [submodule "submodules/github/makefu/dpfhack_display"] path = submodules/github/makefu/dpfhack_display url = https://github.com/makefu/dpfhack_pearl -- cgit v1.2.3 From e82fe298c97010dedea03dc9f3c3de68fb3bd336 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 1 Sep 2011 20:40:15 +0200 Subject: //cholerab/AGENDA += generate code somewhere else --- cholerab/AGENDA | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cholerab/AGENDA b/cholerab/AGENDA index 8c80be0d..d2c1ae1f 100644 --- a/cholerab/AGENDA +++ b/cholerab/AGENDA @@ -107,3 +107,6 @@ - //Schnabeltasse - wgrep + + - generated code must be created outside of the //-hierarchy, so killing + a local repository and recloning it is easier -- cgit v1.2.3 From eba52f4e39daac4b4b0f14cfe3cb42cbbac4aaf6 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 3 Sep 2011 16:45:47 +0200 Subject: adding mpd stream to streams --- streams/stream.db | 1 + 1 file changed, 1 insertion(+) diff --git a/streams/stream.db b/streams/stream.db index 5efeb9ea..2a71f369 100644 --- a/streams/stream.db +++ b/streams/stream.db @@ -6,3 +6,4 @@ http://somafm.com/illstreet.pls illstreet http://localhost:8000/stream.ogg icecast http://stream2.jungletrain.net:8000 jungletrain http://playlist.tormentedradio.com/tormentedradio.pls tormented +http:/filebitch.shack:8000 mpd -- cgit v1.2.3 From a8150875936a0229d330846590c3211048800c89 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 3 Sep 2011 17:09:34 +0200 Subject: fixed mpd entry --- streams/stream.db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/streams/stream.db b/streams/stream.db index 2a71f369..47ccf7b5 100644 --- a/streams/stream.db +++ b/streams/stream.db @@ -6,4 +6,4 @@ http://somafm.com/illstreet.pls illstreet http://localhost:8000/stream.ogg icecast http://stream2.jungletrain.net:8000 jungletrain http://playlist.tormentedradio.com/tormentedradio.pls tormented -http:/filebitch.shack:8000 mpd +http://filebitch.shack:8000 mpd -- cgit v1.2.3 From 9aa3e3f24c18562e39168cdd629ed1019a4ac317 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 3 Sep 2011 20:15:27 +0200 Subject: shack is-plenum: initial commit --- shack/bin/is-plenum | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 shack/bin/is-plenum diff --git a/shack/bin/is-plenum b/shack/bin/is-plenum new file mode 100755 index 00000000..1c686ca1 --- /dev/null +++ b/shack/bin/is-plenum @@ -0,0 +1,34 @@ +#! /bin/sh +# +# //shack/is-plenum [YEAR] +# +# where YEAR defaults to the current year +# + +y=${1-`date +%Y`} +for m in `seq 1 12`; do + t1= + t2= + t3= + t4= + t5= + week_done=-1 + for d in `cal $m $y | tr ' ' '\n' | grep '^[0-9][0-9]\?$'`; do + echo $m | grep -q '^.$' && m=0$m + echo $d | grep -q '^.$' && d=0$d + date=$y-$m-$d + date_week=`date -d $date +%W` + if test $week_done -lt $date_week; then + test -z "$t1" && { test `date -d $date +%u` = 4 && t1=$date && week_done=$date_week; continue; } + test -z "$t2" && { test `date -d $date +%u` = 3 && t2=$date && week_done=$date_week; continue; } + test -z "$t3" && { test `date -d $date +%u` = 4 && t3=$date && week_done=$date_week; continue; } + test -z "$t4" && { test `date -d $date +%u` = 3 && t4=$date && week_done=$date_week; continue; } + test -z "$t5" && { test `date -d $date +%u` = 3 && t5=$date && week_done=$date_week; continue; } + fi + done + test -n "${t1}" && echo $t1 + test -n "${t2}" && echo $t2 + test -n "${t3}" && echo $t3 + test -n "${t4}" && echo $t4 + test -n "${t5}" && echo $t5 +done -- cgit v1.2.3 From 89d86c1b9fa69cb6479997981f6302202aca830d Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 3 Sep 2011 23:03:14 +0200 Subject: //shack/Eselkalk: initial commit This commit tries to calculate the dates of shack-plena. --- shack/Eselkalk/index.js | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ shack/bin/is-plenum | 34 ----------------------------- 2 files changed, 57 insertions(+), 34 deletions(-) create mode 100644 shack/Eselkalk/index.js delete mode 100755 shack/bin/is-plenum diff --git a/shack/Eselkalk/index.js b/shack/Eselkalk/index.js new file mode 100644 index 00000000..f64e0605 --- /dev/null +++ b/shack/Eselkalk/index.js @@ -0,0 +1,57 @@ +// +// node //shack/Eselkalk DATE +// +// where DATE ∈ [YYYY[-MM]], defaulting to the current YYYY-MM +// + +range = process.argv[2] || + JSON.parse(JSON.stringify(new Date())).slice(0, '....-..'.length) + +function dates(date) { + var year = date.getFullYear() + var month = date.getMonth() + + var i = new Date([year, (month < 9 ? '0' : '') + (month + 1)].join('-')) + + var days = [] + var next_day = 4; + for ( + ; i.getMonth() === month + ; i = new Date(+i + 24 * 60 * 60 * 1000)) { + if (i.getDay() === next_day) { + next_day = next_day === 3 ? 4 : 3 + if (next_day === 3) { + var next_4day = new Date(+i + 7 * 24 * 60 * 60 * 1000) + if (next_4day.getMonth() !== month) { + i = new Date(+i - 24 * 60 * 60 * 1000) + next_4day = 4 + } + } + days.push(new Date(+i + (20 * 60 + i.getTimezoneOffset()) * 60 * 1000)) + while (i.getDay() !== 0) { + i = new Date(+i + 24 * 60 * 60 * 1000) + } + } + } + + return days +} + + +result = [] + +// TODO if (/^....-..-..$/.test(range)) { ... } +if (/^....-..$/.test(range)) { + result = dates(new Date(range)) +} +else if (/^....$/.test(range)) { + ['01','02','03','04','05','06','07','08','09','10','11','12' + ].forEach(function (i) { + result = result.concat(dates(new Date([range, i].join('-')))) + }) +} +else { + throw new Error('You are made of stupid! ' + range) +} + +console.log(JSON.stringify(result, null, 2)) diff --git a/shack/bin/is-plenum b/shack/bin/is-plenum deleted file mode 100755 index 1c686ca1..00000000 --- a/shack/bin/is-plenum +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/sh -# -# //shack/is-plenum [YEAR] -# -# where YEAR defaults to the current year -# - -y=${1-`date +%Y`} -for m in `seq 1 12`; do - t1= - t2= - t3= - t4= - t5= - week_done=-1 - for d in `cal $m $y | tr ' ' '\n' | grep '^[0-9][0-9]\?$'`; do - echo $m | grep -q '^.$' && m=0$m - echo $d | grep -q '^.$' && d=0$d - date=$y-$m-$d - date_week=`date -d $date +%W` - if test $week_done -lt $date_week; then - test -z "$t1" && { test `date -d $date +%u` = 4 && t1=$date && week_done=$date_week; continue; } - test -z "$t2" && { test `date -d $date +%u` = 3 && t2=$date && week_done=$date_week; continue; } - test -z "$t3" && { test `date -d $date +%u` = 4 && t3=$date && week_done=$date_week; continue; } - test -z "$t4" && { test `date -d $date +%u` = 3 && t4=$date && week_done=$date_week; continue; } - test -z "$t5" && { test `date -d $date +%u` = 3 && t5=$date && week_done=$date_week; continue; } - fi - done - test -n "${t1}" && echo $t1 - test -n "${t2}" && echo $t2 - test -n "${t3}" && echo $t3 - test -n "${t4}" && echo $t4 - test -n "${t5}" && echo $t5 -done -- cgit v1.2.3 From e57db14fcac3aa7e13072278cf62abe44d226400 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 4 Sep 2011 19:57:25 +0200 Subject: //query/jquery: initial commit Previously this was (and still is) embedded in various //util/bin/* --- query/jquery/index | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 query/jquery/index diff --git a/query/jquery/index b/query/jquery/index new file mode 100755 index 00000000..3c49dac9 --- /dev/null +++ b/query/jquery/index @@ -0,0 +1,19 @@ +#! /bin/sh +set -euf + +# cd // +cd $(dirname $(readlink -f $0))/../.. + +for x in \ + github/tmpvar \ + github/mikeal \ + github/NV \ + github/tautologistics \ +; do + export NODE_PATH="$(readlink -f submodules/$x)${NODE_PATH+:$NODE_PATH}" +done + +# ensure query is ready +#git submodule update --init + +exec node submodules/github/visionmedia/query "$@" -- cgit v1.2.3 From 146cbbb39eb3affee603c6d54082a7ea3359eb3b Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 4 Sep 2011 20:02:20 +0200 Subject: //meinsack: initial commit --- meinsack/index | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100755 meinsack/index diff --git a/meinsack/index b/meinsack/index new file mode 100755 index 00000000..2b3e455a --- /dev/null +++ b/meinsack/index @@ -0,0 +1,77 @@ +#! /bin/sh +set -euf +cd $(dirname $(readlink -f $0))/.. # cd // + +plz=${plz+"&plz=$plz"} +str=${str+"&str=$str"} +anr=${anr+"&anr=$anr"} + +url="http://www.sita-deutschland.de/sita/ywbase_Abfallkalender_Stuttgart.nsf/frmSelect?ReadForm$plz$str$anr" + +# echo $url + +html="$(curl -fsS "$url" | iconv -f latin1 -t utf8)" + +if echo "$html" | fgrep -q 'Ihre Eingabe war nicht eindeutig'; then + { + echo "Error: multiple locations found" + echo "$html" | + query/jquery/index 'table.tab:nth-child(2n) .bordertop > .text' | + sed ' + s/[[:space:]]\+/ /g + s/'"`printf '\xc2\xa0'`"'//g;# kill unicode non-breaking space + ' | + while read plz && + read str && + read ort && + read bes1 && + read bes2 && + read anr; do + str=$(echo "$str"|sed 's/<[^>]*>//g') + echo "export anr=$anr if you meant \"$ort\"" + done | sort | uniq + } >&2 + exit 2 +elif test $(echo "$html" | grep -c 'Abfallkalender für') -gt 1 && + test -z "${ort-}"; then + { + echo "Error: multiple locations found" + echo "$html" | + query/jquery/index '.tab span.text,.subheadline' | + sed -n ' + s/[[:space:]]\+/ /g + s/'"`printf '\xc2\xa0'`"'//g;# kill unicode non-breaking space + s/^Abfallkalender.*[^0-9]\([0-9]\+\)[^(]*(\(.*\))/export ort=\2/p + ' | sort | uniq + } >&2 + exit 3 +else + result="$(echo "$html" | + query/jquery/index '.tab span.text,.subheadline' | { + if test -n "${ort-}"; then + sed -n " + /($ort)/,/^Abfallkalender/{p;b} + /($ort)/,\${p;b} + " + else + cat + fi + } | { + grep -v Abfallkalender | + sed ' + s/'"`printf '\xc2\xa0'`"'//g;# kill unicode non-breaking space + s/^[A-Z][a-z]\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\3-\2-\1/ + s/^[0-9].*/ "&T00:00:00.000Z"/ + $!s/$/,/ + 1s/^/[\n/ + $s/$/\n]/ + ' + })" + if ! echo "$result" | grep .; then + { + echo "Error: your query had no effect" + echo "url=\"$url\"" + } >&2 + exit 4 + fi +fi -- cgit v1.2.3 From a8858969c617da2b7362acb06ae479648dd13b93 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 4 Sep 2011 20:03:20 +0200 Subject: //meinsack: add head comment scratch --- meinsack/index | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meinsack/index b/meinsack/index index 2b3e455a..7046d78c 100755 --- a/meinsack/index +++ b/meinsack/index @@ -1,4 +1,12 @@ #! /bin/sh +# +# //meinsack +# +# export plz +# export str +# export anr +# export ort +# set -euf cd $(dirname $(readlink -f $0))/.. # cd // -- cgit v1.2.3 From 3ab0096ac165edb29bdc6911284eb714b18c1deb Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 4 Sep 2011 20:05:15 +0200 Subject: //shack/meinsack: initial commit This is a specialization of //meinsack for shackspace --- shack/meinsack/index | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 shack/meinsack/index diff --git a/shack/meinsack/index b/shack/meinsack/index new file mode 100755 index 00000000..7d7147b2 --- /dev/null +++ b/shack/meinsack/index @@ -0,0 +1,8 @@ +#! /bin/sh +set -euf +cd $(dirname $(readlink -f $0))/../.. # cd // + +export plz=70327 +export str=Ulmer +export ort=Wangen +exec meinsack/index -- cgit v1.2.3 From 91d8afe4298e931ec1b59bd4bb7969e5889e67d5 Mon Sep 17 00:00:00 2001 From: Momo Date: Sun, 4 Sep 2011 20:14:48 +0200 Subject: adding lightzones and all --- god/licht | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 92 insertions(+), 9 deletions(-) diff --git a/god/licht b/god/licht index 8ece3510..f9fc8f69 100755 --- a/god/licht +++ b/god/licht @@ -1,20 +1,103 @@ #!/bin/bash -case "$1" in - (--help) echo "Toggle the lights";; - (*) - LAMPE=`echo $1 | sed -n '/^[1-2]*[0-9]*[0-9]$/p' | xargs echo "obase=16;" | bc` - TOGGLE=`echo $2 | sed -n '/^[0-1]/p'` +toggle() { + LAMPE=`echo "$1" | sed -n '/^[1-2]*[0-9]*[0-9]$/p' | xargs echo "obase=16;" | bc` + TOGGLE=`echo "$2" | sed -n '/^[0-1]/p'` if ! [ "$LAMPE" -a "$TOGGLE" ];then echo "you are made of stupid" exit 1 fi - STRING="\xA5\x5A\x$LAMPE\x$TOGGLE" + STRING="\\xA5\\x5A\\x$LAMPE\\x$TOGGLE" if [ $# != 2 ] then - echo -ne "Usage: licht <0/1>" + echo "Usage: licht <0/1>" else echo "Toggle light $LAMPE ($TOGGLE)" - echo -ne "$STRING" | nc -u -w1 licht.shack 1337 + printf "$STRING" | nc -u -w1 licht.shack 1337 fi - ;; +} + +toggle_all() { + for i in `seq 0 7` + do + printf "\\xA5\\x5A\\x$i\\x$TOGGLE" | nc -u -w1 licht.shack 1337 & + done + wait +} + +kuschel(){ + for i in 0 2 + do + printf "\\xA5\\x5A\\x$i\\x$TOGGLE" | nc -u -w1 licht.shack 1337 & + done + wait +} + +software(){ + for i in 1 3 + do + printf "\\xA5\\x5A\\x$i\\x$TOGGLE" | nc -u -w1 licht.shack 1337 & + done + wait +} + +tische(){ + for i in 4 6 + do + printf "\\xA5\\x5A\\x$i\\x$TOGGLE" | nc -u -w1 licht.shack 1337 & + done + wait +} + +ghetto(){ + printf "\\xA5\\x5A\\x7\\x$TOGGLE" | nc -u -w1 licht.shack 1337 +} + +porsche(){ + printf "\\xA5\\x5A\\x5\\x$TOGGLE" | nc -u -w1 licht.shack 1337 +} + +case "$1" in + --help) + echo "Toggle the lights" + echo "Usage: lich <0/1>" + ;; + all) + TOGGLE=$2 + toggle_all + ;; + kuschel) + TOGGLE=$2 + kuschel + ;; + software) + TOGGLE=$2 + software + ;; + links) + TOGGLE=$2 + kuschel + software + ;; + rechts) + TOGGLE=$2 + tische + porsche + ghetto + ;; + tische) + TOGGLE=$2 + tische + ;; + porsche) + TOGGLE=$2 + porsche + ;; + ghetto) + TOGGLE=$2 + ghetto + ;; + *) + toggle "$@" + ;; esac + -- cgit v1.2.3 From 761db6a8b30f254b5349395c939111dedd8cf16b Mon Sep 17 00:00:00 2001 From: Momo Date: Sun, 4 Sep 2011 20:30:12 +0200 Subject: adding documentation --- god/licht | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/god/licht b/god/licht index f9fc8f69..cbff9ad0 100755 --- a/god/licht +++ b/god/licht @@ -1,4 +1,18 @@ #!/bin/bash +# +#SYNOPSIS +# //god/licht [options] [0/1] +#OPTIONS +# all - toggles all lights +# links - toggles all lights on the left hand side while looking towards the Auditorium +# rechts - toggles all lights on the right hand side while looking towards the Auditorium +# kuschel - toggles the lights in the pwnie corner +# software - toggles the software corner +# tische - toggles the lights on the window side of the long table +# porsche - toggles the lights on the window side where the porsche cockpit is +# ghetto - toggles the lights in the hallway +# 0-7 - toggles individual lights + toggle() { LAMPE=`echo "$1" | sed -n '/^[1-2]*[0-9]*[0-9]$/p' | xargs echo "obase=16;" | bc` TOGGLE=`echo "$2" | sed -n '/^[0-1]/p'` -- cgit v1.2.3