From a7fd3fa12427f36770e6105fad8a0b59118a5647 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 16 Sep 2011 01:07:03 +0200 Subject: punani: remove stderr redirection for pacman stderr redirection results in the shadowing of "Proceed with installation? [Y/n]" leading to total trolling of the user which then most likely will wait forever --- punani/bin/punani | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/punani/bin/punani b/punani/bin/punani index d118b13c..cec53ca1 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -79,7 +79,7 @@ handle_system () { # # when trying harder it tries to load the package with the given name directly via yaourt echo "** trying to find package with given file" - if pacman -S `pkgfile $1` 2>/dev/null; then + if pacman -S `pkgfile $1` ; then echo "++ finished" exit 0 else -- cgit v1.2.3 From 1df82a37249e46c50a95a933c4f9d3ca29636e70 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 16 Sep 2011 17:01:58 +0200 Subject: REAKTOR/UDP: add Specs --- Reaktor/UDP/README | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Reaktor/UDP/README diff --git a/Reaktor/UDP/README b/Reaktor/UDP/README new file mode 100644 index 00000000..d77ce7ff --- /dev/null +++ b/Reaktor/UDP/README @@ -0,0 +1,40 @@ +# Specifications +From 2011-09-16: +## Use Case + { + { + "port": 1337, + "pattern": "XXYY", + "action" : { + "POST": { + "url" : "xyz", + "data" : "abc" + } + } + } + } +## Actions +### POST +"POST" : { + "url" : "http://euer.krebsco.de/", + "data" : "{ \"something\" : \"else\" }" + } + +### PROCESS +Process is taken from //hyper/process/test/bc.json - rev:a7fd3f + +stdout/stderr are optional and if left away data will be written to real stdout/stderr + + "PROCESS" : { + { + "path": "/usr/bin/bc", + "argv": [ + "bc" + ], + "envp": { + "was": "geht" + }, + "stdout": "/path/to/file", + "stderr": "/path/to/file" + } + } -- cgit v1.2.3 From 10126da289436f015ad22cbc843248b58f6a74df Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 16 Sep 2011 17:18:45 +0200 Subject: Reaktor/UDP: add uri to specs, bug in use case --- Reaktor/UDP/README | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Reaktor/UDP/README b/Reaktor/UDP/README index d77ce7ff..f89d377d 100644 --- a/Reaktor/UDP/README +++ b/Reaktor/UDP/README @@ -1,7 +1,7 @@ # Specifications From 2011-09-16: ## Use Case - { + [ { "port": 1337, "pattern": "XXYY", @@ -12,7 +12,7 @@ From 2011-09-16: } } } - } + ] ## Actions ### POST "POST" : { @@ -34,7 +34,7 @@ stdout/stderr are optional and if left away data will be written to real stdout/ "envp": { "was": "geht" }, - "stdout": "/path/to/file", - "stderr": "/path/to/file" + "stdout": "uri:///path/to/somewhere", + "stderr": "uri:///path/to/somewhere" } } -- cgit v1.2.3 From d40812a81a6a5ae898e319c51fcf938950af2020 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 16 Sep 2011 17:39:21 +0200 Subject: thesauron: add punching Lemma,Verkrebsung --- cholerab/thesauron | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cholerab/thesauron b/cholerab/thesauron index 2c329db8..21fa1cf9 100644 --- a/cholerab/thesauron +++ b/cholerab/thesauron @@ -1,33 +1,54 @@ +Legende: + Cholerab n. +[de] - Kunstwort aus Kollaboration und Cholera. Beschreibt den Zustand, dass Zusammenarbeit niemals gut, einfach und ohne Schmerzen funktioniert. - Teamwork-Plattform für Krebscode. KD;RP abbr. (pronounciation: kah-derp) +[en] - Short for Krebs Darknet / Retiolum Prefix. Nahziel n. +[de] - Ziel mit höchst möglicher Priorität. Nahzielerfahrung n. +[de] - das Erlebnis der (endgültigen) Nichterreichung eines Nahziels (obwohl nur noch wenig ((quasi-) infinitesimal viel) nötig gewesen wäre). +Punching Lemma n. +[de] +- Sozialer Druck zur Aufrechterhaltung der Ordnung in dem sozialen Geflaecht + von Krebs + Retiolum n. +[en] - The official darknet of Krebs which utilizes the Retiolum Prefix to address individual nodes. Retiolum Prefix n. +[en] - The universally accepted IPv6-prefix, 42::/16. Anyone can has a /128-subnet and, if require, anything larger. Retiolum Realtime Map n. +[en] - The network map of the public visible part of Retiolum. RRM [abbr.] +[en] - Short for Retiolum Retiolum Map. Sanatorium n. +[en] - The Krebs Control and Command Center. - An Retiolum-based IRC-channel where all Reaktor-enabled nodes gather and lurk for relevant input. + +Verkrebsung n. +[de] +- Synonym fuer die Installation von Krebs (oder eine einzelnen Krebs + Komponente) auf einem beliebigem System. -- cgit v1.2.3 From 87a25a6527bcd9fd9c7ffa6eea9668e4bfd4b718 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 17 Sep 2011 12:06:21 +0200 Subject: Reaktor/UDP: ubot - initial commit update specs which now decribe how the head of the conf entry may look like ubot is currenly an executable skeleton which important functions marked as to be implemented. --- Reaktor/UDP/README | 11 +++++++++++ Reaktor/UDP/index | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100755 Reaktor/UDP/index diff --git a/Reaktor/UDP/README b/Reaktor/UDP/README index f89d377d..ad7117fe 100644 --- a/Reaktor/UDP/README +++ b/Reaktor/UDP/README @@ -13,6 +13,17 @@ From 2011-09-16: } } ] +## Head definition + { + "bind" : "127.0.0.1", + "port" : 1234, + "pattern" : "XXZZ", + "terminator" : "\r\n" + "action" : { }, + } +bind is an optional entry which lets the user define a bind address for the server. +terminator is optional which lets the user define the EOM terminator. + ## Actions ### POST "POST" : { diff --git a/Reaktor/UDP/index b/Reaktor/UDP/index new file mode 100755 index 00000000..950f0d21 --- /dev/null +++ b/Reaktor/UDP/index @@ -0,0 +1,57 @@ +#!/usr/bin/python + +from asycore import asychat +import logging +import sys +log = logging.getLogger('asybot') + +def enable_syslog(logger): + import logging.handlers as handlers + from logging import Formatter + hdlr = handlers.SysLogHandler( + facility=handlers.SysLogHandler.LOG_DAEMON) + formatter = Formatter( + '%(filename)s: %(levelname)s: %(message)s') + hdlr.setFormatter(formatter) + logger.addHandler(hdlr) + +class ubot(asychat): + """ UDP Bot """ + def __init__(self, port,pattern,action,bind="0.0.0.0",terminator='\r\n'): + asychat.__init__(self) + self.bind = bind + self.port = port + self.data = '' + self.set_terminator('\r\n') + self.bind_socket() + + def bind_socket(self): + """ + if the socket is already bound we want to reuse this socket anyway + """ + log.error("not yet implemented") + sys.exit(23) + def collect_incoming_data(self,data): + self.data += data + + def found_terminator(self): + """ + TODO what happens if, for example in an html message we find our pattern a hundred times. + should the actions been called a hundred times or just once for the connect? + """ + log.debug('<< %s' % self.data) + + message = self.data + self.data = '' + if self.find_pattern(message): + self.start_action(message) + + def find_pattern(self,message): + """ returns true if own pattern is found""" + log.error("not yet implemented") + sys.exit(23) + + def start_action(self,message): + """ runs all the defined actions""" + log.error("not yet implemented") + sys.exit(23) -- cgit v1.2.3 From c614e25114faafb4795338ecb93c284835a677ce Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 17 Sep 2011 13:43:22 +0200 Subject: Reaktor/UDP: rewrite ubot replace the ubot code with acutally working code --- Reaktor/UDP/index | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/Reaktor/UDP/index b/Reaktor/UDP/index index 950f0d21..c46202b8 100755 --- a/Reaktor/UDP/index +++ b/Reaktor/UDP/index @@ -1,6 +1,6 @@ #!/usr/bin/python -from asycore import asychat +import asyncore, socket import logging import sys log = logging.getLogger('asybot') @@ -15,43 +15,48 @@ def enable_syslog(logger): hdlr.setFormatter(formatter) logger.addHandler(hdlr) -class ubot(asychat): +class ubot(asyncore.dispatcher): """ UDP Bot """ - def __init__(self, port,pattern,action,bind="0.0.0.0",terminator='\r\n'): - asychat.__init__(self) - self.bind = bind + def __init__(self, port,pattern,action,bind_addr="",): + asyncore.dispatcher.__init__(self) + self.bind_addr = bind_addr self.port = port self.data = '' - self.set_terminator('\r\n') self.bind_socket() def bind_socket(self): """ if the socket is already bound we want to reuse this socket anyway """ - log.error("not yet implemented") - sys.exit(23) - def collect_incoming_data(self,data): - self.data += data - - def found_terminator(self): - """ - TODO what happens if, for example in an html message we find our pattern a hundred times. - should the actions been called a hundred times or just once for the connect? - """ + + self.create_socket(socket.AF_INET,socket.SOCK_DGRAM) + self.set_reuse_addr() + self.socket.setsockopt(socket.SOL_SOCKET,socket.SO_BROADCAST,1) + log.info("Binding Socket at %s:%d" %(self.bind_addr,self.port)) + self.bind( (self.bind_addr,self.port) ) + + def handle_connect(self): + log.info("Server Started") + def handle_read(self): + self.data,addr = self.recvfrom(2048) log.debug('<< %s' % self.data) - message = self.data - self.data = '' - if self.find_pattern(message): - self.start_action(message) + if self.find_pattern(): + self.start_action() - def find_pattern(self,message): + def find_pattern(self): """ returns true if own pattern is found""" log.error("not yet implemented") sys.exit(23) - def start_action(self,message): + def start_action(self): """ runs all the defined actions""" log.error("not yet implemented") sys.exit(23) + +if __name__ == "__main__": + import os + lol = logging.DEBUG if os.environ.get('debug',False) else logging.INFO + logging.basicConfig(level=lol) + ubot(1337,r'',{}) + asyncore.loop() -- cgit v1.2.3 From 2a54f1cef0d547be126d77a315afdf5dff58d1c2 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 17 Sep 2011 14:22:22 +0200 Subject: Reaktor/UDP: add matcher function for ubot --- Reaktor/UDP/index | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Reaktor/UDP/index b/Reaktor/UDP/index index c46202b8..b7a21508 100755 --- a/Reaktor/UDP/index +++ b/Reaktor/UDP/index @@ -2,8 +2,9 @@ import asyncore, socket import logging +import re import sys -log = logging.getLogger('asybot') +log = logging.getLogger('ubot') def enable_syslog(logger): import logging.handlers as handlers @@ -15,6 +16,7 @@ def enable_syslog(logger): hdlr.setFormatter(formatter) logger.addHandler(hdlr) + class ubot(asyncore.dispatcher): """ UDP Bot """ def __init__(self, port,pattern,action,bind_addr="",): @@ -22,21 +24,25 @@ class ubot(asyncore.dispatcher): self.bind_addr = bind_addr self.port = port self.data = '' + self.pattern = pattern + self.action = action self.bind_socket() def bind_socket(self): """ if the socket is already bound we want to reuse this socket anyway """ - self.create_socket(socket.AF_INET,socket.SOCK_DGRAM) self.set_reuse_addr() - self.socket.setsockopt(socket.SOL_SOCKET,socket.SO_BROADCAST,1) - log.info("Binding Socket at %s:%d" %(self.bind_addr,self.port)) + self.socket.setsockopt( + socket.SOL_SOCKET,socket.SO_BROADCAST,1) + log.info("Binding Socket at %s:%d" + %(self.bind_addr,self.port)) self.bind( (self.bind_addr,self.port) ) def handle_connect(self): log.info("Server Started") + def handle_read(self): self.data,addr = self.recvfrom(2048) log.debug('<< %s' % self.data) @@ -46,17 +52,25 @@ class ubot(asyncore.dispatcher): def find_pattern(self): """ returns true if own pattern is found""" - log.error("not yet implemented") - sys.exit(23) + log.debug("Pattern is %s" %self.pattern) + ret = re.search(self.pattern,self.data) + if ret: + log.info("Match \"%s\" with pattern \"%s\"" % ((ret.string.strip()),self.pattern)) + else: + log.info("No Match") + return ret + def start_action(self): """ runs all the defined actions""" + log.debug("Actions: %s" % str(self.action)) log.error("not yet implemented") sys.exit(23) if __name__ == "__main__": import os + #enable_syslog(log) lol = logging.DEBUG if os.environ.get('debug',False) else logging.INFO logging.basicConfig(level=lol) - ubot(1337,r'',{}) + ubot(1337,r'abc',{}) asyncore.loop() -- cgit v1.2.3 From a13929a1e9b88d13fd5cc43f699cfb9c3dd71499 Mon Sep 17 00:00:00 2001 From: momo Date: Sat, 17 Sep 2011 16:59:54 +0200 Subject: //evan/satz-liste add 2 new sentences --- evan/satz-liste | 3 +++ 1 file changed, 3 insertions(+) diff --git a/evan/satz-liste b/evan/satz-liste index e14aaf78..44f84c13 100644 --- a/evan/satz-liste +++ b/evan/satz-liste @@ -12,3 +12,6 @@ bewässere die Pflanzen Öffne ein Fenster wische die tische Weniger Licht ist mehr +sammle pfandflaschen ein +zahle deinen mitgliedsbeitrag + -- cgit v1.2.3 From dae3147e1bad4c57f7e492ab7df7a1679b4b2273 Mon Sep 17 00:00:00 2001 From: momo Date: Sun, 18 Sep 2011 19:51:53 +0200 Subject: //cholerab/news/Candidate: Add Information about the "Kommandozentrale" --- cholerab/news/Candidate | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cholerab/news/Candidate b/cholerab/news/Candidate index 1b52abe4..4d25b6c0 100644 --- a/cholerab/news/Candidate +++ b/cholerab/news/Candidate @@ -57,3 +57,10 @@ Ein Webinterface ist noch nicht geplant. Die Musiksammlung kann in incoming/Musik auf der Filebitch erweitert werden. ## 3. KNUT - Die Krebs Notification Utility Toolchain + + +## 4. Krebs Kommandozentrale + +Der 17" Monitor am Krebs sowie die auf dem Drucker liegende Tastatur wurden so modifiziert dass auf der ersten shell ein ncmpc Interface zu sehen ist, womit sich der MPD und somit auch die Loungebeschallung steuern lässt. Auf der 2. Shell (änderbar duch ctrl+alt+F2) befindet sich ein direktzugriff auf //noise, welcher es u.a. ermöglicht streams zu wechseln oder das licht ein/auszuschalten. + +Credits gehen an KM momo und KM tv -- cgit v1.2.3