From b657927cf0b6420683c261ff32434b2b8b2cdf70 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 15 Mar 2014 01:03:52 +0100 Subject: ircasy: more debug in text decoding --- Reaktor/IRC/ircasy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Reaktor/IRC/ircasy.py b/Reaktor/IRC/ircasy.py index fd261ae9..ac071013 100644 --- a/Reaktor/IRC/ircasy.py +++ b/Reaktor/IRC/ircasy.py @@ -85,7 +85,10 @@ class asybot(asychat): alarm(self.hammer_interval) def collect_incoming_data(self, data): - self.data += data.decode() + try: + self.data += data.decode() + except Exception as e: + print('error decoding message: ' + str(e)); def found_terminator(self): self.log.debug('<< %s' % self.data) -- cgit v1.2.3 From a9633ea16310f99c7a39dcd8c4a1c7bb05326135 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 15 Mar 2014 01:04:16 +0100 Subject: ircasy: new nickinuse function --- Reaktor/IRC/ircasy.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Reaktor/IRC/ircasy.py b/Reaktor/IRC/ircasy.py index ac071013..4dfff390 100644 --- a/Reaktor/IRC/ircasy.py +++ b/Reaktor/IRC/ircasy.py @@ -176,8 +176,9 @@ class asybot(asychat): pass def on_nickinuse(self, prefix, command, params, rest): - _, nickname, int, _ = split('^.*[^0-9]([0-9]+)$', self.nickname) \ - if search('[0-9]$', self.nickname) \ - else ['', self.nickname, 0, ''] - self.nickname = nickname + str(int + 1) - self.handle_connect() + regex = re.search('(\d+)$', self.nickname) + if regex: + theint = int(regex.group(0)) + self.nickname = self.nickname.strip(theint) + str(theint + 1) + else self.nickname = self.nickname + '0' + self.handle_connect() -- cgit v1.2.3 From 94751bf732ad1268e6885db8bd03b054a81f9a20 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 15 Mar 2014 01:17:29 +0100 Subject: ircasy: fix nickinuse --- Reaktor/IRC/ircasy.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Reaktor/IRC/ircasy.py b/Reaktor/IRC/ircasy.py index 4dfff390..5a07e8fc 100644 --- a/Reaktor/IRC/ircasy.py +++ b/Reaktor/IRC/ircasy.py @@ -178,7 +178,8 @@ class asybot(asychat): def on_nickinuse(self, prefix, command, params, rest): regex = re.search('(\d+)$', self.nickname) if regex: - theint = int(regex.group(0)) - self.nickname = self.nickname.strip(theint) + str(theint + 1) - else self.nickname = self.nickname + '0' + theint = int(regex.group(0)) + self.nickname = self.nickname.strip(theint) + str(theint + 1) + else: + self.nickname = self.nickname + '0' self.handle_connect() -- cgit v1.2.3 From aed82c8e85ae193a575282123ebb808899c696f1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 15 Mar 2014 01:18:42 +0100 Subject: ircasy: more fix(drunk) --- Reaktor/IRC/ircasy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reaktor/IRC/ircasy.py b/Reaktor/IRC/ircasy.py index 5a07e8fc..c62beee4 100644 --- a/Reaktor/IRC/ircasy.py +++ b/Reaktor/IRC/ircasy.py @@ -176,7 +176,7 @@ class asybot(asychat): pass def on_nickinuse(self, prefix, command, params, rest): - regex = re.search('(\d+)$', self.nickname) + regex = search('(\d+)$', self.nickname) if regex: theint = int(regex.group(0)) self.nickname = self.nickname.strip(theint) + str(theint + 1) -- cgit v1.2.3 From 6c1d0f30624905e2d53d2f7a09f935b91b5a2dc1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 15 Mar 2014 01:19:42 +0100 Subject: ircasy: debugging through git is fine --- Reaktor/IRC/ircasy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reaktor/IRC/ircasy.py b/Reaktor/IRC/ircasy.py index c62beee4..57ec9189 100644 --- a/Reaktor/IRC/ircasy.py +++ b/Reaktor/IRC/ircasy.py @@ -179,7 +179,7 @@ class asybot(asychat): regex = search('(\d+)$', self.nickname) if regex: theint = int(regex.group(0)) - self.nickname = self.nickname.strip(theint) + str(theint + 1) + self.nickname = self.nickname.strip(str(theint)) + str(theint + 1) else: self.nickname = self.nickname + '0' self.handle_connect() -- cgit v1.2.3 From e2cf4fc92569487e21d096ac6879177aac8f73c1 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 16 Mar 2014 12:55:24 +0100 Subject: update tor_announce --- ship/lib/filehooker | 23 +++++++++++++++++++++++ ship/src/install_tor_announce | 5 +++++ 2 files changed, 28 insertions(+) create mode 100644 ship/src/install_tor_announce diff --git a/ship/lib/filehooker b/ship/lib/filehooker index a6987733..5e6def5d 100644 --- a/ship/lib/filehooker +++ b/ship/lib/filehooker @@ -1,4 +1,5 @@ #@include core +#@include network ncdc_user=${ncdc_user:-hooker} ncdc_bin=${ncdc_bin:-/usr/bin/ncdc} @@ -60,3 +61,25 @@ WantedBy=multi-user.target EOF systemctl enable ncdc@$ncdc_user } + +install_tor_announce(){ +# systemd only +cat > /etc/systemd/system/tor_announce.service<