diff options
author | tv <tv@iiso> | 2011-09-24 21:14:35 +0200 |
---|---|---|
committer | tv <tv@iiso> | 2011-09-24 21:14:35 +0200 |
commit | e692ab13d032df6e8c96bf1ec840f366122dca1f (patch) | |
tree | 6b5cddee32d52d8de4005c93204665acbb762925 | |
parent | a1885b309ceb50afddf3b6cf758b3569e942ecbb (diff) | |
parent | 53679fedeb1db9d68399638fc44aa4cf4ac5ee1c (diff) |
Merge branch 'master' of github.com:krebscode/painload
-rwxr-xr-x | crypto/bin/ukrepl | 67 | ||||
-rwxr-xr-x | god/licht | 61 | ||||
-rw-r--r-- | streams/stream.db | 1 | ||||
-rwxr-xr-x | util/bin/TouchpadToggle | 8 | ||||
-rwxr-xr-x | util/bin/untouch | 8 |
5 files changed, 110 insertions, 35 deletions
diff --git a/crypto/bin/ukrepl b/crypto/bin/ukrepl index 21aa4d84..b3b25db9 100755 --- a/crypto/bin/ukrepl +++ b/crypto/bin/ukrepl @@ -1,19 +1,19 @@ #!/usr/bin/python # -*- coding: utf-8 -*- import sys + wont_change = { ' ' : ' ' , '\n' : '\n' } -fixed_active = False -def fixed_width_replace(char): - if char in wont_change: print char, +def fixed_width_replace(char): #f + if char in wont_change: return unicode(char) else: try: - print unichr(0xFF00 + ord(char)-32), + if not 32 < ord(char) < 126: raise Exception("not in range") + return unichr(0xFF00 + ord(char)-32) except: - print char, + return char -cyr_active = False cyrillic_dict = { 'A' : u'А', 'a' : 'а','Ä' : u'Ӓ', 'ä' : u'ӓ', 'B' : u'В', @@ -31,14 +31,49 @@ cyrillic_dict = { 'T' : u'г' } -def cyrillic_replace(char): - print cyrillic_dict.get(char,char), +def cyrillic_replace(char): #c + return cyrillic_dict.get(char,unicode(char)) +historic_latin_dict = { + 'B' : u'Ɓ', + 'b' : u'ƅ', + 'u' : u'ư', + 'U' : u'Ư', + '' : 'Ǟ', + #'5' : 'ƽ', + 'o' : 'ơ', + 'O' : 'Ơ', + '5' : 'Ƽ' + } +def historic_latin(char): #H + return historic_latin_dict.get(char,unicode(char)) +punctuation_dict = { + '!' : u'ǃ', + '\'': u'’', + '\"': u'ˮ', + '(' : u'⟨', + ')' : u'⟩', + ':' : u'ː', + #'-' : u'‒', + #'-' : u'—', + #'-' : u'―', + #'-' : u'‐', + #'-' : u'⁃', + '-' : u'–', + '_' : u'−', + '~' : u'⁓', + #'~' : u'∼', + #'~' : u'〜', + } +def punctuation(char): #p + return punctuation_dict.get(char,unicode(char)) def helpme(): print "usage %s [modes]" % sys.argv[0] print "modes:" print " c -- cyrillic replace" print " f -- fixed width" + print " p -- replace punctuation" + print " H -- replace with historic latin chars" print " h -- this message" sys.exit(0) @@ -49,14 +84,18 @@ if not modes : modes = "f" if 'h' in modes: helpme() -for mode in modes: - for line in sys.stdin: - for char in line: +for line in sys.stdin: + for char in line: + for mode in modes: if mode is 'c': - cyrillic_replace(char) + char = cyrillic_replace(char) elif mode is 'f': - fixed_width_replace(char) + char = fixed_width_replace(char) + elif mode is 'H': + char = historic_latin(char) + elif mode is 'p': + char = punctuation(char) else: print "unknown mode %c" % mode helpme() - + print char, @@ -13,17 +13,40 @@ # ghetto - toggles the lights in the hallway # 0-7 - toggles individual lights +TOGGLE=`echo "$2" | sed -n '/^[0-1]/p'` +shorthelp() { + echo "Usage: $0 [OPTIONS] [0|1]" + echo "Toggle the lights in the shack." + +} +longhelp(){ + shorthelp + +cat <<EOF + +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 +EOF +} 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 + longhelp + exit 1 fi STRING="\\xA5\\x5A\\x$LAMPE\\x$TOGGLE" if [ $# != 2 ] then - echo "Usage: licht <lampe> <0/1>" + longhelp + exit 1 else echo "Toggle light $LAMPE ($TOGGLE)" printf "$STRING" | nc -u -w1 licht.shack 1337 @@ -33,7 +56,7 @@ toggle() { toggle_all() { for i in `seq 0 7` do - printf "\\xA5\\x5A\\x$i\\x$TOGGLE" | nc -u -w1 licht.shack 1337 & + toggle $i $TOGGLE done wait } @@ -41,7 +64,7 @@ toggle_all() { kuschel(){ for i in 0 2 do - printf "\\xA5\\x5A\\x$i\\x$TOGGLE" | nc -u -w1 licht.shack 1337 & + toggle $i $TOGGLE done wait } @@ -49,7 +72,7 @@ kuschel(){ software(){ for i in 1 3 do - printf "\\xA5\\x5A\\x$i\\x$TOGGLE" | nc -u -w1 licht.shack 1337 & + toggle $i $TOGGLE done wait } @@ -57,57 +80,53 @@ software(){ tische(){ for i in 4 6 do - printf "\\xA5\\x5A\\x$i\\x$TOGGLE" | nc -u -w1 licht.shack 1337 & + toggle $i $TOGGLE done wait } ghetto(){ - printf "\\xA5\\x5A\\x7\\x$TOGGLE" | nc -u -w1 licht.shack 1337 + i=7 + toggle $i $TOGGLE } porsche(){ - printf "\\xA5\\x5A\\x5\\x$TOGGLE" | nc -u -w1 licht.shack 1337 + i=5 + toggle $i $TOGGLE } case "$1" in - --help) - echo "Toggle the lights" - echo "Usage: lich <lampe> <0/1>" + (--help) + if [ "$2" == "--verbose" ] + then longhelp + else shorthelp + fi ;; 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 ;; *) diff --git a/streams/stream.db b/streams/stream.db index 47ccf7b5..29949980 100644 --- a/streams/stream.db +++ b/streams/stream.db @@ -7,3 +7,4 @@ 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://radio.krautchan.net:8000/radio.mp3 radiofreieskrautchan diff --git a/util/bin/TouchpadToggle b/util/bin/TouchpadToggle new file mode 100755 index 00000000..17fd46b8 --- /dev/null +++ b/util/bin/TouchpadToggle @@ -0,0 +1,8 @@ +#!/bin/sh +# +#This script toggles the touchpad on a netbook using synclient. + +status=`synclient|awk '/TouchpadOff/{printf$3}'` +status=`expr \( $status + 1 \) \% 2` +synclient TouchpadOff=$status + diff --git a/util/bin/untouch b/util/bin/untouch new file mode 100755 index 00000000..17fd46b8 --- /dev/null +++ b/util/bin/untouch @@ -0,0 +1,8 @@ +#!/bin/sh +# +#This script toggles the touchpad on a netbook using synclient. + +status=`synclient|awk '/TouchpadOff/{printf$3}'` +status=`expr \( $status + 1 \) \% 2` +synclient TouchpadOff=$status + |