From b0b2e985a3f35962ed2f4d639d756862fcdc5168 Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 24 Mar 2017 14:08:44 +0100 Subject: Add LICENSE --- host/aus.py | 15 ++++++++++++++ host/bdf.c | 16 +++++++++++++++ host/bdf.py | 15 ++++++++++++++ host/color.c | 16 +++++++++++++++ host/config.py | 15 ++++++++++++++ host/crap.py | 16 +++++++++++++++ host/crap_to_opc.py | 15 ++++++++++++++ host/font.c | 16 +++++++++++++++ host/genpal.py | 14 +++++++++++++ host/gifserver.py | 15 ++++++++++++++ host/gifstream.py | 14 +++++++++++++ host/matelight.py | 16 +++++++++++++++ host/opc_to_crap.py | 15 ++++++++++++++ host/secret_sauce.py | 56 ---------------------------------------------------- host/server.py | 16 +++++++++++++++ host/terminal.py | 16 +++++++++++++++ host/usb.c | 16 +++++++++++++++ host/viewer.py | 17 +++++++++++++++- 18 files changed, 262 insertions(+), 57 deletions(-) delete mode 100644 host/secret_sauce.py (limited to 'host') diff --git a/host/aus.py b/host/aus.py index c0bab71..9aef0d1 100755 --- a/host/aus.py +++ b/host/aus.py @@ -1,4 +1,19 @@ #!/usr/bin/env python +# Matelight +# Copyright (C) 2016 Sebastian Götte +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . from socketserver import * import socket diff --git a/host/bdf.c b/host/bdf.c index a95ed8b..b118ba7 100644 --- a/host/bdf.c +++ b/host/bdf.c @@ -1,3 +1,19 @@ +/* Matelight + * Copyright (C) 2016 Sebastian Götte + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "config.h" #include "bdf.h" diff --git a/host/bdf.py b/host/bdf.py index fb4c928..377376a 100644 --- a/host/bdf.py +++ b/host/bdf.py @@ -1,3 +1,18 @@ +# Matelight +# Copyright (C) 2016 Sebastian Götte +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import config import threading diff --git a/host/color.c b/host/color.c index 17748d4..eaef3b1 100644 --- a/host/color.c +++ b/host/color.c @@ -1,3 +1,19 @@ +/* Matelight + * Copyright (C) 2016 Sebastian Götte + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "color.h" #include diff --git a/host/config.py b/host/config.py index b76e2aa..e40ad58 100644 --- a/host/config.py +++ b/host/config.py @@ -1,3 +1,18 @@ +# Matelight +# Copyright (C) 2016 Sebastian Götte +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # Display geometry # ┌─────────┐ ┌───┬───┬ ⋯ ┬───┬───┐ diff --git a/host/crap.py b/host/crap.py index 80fb647..482d487 100644 --- a/host/crap.py +++ b/host/crap.py @@ -1,3 +1,19 @@ +# Matelight +# Copyright (C) 2016 Sebastian Götte +# Copyright (C) 2015 Uwe Kamper +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import socket import struct diff --git a/host/crap_to_opc.py b/host/crap_to_opc.py index 83537d2..15d3e73 100755 --- a/host/crap_to_opc.py +++ b/host/crap_to_opc.py @@ -1,4 +1,19 @@ #!/usr/bin/env python3 +# Matelight +# Copyright (C) 2016 Sebastian Götte +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import struct import socket diff --git a/host/font.c b/host/font.c index 59bc2ef..81c39fe 100644 --- a/host/font.c +++ b/host/font.c @@ -1,3 +1,19 @@ +/* Matelight + * Copyright (C) 2016 Sebastian Götte + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "font.h" #include diff --git a/host/genpal.py b/host/genpal.py index b8e550b..5532cc0 100755 --- a/host/genpal.py +++ b/host/genpal.py @@ -1,5 +1,19 @@ #!/usr/bin/env python3 # Generate an XTerm-256 color RGB palette +# Copyright (C) 2016 Sebastian Götte +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . xterm_colors = [ (0x00, 0x00, 0x00), diff --git a/host/gifserver.py b/host/gifserver.py index 7fbbfe3..7a1338b 100755 --- a/host/gifserver.py +++ b/host/gifserver.py @@ -1,4 +1,19 @@ #!/usr/bin/env python +# Matelight +# Copyright (C) 2016 Sebastian Götte +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import argparse, time, argparse, textwrap, threading, io from urllib.parse import urlparse diff --git a/host/gifstream.py b/host/gifstream.py index a580ae1..9905d34 100755 --- a/host/gifstream.py +++ b/host/gifstream.py @@ -1,5 +1,19 @@ #!/usr/bin/env python3 # This script eats CRAP and outputs a live GIF-over-HTTP stream. The required bandwidth is about 20kB/s +# Copyright (C) 2016 Sebastian Götte +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import io import math diff --git a/host/matelight.py b/host/matelight.py index 886e0f1..442b8d2 100644 --- a/host/matelight.py +++ b/host/matelight.py @@ -1,3 +1,19 @@ +# Matelight +# Copyright (C) 2016 Sebastian Götte +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + import colorsys from itertools import product from ctypes import c_size_t, c_uint8, c_void_p, c_float, CDLL, Structure, POINTER diff --git a/host/opc_to_crap.py b/host/opc_to_crap.py index 85b4eeb..f39b471 100755 --- a/host/opc_to_crap.py +++ b/host/opc_to_crap.py @@ -1,4 +1,19 @@ #!/usr/bin/env python3 +# Matelight +# Copyright (C) 2016 Sebastian Götte +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import struct import socket diff --git a/host/secret_sauce.py b/host/secret_sauce.py deleted file mode 100644 index 3682b0e..0000000 --- a/host/secret_sauce.py +++ /dev/null @@ -1,56 +0,0 @@ - -from collections import defaultdict -import signal - - -RATELIMIT_THRESHOLD = 20 -GRAYLIST_LENGTH = 8 - -class SpamError(ValueError): - def __str__(self): - return ' '.join(self.args) - - -def loadlist(fn): - try: - with open(fn) as f: - return [ l for l in ( l.strip() for l in f.readlines() if not l.startswith('#')) if l ] - except: - return [] - -greenlist = set() - -graylist = [] -def do_graylist(msg): - global graylist - graylist = [msg] + graylist[:GRAYLIST_LENGTH-1] - -blacklist = loadlist('blacklist') -badwords = loadlist('badwords') -def signal_handler(_signum, _frame): - global blacklist, badwords - blacklist = load_blacklist() - badwords = load_badwords() -signal.signal(signal.SIGHUP, signal_handler) - -ratelimitdict = defaultdict(lambda: 0) -def empty_ratelimit(_signum, _frame): - global ratelimitdict - ratelimitdict = defaultdict(lambda: 0) -signal.signal(signal.SIGALRM, empty_ratelimit) -signal.setitimer(signal.ITIMER_REAL, 60) - -def check_spam(addr, data): - ratelimitdict[addr] += 1 - try: - if ratelimitdict[addr] > RATELIMIT_THRESHOLD: - raise SpamError('rate-limit') - if any(word in data.lower() for word in badwords): - raise SpamError('badwords filter') - if addr not in greenlist and data in graylist: - raise SpamError('graylist') - except SpamError as err: - do_graylist(data) - blacklist.append(addr) - raise err - greenlist.add(addr) diff --git a/host/server.py b/host/server.py index e622d9b..d65b721 100755 --- a/host/server.py +++ b/host/server.py @@ -1,4 +1,20 @@ #!/usr/bin/env python +# Matelight +# Copyright (C) 2016 Sebastian Götte +# Copyright (C) 2015 Uwe Kamper +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import socket import time diff --git a/host/terminal.py b/host/terminal.py index 86b4db1..2a4e4d6 100644 --- a/host/terminal.py +++ b/host/terminal.py @@ -1,3 +1,19 @@ +# Matelight +# Copyright (C) 2016 Sebastian Götte +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + from pixelterm.pixelterm import termify_pixels class MockImage: diff --git a/host/usb.c b/host/usb.c index 18b38a8..9cf78b6 100644 --- a/host/usb.c +++ b/host/usb.c @@ -1,3 +1,19 @@ +/* Matelight + * Copyright (C) 2016 Sebastian Götte + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include #include diff --git a/host/viewer.py b/host/viewer.py index 9862961..316e4cc 100755 --- a/host/viewer.py +++ b/host/viewer.py @@ -1,4 +1,19 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# Matelight +# Copyright (C) 2016 Sebastian Götte +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import argparse import atexit -- cgit