From 19fb357dec054bce570b5e3daaef8b4f33ce6328 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 21 Jul 2011 00:19:52 +0200 Subject: cholerab live.sh: initial commit --- cholerab/live.sh | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100755 cholerab/live.sh (limited to 'cholerab') diff --git a/cholerab/live.sh b/cholerab/live.sh new file mode 100755 index 00000000..8328ea07 --- /dev/null +++ b/cholerab/live.sh @@ -0,0 +1,76 @@ +#! /bin/sh +set -euf +stty cbreak -echo + +getc() { + echo -n "7 8" >&2 + echo -n "7state=$state8" >&2 + set -- "`dd bs=1 count=1 2>/dev/null`" + set -- "$1" "`echo -n "$1" | od -An -tx | tr -d "[$IFS]"`" + char="$1" + odchar="$2" + echo -n "$1" +} + +state() { + state="$1" + echo -n "7 8" >&2 + echo -n "7state=$state8" >&2 + char="`dd bs=1 count=1 2>/dev/null`" + odchar="`echo -n "$char" | od -An -tx | tr -d "[$IFS]"`" + history="$odchar ${history-}" + echo -n "7 8" >&2 + echo -n "7 8" >&2 + echo -n "7`echo -n "$history"`8" >&2 +} + + +S() { + state S + case "$char" in + () ESC "$char";; + () echo -n ' '; S;; + (*) + echo -n "$char" + S + ;; + esac +} + +ESC() { + state ESC + case "$char" in + ('[') ESC_OSQRB "$1$char";; + (*) + echo -n '^[' + S + ;; + esac +} + +ESC_OSQRB() { + state ESC_OSQRB + case "$char" in + (A|B|C|D) echo -n "$1$char"; S;; + ('[') ESC_OSQRB2 "$1$char";; + (*) + echo -n '^[[' + S + ;; + esac +} + +ESC_OSQRB2() { + state ESC_OSQRB2 + case "$char" in + (A|B|C|D) echo -n "$1$char"; S;; + (*) + echo -n '^[[[' + S + ;; + esac +} + + +echo -n 'c' +S -- cgit v1.2.3 From 904abe9a757e4cb94ce2b2eeea21b9cc9535b262 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Thu, 21 Jul 2011 01:48:14 +0200 Subject: 1st try of cholerab --- cholerab/max_dirty_hack.sh | 98 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100755 cholerab/max_dirty_hack.sh (limited to 'cholerab') diff --git a/cholerab/max_dirty_hack.sh b/cholerab/max_dirty_hack.sh new file mode 100755 index 00000000..e8928d38 --- /dev/null +++ b/cholerab/max_dirty_hack.sh @@ -0,0 +1,98 @@ +#!/bin/sh +stty -echo cbreak -ofdel +x_max=90 +y_max=10 +x_cur=1 +y_cur=1 +y= +t=1 +echo -n "c" + +while [ $t -lt $(( y_max+2 )) ];do + echo -e "[$t;$(( x_max+1 ))Hx" + t=$(( t+1 )) +done +t=1 +while [ $t -lt $(( x_max+2 )) ];do + echo -e "[$(( y_max+1 ));${t}Hx" + t=$(( t+1 )) +done + +echo -n "[$y_cur;${x_cur}H" +#Main Loop +while x="`dd bs=1 count=1 2>/dev/null`"; do + y="$y$x" + case "$y" in + (*"") + if [[ $y_cur -le 1 ]];then + y_cur=$y_max + echo -n "[$y_cur;${x_cur}H" + else + echo -n "" + y_cur=$(( y_cur-1 )) + fi + y= + ;; + (*"") + if [[ $y_cur -ge $y_max ]];then + y_cur=1 + echo -n "[$y_cur;${x_cur}H" + else + echo -n "" + y_cur=$(( y_cur+1 )) + fi + y= + ;; + (*"") + if [[ $x_cur -ge $x_max ]];then + x_cur=1 + echo -n "[$y_cur;${x_cur}H" + else + echo -n "" + x_cur=$(( x_cur+1 )) + fi + y= + ;; + (*"") + if [[ $x_cur -le 1 ]];then + x_cur=$x_max + echo -n "[$y_cur;${x_cur}H" + else + echo -n "" + x_cur=$(( x_cur-1 )) + fi + y= + ;; + (*"") + if [[ $x_cur -le 1 ]];then + x_cur=$x_max + echo -n "[$y_cur;${x_cur}H" + else + echo -n " " + x_cur=$(( x_cur-1 )) + fi + y= + ;; + (|\[) + : + ;; + (*) + if [[ $x_cur -gt $x_max ]];then + x_cur=1 + echo -n "[$y_cur;${x_cur}H" + elif [[ $x_cur -eq $x_max ]];then + echo -n "$x" + x_cur=1 + echo -n "[$y_cur;${x_cur}H" + else + echo -n "$x" + x_cur=$(( x_cur+1 )) + fi + y= + ;; + esac + state=`echo -n "$x" | od -An -tx | tr -d "[$IFS]"` + echo -n "7[1;$(( x_max+2 ))H$state8" + echo -n "7[2;$(( x_max+2 ))H 8" + echo -n "7[2;$(( x_max+2 ))H$x_cur:$y_cur8" +done -- cgit v1.2.3 From 4b8ded8b9d183c13a2301cc0ed7dface0c650709 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 21 Jul 2011 02:35:39 +0200 Subject: cholerab live.sh: shasmfuftw! --- cholerab/live.sh | 112 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 62 insertions(+), 50 deletions(-) (limited to 'cholerab') diff --git a/cholerab/live.sh b/cholerab/live.sh index 8328ea07..62a2c3cf 100755 --- a/cholerab/live.sh +++ b/cholerab/live.sh @@ -2,75 +2,87 @@ set -euf stty cbreak -echo -getc() { - echo -n "7 8" >&2 - echo -n "7state=$state8" >&2 - set -- "`dd bs=1 count=1 2>/dev/null`" - set -- "$1" "`echo -n "$1" | od -An -tx | tr -d "[$IFS]"`" - char="$1" - odchar="$2" - echo -n "$1" +go() { + state=$1 + wr 7 + wr " " >&2 + wr "state=$state" >&2 + wr 8 + $1 } -state() { - state="$1" - echo -n "7 8" >&2 - echo -n "7state=$state8" >&2 - char="`dd bs=1 count=1 2>/dev/null`" - odchar="`echo -n "$char" | od -An -tx | tr -d "[$IFS]"`" - history="$odchar ${history-}" - echo -n "7 8" >&2 - echo -n "7 8" >&2 - echo -n "7`echo -n "$history"`8" >&2 +rd() { + dd bs=1 count=1 2>/dev/null } +bufrd() { + buf="`rd`" + bufinfowr +} -S() { - state S - case "$char" in - () ESC "$char";; - () echo -n ' '; S;; - (*) - echo -n "$char" - S - ;; +bufrda() { + buf="$buf`rd`" + bufinfowr +} + +bufinfowr() { + wr 7 + wr " " >&2 + wr " " >&2 + case "$buf" in + () wr '^[' >&2;; + (*) wr "$buf" >&2;; esac + wr "`wr "$buf" | xxd -p`" >&2 + wr 8 } -ESC() { - state ESC - case "$char" in - ('[') ESC_OSQRB "$1$char";; - (*) - echo -n '^[' - S - ;; +wr() { + echo -n "$1" +} + +C0="`echo C0 | xxd -r -p`"; DF="`echo DF | xxd -r -p`" +E0="`echo E0 | xxd -r -p`"; EF="`echo EF | xxd -r -p`" +F0="`echo F0 | xxd -r -p`"; F7="`echo F7 | xxd -r -p`" +S() { + bufrd + case "$buf" in + () go ESC;; + () wr ' '; go S;; + ([$C0-$DF]) go U1;; + ([$E0-$EF]) go U2;; + ([$F0-$F7]) go U3;; + (*) wr "$buf"; go S;; esac } -ESC_OSQRB() { - state ESC_OSQRB - case "$char" in - (A|B|C|D) echo -n "$1$char"; S;; - ('[') ESC_OSQRB2 "$1$char";; +U1() { buf="$buf`rd`"; wr "$buf"; go S; } +U2() { buf="$buf`rd`"; go U1; } +U3() { buf="$buf`rd`"; go U2; } + + +ESC() { + bufrda + case "$buf" in + ('[') go ESC_OSQRB;; (*) - echo -n '^[[' - S + wr '^[' + go S ;; esac } -ESC_OSQRB2() { - state ESC_OSQRB2 - case "$char" in - (A|B|C|D) echo -n "$1$char"; S;; +ESC_OSQRB() { + bufrda + case "$buf" in + (''|''|''|'') wr "$buf"; go S;; (*) - echo -n '^[[[' - S + wr '^[[' + go S ;; esac } -echo -n 'c' -S +wr 'c' +go S -- cgit v1.2.3 From 10bec08d281dfaf2f08f194790944525e7fbc5d5 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Fri, 22 Jul 2011 14:47:53 +0200 Subject: multiplayer now through input/output files --- cholerab/max_dirty_hack.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'cholerab') diff --git a/cholerab/max_dirty_hack.sh b/cholerab/max_dirty_hack.sh index e8928d38..7fbd801b 100755 --- a/cholerab/max_dirty_hack.sh +++ b/cholerab/max_dirty_hack.sh @@ -6,6 +6,8 @@ x_cur=1 y_cur=1 y= t=1 +outputfile=/tmp/cholerab_out +inputfile=/tmp/cholerab_in echo -n "c" while [ $t -lt $(( y_max+2 )) ];do @@ -77,20 +79,22 @@ while x="`dd bs=1 count=1 2>/dev/null`"; do : ;; (*) - if [[ $x_cur -gt $x_max ]];then - x_cur=1 - echo -n "[$y_cur;${x_cur}H" - elif [[ $x_cur -eq $x_max ]];then - echo -n "$x" + if [[ $x_cur -ge $x_max ]];then x_cur=1 echo -n "[$y_cur;${x_cur}H" else echo -n "$x" + echo "<0 $x $x_cur $y_cur>" >> $tmpfile x_cur=$(( x_cur+1 )) fi y= ;; esac + while [[ -s $inputfile ]]; do + cat $inputfile | head -n 1 | sed 's,[<>],,g' | { read MODE CHAR XN YN ; echo -n "7[$YN;${XN}H$CHAR8"; } + sed -i -e "1d" $inputfile + done + state=`echo -n "$x" | od -An -tx | tr -d "[$IFS]"` echo -n "7[1;$(( x_max+2 ))H$state8" echo -n "7[2;$(( x_max+2 ))H 8" -- cgit v1.2.3 From 2719c0b478d9a0ff780acbde95489ff6995ae884 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Fri, 22 Jul 2011 14:50:36 +0200 Subject: fixed --- cholerab/max_dirty_hack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cholerab') diff --git a/cholerab/max_dirty_hack.sh b/cholerab/max_dirty_hack.sh index 7fbd801b..7183a760 100755 --- a/cholerab/max_dirty_hack.sh +++ b/cholerab/max_dirty_hack.sh @@ -84,7 +84,7 @@ while x="`dd bs=1 count=1 2>/dev/null`"; do echo -n "[$y_cur;${x_cur}H" else echo -n "$x" - echo "<0 $x $x_cur $y_cur>" >> $tmpfile + echo "<0 $x $x_cur $y_cur>" >> $outputfile x_cur=$(( x_cur+1 )) fi y= -- cgit v1.2.3 From ff327a9efd06d39f0f966c4dbd412b2cfb97bc5c Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 4 Aug 2011 01:22:19 +0200 Subject: cholerab ttycnser: initial commit --- cholerab/ttycnser | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 cholerab/ttycnser (limited to 'cholerab') diff --git a/cholerab/ttycnser b/cholerab/ttycnser new file mode 100755 index 00000000..0972dbbb --- /dev/null +++ b/cholerab/ttycnser @@ -0,0 +1,27 @@ +#! /bin/sh +set -euf + +tty="${TMPDIR-/tmp}/ttycnser.$LOGNAME.tty" + +case "${mode-server}" in + (server) + host=0.0.0.0 + port=8080 + export mode=client + echo "ttycnser @ $host $port" >&2 + exec tcpserver $host $port "$0" + ;; + (client) + line="`read line && echo "$line"`" + echo -n '7>>>> '"$line"'8' > "$tty" + ;; + (install) + # TODO tell the user to do something like + # PROMPT_COMMAND="`mode=install ~/p/krebscode/painload/cholerab/ttycnser`" + echo "ln -snf '`tty`' '$tty'" + ;; + (*) + echo 'Error 1: You are made of stupid!' >&2 + exit 23 + ;; +esac -- cgit v1.2.3 From a8eb7d8634e7722592b5d2e02df2124a7d15e0c0 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 6 Aug 2011 00:59:46 +0200 Subject: cholerab README: add conflicts --- cholerab/README | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cholerab') diff --git a/cholerab/README b/cholerab/README index d6149751..7b53aeaa 100644 --- a/cholerab/README +++ b/cholerab/README @@ -61,3 +61,12 @@ - i.e. to start automatically at KREBS - the last stream should be playbacked - should be controlable by noise [see NOISE-STREAM-MODULE] + + +## merge conflicts below +view.py: contains view classes for cholerab +cholerab.py: main file + +start with : +python cholerab.py + -- cgit v1.2.3 From 5b8430e93431b795ac788c59bbc008b9e5b6da73 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 6 Aug 2011 00:59:46 +0200 Subject: cholerab README: add conflicts --- cholerab/README | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cholerab') diff --git a/cholerab/README b/cholerab/README index d6149751..7b53aeaa 100644 --- a/cholerab/README +++ b/cholerab/README @@ -61,3 +61,12 @@ - i.e. to start automatically at KREBS - the last stream should be playbacked - should be controlable by noise [see NOISE-STREAM-MODULE] + + +## merge conflicts below +view.py: contains view classes for cholerab +cholerab.py: main file + +start with : +python cholerab.py + -- cgit v1.2.3 From d28012696a16e7d0fa3cf20e3527b9cf5747dc3a Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Aug 2011 21:52:13 +0200 Subject: initial vomit --- cholerab/pleni/camplist | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 cholerab/pleni/camplist (limited to 'cholerab') diff --git a/cholerab/pleni/camplist b/cholerab/pleni/camplist new file mode 100644 index 00000000..d5ba3cca --- /dev/null +++ b/cholerab/pleni/camplist @@ -0,0 +1,36 @@ +Kochfeld +Topf 2x3l +Pfanne +Teller +Gläser +Besteck +Wasschüsseln Wasserbeutel +6x Fertiggericht Spaghetti +Chilli +Fryhstyck: + Brötchen + Brot + Schinken (geraucht) + Salami + H-Milch + Müsli + Butter + Senf + Ketchup + Gurken + Marmelade + $Haselnusscreme + +Linsensuppe + Spätzle + Saiten +Ghoularschsuppe +Freitagsgemöse: + Zwiebeln + Knoblauch + Plize (pfifferlinge) + Paprika + Pfeffer + Salz + Gemöse + + + -- cgit v1.2.3 From 04fea470969698c9587e4fe04e1e42cfaf703b9a Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 8 Aug 2011 00:52:26 +0200 Subject: cholerab/{enterprise -> pattern} --- cholerab/enterprise/README | 52 ---------------------------------------------- cholerab/pattern/README | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 52 deletions(-) delete mode 100644 cholerab/enterprise/README create mode 100644 cholerab/pattern/README (limited to 'cholerab') diff --git a/cholerab/enterprise/README b/cholerab/enterprise/README deleted file mode 100644 index 03c1c068..00000000 --- a/cholerab/enterprise/README +++ /dev/null @@ -1,52 +0,0 @@ -Enterprise Patterns -================== -Stellt sicher, dass das richtige passiert, egal was gemacht wird - -Enterprise Loop ---------------- - -Enterprise Exception Handling ------------------------------ -ggf ersetzbar durch enterprise loop. - - -Enterprise Installation ------------------------ - -Rebooting ----------- - -Enterprise Einschalter (eon) ----------------------------- -Device that turns something on as soon as possible. - -Supernintendo Pattern ---------------------- - -Enterprise Root ---------------- -scripts which need root access but are called with lower privileges. The Enterprise Root Pattern provides a Solution for this issue by calling the script itself as sudo. - -if test "${nosudo-false}" != true -a `id -u` != 0; then - echo "we're going sudo..." >&2 - exec sudo "$0" "$@" - exit 23 # go to hell -fi - // enterprise ist, wenn ... trotzdem matcht - -Enterprise Shutdown ------------------- -Mittel der Wahl um einen Shutdown zu erzwingen - -Bsp: das Not-Aus in der Maschinensicherheit - -Enterprise Deep Copy --------------------- -Bsp: var copy = JSON.parse(JSON.stringify(source)) - -Enterprise Thinking -------------------- -Prozess um auf Enterprise Patterns zu kommen - -Bug-Driven Development ---------------------- diff --git a/cholerab/pattern/README b/cholerab/pattern/README new file mode 100644 index 00000000..03c1c068 --- /dev/null +++ b/cholerab/pattern/README @@ -0,0 +1,52 @@ +Enterprise Patterns +================== +Stellt sicher, dass das richtige passiert, egal was gemacht wird + +Enterprise Loop +--------------- + +Enterprise Exception Handling +----------------------------- +ggf ersetzbar durch enterprise loop. + + +Enterprise Installation +----------------------- + +Rebooting +---------- + +Enterprise Einschalter (eon) +---------------------------- +Device that turns something on as soon as possible. + +Supernintendo Pattern +--------------------- + +Enterprise Root +--------------- +scripts which need root access but are called with lower privileges. The Enterprise Root Pattern provides a Solution for this issue by calling the script itself as sudo. + +if test "${nosudo-false}" != true -a `id -u` != 0; then + echo "we're going sudo..." >&2 + exec sudo "$0" "$@" + exit 23 # go to hell +fi + // enterprise ist, wenn ... trotzdem matcht + +Enterprise Shutdown +------------------ +Mittel der Wahl um einen Shutdown zu erzwingen + +Bsp: das Not-Aus in der Maschinensicherheit + +Enterprise Deep Copy +-------------------- +Bsp: var copy = JSON.parse(JSON.stringify(source)) + +Enterprise Thinking +------------------- +Prozess um auf Enterprise Patterns zu kommen + +Bug-Driven Development +--------------------- -- cgit v1.2.3 From dceeadb1a9e40c449e5ba87d21e08920306142f4 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 8 Aug 2011 01:00:11 +0200 Subject: cholerab: add litprog and srcdoc Add the patterns Literate Programming and Source-based Documentation. --- cholerab/pattern/README | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'cholerab') diff --git a/cholerab/pattern/README b/cholerab/pattern/README index 03c1c068..0980ac6e 100644 --- a/cholerab/pattern/README +++ b/cholerab/pattern/README @@ -50,3 +50,19 @@ Prozess um auf Enterprise Patterns zu kommen Bug-Driven Development --------------------- + +Source-based Documentation / Help +--------------------------------- + + #! /bin/sh + if echo "$*" | grep -q '\(^\| \)-h\( \|$\)'; then + cat "$0" + fi + # [more code] + + +Literate Programming +-------------------- +Omit all the comments. + + -- cgit v1.2.3 From 3bd22cdf5df09b14d5d047c1821646e37318c522 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 9 Aug 2011 00:14:17 +0200 Subject: AGENDA.cccamp11: initial emergency commit --- cholerab/AGENDA.cccamp11 | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 cholerab/AGENDA.cccamp11 (limited to 'cholerab') diff --git a/cholerab/AGENDA.cccamp11 b/cholerab/AGENDA.cccamp11 new file mode 100644 index 00000000..d424dbe8 --- /dev/null +++ b/cholerab/AGENDA.cccamp11 @@ -0,0 +1,42 @@ + +- krebs + - krebs.no.de/hosts.tar automatic via github POST hook + - same for supernode updates [vs. cron] + - krebscode/painload/supernode/foo + + - overall + - PATH-able bin/ + + - natural voices + - unify with translate.google + - differences: + - url + - form data + - query args + - make-based installer for voice-symlinks + + - ttycnser + - server component + - JSON-RPC [spec and implementation] + + - krebs rebootstrapping + - curl painload.retiolum | sh + [- git clone https://github.com/kreingbscode/painload /krebs] + [- /krebs/boot] + + - Enterprisename for serious business + - kcpl [pronounce: krepel] + + - p wie punani "hard-install" + + - gitolite module + - ein richtiges /krebs sollte alle peers als remotes haben, sodass + man csay makefu: git pull also/blah etc. machen kann. + + - git hooks + - Error 1: "Keyword-ratio below 9k" + - keyword file + + - default configuration for $EDITOR & co. + + - Refactort git-eternal-move: use find instead of mv -- cgit v1.2.3 From 26a2bfa9aa099917afef430b9af8e49bfeacf4eb Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 9 Aug 2011 00:43:37 +0200 Subject: AGENDA.cccamp11: add NetworkEngineer --- cholerab/AGENDA.cccamp11 | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cholerab') diff --git a/cholerab/AGENDA.cccamp11 b/cholerab/AGENDA.cccamp11 index d424dbe8..51837c96 100644 --- a/cholerab/AGENDA.cccamp11 +++ b/cholerab/AGENDA.cccamp11 @@ -40,3 +40,12 @@ - default configuration for $EDITOR & co. - Refactort git-eternal-move: use find instead of mv + + - NetworkEngineer + - kill and replace NetworkManager + - mimic NetworkManager but discard all inputs and do the right thing + - stay connected to retiolum by any means necessary + - keywords: + - rpc: irc, cholerab, espeak / beep + - iptables + -- cgit v1.2.3