From c80b15a24ac02d864f0c6e794b903bdbef1a27f3 Mon Sep 17 00:00:00 2001 From: Malte Bublitz Date: Tue, 2 May 2023 14:24:28 +0200 Subject: [PATCH] Current state on torchwood at 2023-05-02 Everything inside the working directory on my notebook. I really fucked up this repository... Two very different working directories on my two main computers, which moved far away from the last commit, 058aa03fe207f79830c9b8511331d4e3f09001bf. And to get things more complicated, the currently deployed instance (which is running on my Raspberry Pi) isn't even a Git repo... --- .vscode/settings.json | 6 + Containerfile | 30 ++ Containerfile.old | 14 + Makefile | 31 +- README.md | 56 ++- TODO.md | 0 bbs/__init__.py | 1 + bbs/__main__.py | 7 + bbs/bofh.py | 27 ++ bbs/daemon2.py | 129 +++++ bbs/data/excuses | 466 +++++++++++++++++++ bbs/excuses | 466 +++++++++++++++++++ bbs/fakeenv.py | 81 ++++ bbs/mfingerd.py | 151 ++++++ bbs/mfingerd_daemon.py | 36 ++ bbs/minishell.py | 248 ++++++++++ bin/lxc-launcher | 11 + bin/tardis-minishell | 12 + deepthought.fingerinfo.db | 1 + doc/bbs-minishell.libvirt-lxc-domain.xml | 36 ++ doc/config_backup_spandau.py | 35 ++ doc/logo.txt | 32 ++ fingerinfo.db | 1 + mcbxDOS_bbs.py | 93 ++++ mfingerd.service | 16 + my_daemon2.py | 26 ++ qotd | 47 ++ requirements.txt | 4 + spandau.fingerinfo.db | 1 + test.py | 51 ++ twisted-tutorial/README.md | 6 + twisted-tutorial/TwistedQuotes/__init__.py | 3 + twisted-tutorial/TwistedQuotes/quoteproto.py | 35 ++ twisted-tutorial/TwistedQuotes/quoters.py | 33 ++ 34 files changed, 2184 insertions(+), 8 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 Containerfile create mode 100644 Containerfile.old create mode 100644 TODO.md create mode 100644 bbs/__init__.py create mode 100644 bbs/__main__.py create mode 100644 bbs/bofh.py create mode 100644 bbs/daemon2.py create mode 100644 bbs/data/excuses create mode 100644 bbs/excuses create mode 100644 bbs/fakeenv.py create mode 100644 bbs/mfingerd.py create mode 100755 bbs/mfingerd_daemon.py create mode 100644 bbs/minishell.py create mode 100755 bin/lxc-launcher create mode 100755 bin/tardis-minishell create mode 100644 deepthought.fingerinfo.db create mode 100644 doc/bbs-minishell.libvirt-lxc-domain.xml create mode 100644 doc/config_backup_spandau.py create mode 100644 doc/logo.txt create mode 100644 fingerinfo.db create mode 100755 mcbxDOS_bbs.py create mode 100644 mfingerd.service create mode 100644 my_daemon2.py create mode 100755 qotd create mode 100644 requirements.txt create mode 100644 spandau.fingerinfo.db create mode 100644 test.py create mode 100644 twisted-tutorial/README.md create mode 100644 twisted-tutorial/TwistedQuotes/__init__.py create mode 100644 twisted-tutorial/TwistedQuotes/quoteproto.py create mode 100644 twisted-tutorial/TwistedQuotes/quoters.py diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..114d845 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "python.pythonPath": "/usr/bin/python3", + "python.linting.flake8Enabled": false, + "python.linting.enabled": true, + "python.linting.pylintEnabled": true +} diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..8d61922 --- /dev/null +++ b/Containerfile @@ -0,0 +1,30 @@ +# https://snyk.io/blog/best-practices-containerizing-python-docker/ +# https://pythonspeed.com/articles/dockerizing-python-is-hard/ + +FROM python:3.11-slim-bullseye +MAINTAINER Malte Bublitz, bbs-docker@malte70.de + + +# Install requirements +COPY requirements.txt /tmp/ +RUN pip install -r /tmp/requirements.txt + + +# Avoid running as root, which is the default behaviour +RUN useradd --create-home appuser +WORKDIR /home/appuser +USER appuser + + +# Create /app +COPY . /app + + +# Install updates (including security updates!) +RUN apt-get update && apt-get -y upgrade + + +# Run the application +WORKDIR /app +CMD ["bin/tardis-minishell"] + diff --git a/Containerfile.old b/Containerfile.old new file mode 100644 index 0000000..2542989 --- /dev/null +++ b/Containerfile.old @@ -0,0 +1,14 @@ +# https://snyk.io/blog/best-practices-containerizing-python-docker/ + +FROM python:3.11-slim +MAINTAINER Malte Bublitz, bbs-docker@malte70.de + +# Take advantage of build layers +COPY requirements.txt /app +RUN pip install -r requirements.txt + +COPY . /app + +WORKDIR /app +CMD ["bin/tardis-minishell"] + diff --git a/Makefile b/Makefile index f5604fe..6e3e676 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,29 @@ -WGET = wget -EXCUSES_URL = http://pages.cs.wisc.edu/~ballard/bofh/excuses +WGET = wget +INSTALL = install +#EXCUSES = excuses +EXCUSES = bbs/excuses +EXCUSES_URL = http://pages.cs.wisc.edu/~ballard/bofh/excuses +MFINGERD_UNIT = mfingerd.service +SYSTEMD_DEST = /etc/systemd/system +PICKLEDB_URL = https://raw.githubusercontent.com/patx/pickledb/master/pickledb.py +VENV = ./.venv -all: excuses +.PHONY: install install_systemd clean clean-all + +all: $(EXCUSES) + +$(EXCUSES): + $(WGET) -O $(EXCUSES) $(EXCUSES_URL) + +install: install_systemd -excuses: - $(WGET) $(EXCUSES_URL) +install_systemd: $(MFINGERD_UNIT) + $(INSTALL) -m644 $(MFINGERD_UNIT) $(SYSTEMD_DEST) + +clean: + find . -type d -name __pycache__ -delete + $(RM) excuses + +clean-all: clean + $(RM) -r $(VENV) diff --git a/README.md b/README.md index 305b7bb..44f1185 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,60 @@ # Malte's BBS -# Installation +## Installation -- Copy all files to `/opt/bbs` -- Configure xinetd: +Although not necessary, you should copy all files to a directory. +The default is `/opt/bbs` (following the Filesystem Hierarchy Standard). + +Start by downloading required 3rd party files using the Makefile: + +``` +make all +``` + +### Install the BBS itself (Telnet) + +- Configure *inetd* in `/etc/inetd.conf`: ``` telnet stream tcp nowait nobody /usr/sbin/tcpd /usr/sbin/telnetd --no-hostinfo --exec-login=/opt/bbs/minishell ``` +### Quote of the Day + +Add the following line to `/etc/inetd.conf`: + +``` +qotd stream tcp nowait nobody /opt/bbs/qotd +``` + +### mFingerd + +mFingerd is started using it's own systemd unit file, and not by inetd. +You can install the `.service` unit using *make*: + +``` +make install_systemd +``` + +> Currently you need to manually change the install location in +> `mfingerd.service` if it differs from `/opt/bbs` (option +> `WorkingDirectory in the section `[Service]`) + +## Files + +- **Common files** + - `README.md` + - `LICENSE` + - `Makefile` + - `excuses` *(Downloaded by Makefile target)* +- **mFingerd** + - `mfingerd.service` + - `mfingerd.py` + - `bofh.py` + - `logo.txt` +- **QOTD** + - `qotd` *(Just a wrapper for fortune)* +- *BBS* + - `minishell` + - `bbs\_env.py + - `bofh.py` + diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..e69de29 diff --git a/bbs/__init__.py b/bbs/__init__.py new file mode 100644 index 0000000..40a96af --- /dev/null +++ b/bbs/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/bbs/__main__.py b/bbs/__main__.py new file mode 100644 index 0000000..860d1ea --- /dev/null +++ b/bbs/__main__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- + +from bbs.minishell import minishell + +if __name__ == "__main__": + minishell() + \ No newline at end of file diff --git a/bbs/bofh.py b/bbs/bofh.py new file mode 100644 index 0000000..ebae5ad --- /dev/null +++ b/bbs/bofh.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- + +import os +import random + +BOFH_EXCUSES = os.path.join( + os.path.dirname( + __file__ + ), + "excuses" +) + +def get_excuse(excuses=BOFH_EXCUSES): + """Get a random excuse + + Returns a random line from the file excuses + """ + f = open(excuses, "r") + excuses = f.read().split("\n") + f.close() + n = len(excuses) + i = random.randint(0, n-1) + return excuses[i] + +if __name__ == "__main__": + print(get_excuse()) + diff --git a/bbs/daemon2.py b/bbs/daemon2.py new file mode 100644 index 0000000..bfe3019 --- /dev/null +++ b/bbs/daemon2.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python + +import sys, os, time, atexit +from signal import SIGTERM + +class Daemon: + """ + A generic daemon class. + + Usage: subclass the Daemon class and override the run() method + """ + def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): + self.stdin = stdin + self.stdout = stdout + self.stderr = stderr + self.pidfile = pidfile + + def daemonize(self): + """ + do the UNIX double-fork magic, see Stevens' "Advanced + Programming in the UNIX Environment" for details (ISBN 0201563177) + http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16 + """ + try: + pid = os.fork() + if pid > 0: + # exit first parent + sys.exit(0) + except OSError, e: + sys.stderr.write("fork #1 failed: %d (%s)\n" % (e.errno, e.strerror)) + sys.exit(1) + + # decouple from parent environment + os.chdir("/") + os.setsid() + os.umask(0) + + # do second fork + try: + pid = os.fork() + if pid > 0: + # exit from second parent + sys.exit(0) + except OSError, e: + sys.stderr.write("fork #2 failed: %d (%s)\n" % (e.errno, e.strerror)) + sys.exit(1) + + # redirect standard file descriptors + sys.stdout.flush() + sys.stderr.flush() + si = file(self.stdin, 'r') + so = file(self.stdout, 'a+') + se = file(self.stderr, 'a+', 0) + os.dup2(si.fileno(), sys.stdin.fileno()) + os.dup2(so.fileno(), sys.stdout.fileno()) + os.dup2(se.fileno(), sys.stderr.fileno()) + + # write pidfile + atexit.register(self.delpid) + pid = str(os.getpid()) + file(self.pidfile,'w+').write("%s\n" % pid) + + def delpid(self): + os.remove(self.pidfile) + + def start(self): + """ + Start the daemon + """ + # Check for a pidfile to see if the daemon already runs + try: + pf = file(self.pidfile,'r') + pid = int(pf.read().strip()) + pf.close() + except IOError: + pid = None + + if pid: + message = "pidfile %s already exist. Daemon already running?\n" + sys.stderr.write(message % self.pidfile) + sys.exit(1) + + # Start the daemon + self.daemonize() + self.run() + + def stop(self): + """ + Stop the daemon + """ + # Get the pid from the pidfile + try: + pf = file(self.pidfile,'r') + pid = int(pf.read().strip()) + pf.close() + except IOError: + pid = None + + if not pid: + message = "pidfile %s does not exist. Daemon not running?\n" + sys.stderr.write(message % self.pidfile) + return # not an error in a restart + + # Try killing the daemon process + try: + while 1: + os.kill(pid, SIGTERM) + time.sleep(0.1) + except OSError, err: + err = str(err) + if err.find("No such process") > 0: + if os.path.exists(self.pidfile): + os.remove(self.pidfile) + else: + print str(err) + sys.exit(1) + + def restart(self): + """ + Restart the daemon + """ + self.stop() + self.start() + + def run(self): + """ + You should override this method when you subclass Daemon. It will be called after the process has been + daemonized by start() or restart(). + """ \ No newline at end of file diff --git a/bbs/data/excuses b/bbs/data/excuses new file mode 100644 index 0000000..ca5c311 --- /dev/null +++ b/bbs/data/excuses @@ -0,0 +1,466 @@ +clock speed +solar flares +electromagnetic radiation from satellite debris +static from nylon underwear +static from plastic slide rules +global warming +poor power conditioning +static buildup +doppler effect +hardware stress fractures +magnetic interference from money/credit cards +dry joints on cable plug +we're waiting for [the phone company] to fix that line +sounds like a Windows problem, try calling Microsoft support +temporary routing anomaly +somebody was calculating pi on the server +fat electrons in the lines +excess surge protection +floating point processor overflow +divide-by-zero error +POSIX compliance problem +monitor resolution too high +improperly oriented keyboard +network packets travelling uphill (use a carrier pigeon) +Decreasing electron flux +first Saturday after first full moon in Winter +radiosity depletion +CPU radiator broken +It works the way the Wang did, what's the problem +positron router malfunction +cellular telephone interference +techtonic stress +piezo-electric interference +(l)user error +working as designed +dynamic software linking table corrupted +heavy gravity fluctuation, move computer to floor rapidly +secretary plugged hairdryer into UPS +terrorist activities +not enough memory, go get system upgrade +interrupt configuration error +spaghetti cable cause packet failure +boss forgot system password +bank holiday - system operating credits not recharged +virus attack, luser responsible +waste water tank overflowed onto computer +Complete Transient Lockout +bad ether in the cables +Bogon emissions +Change in Earth's rotational speed +Cosmic ray particles crashed through the hard disk platter +Smell from unhygienic janitorial staff wrecked the tape heads +Little hamster in running wheel had coronary; waiting for replacement to be Fedexed from Wyoming +Evil dogs hypnotised the night shift +Plumber mistook routing panel for decorative wall fixture +Electricians made popcorn in the power supply +Groundskeepers stole the root password +high pressure system failure +failed trials, system needs redesigned +system has been recalled +not approved by the FCC +need to wrap system in aluminum foil to fix problem +not properly grounded, please bury computer +CPU needs recalibration +system needs to be rebooted +bit bucket overflow +descramble code needed from software company +only available on a need to know basis +knot in cables caused data stream to become twisted and kinked +nesting roaches shorted out the ether cable +The file system is full of it +Satan did it +Daemons did it +You're out of memory +There isn't any problem +Unoptimized hard drive +Typo in the code +Yes, yes, its called a design limitation +Look, buddy: Windows 3.1 IS A General Protection Fault. +That's a great computer you have there; have you considered how it would work as a BSD machine? +Please excuse me, I have to circuit an AC line through my head to get this database working. +Yeah, yo mama dresses you funny and you need a mouse to delete files. +Support staff hung over, send aspirin and come back LATER. +Someone is standing on the ethernet cable, causing a kink in the cable +Windows 95 undocumented "feature" +Runt packets +Password is too complex to decrypt +Boss' kid fucked up the machine +Electromagnetic energy loss +Budget cuts +Mouse chewed through power cable +Stale file handle (next time use Tupperware(tm)!) +Feature not yet implemented +Internet outage +Pentium FDIV bug +Vendor no longer supports the product +Small animal kamikaze attack on power supplies +The vendor put the bug there. +SIMM crosstalk. +IRQ dropout +Collapsed Backbone +Power company testing new voltage spike (creation) equipment +operators on strike due to broken coffee machine +backup tape overwritten with copy of system manager's favourite CD +UPS interrupted the server's power +The electrician didn't know what the yellow cable was so he yanked the ethernet out. +The keyboard isn't plugged in +The air conditioning water supply pipe ruptured over the machine room +The electricity substation in the car park blew up. +The rolling stones concert down the road caused a brown out +The salesman drove over the CPU board. +The monitor is plugged into the serial port +Root nameservers are out of sync +electro-magnetic pulses from French above ground nuke testing. +your keyboard's space bar is generating spurious keycodes. +the real ttys became pseudo ttys and vice-versa. +the printer thinks its a router. +the router thinks its a printer. +evil hackers from Serbia. +we just switched to FDDI. +halon system went off and killed the operators. +because Bill Gates is a Jehovah's witness and so nothing can work on St. Swithin's day. +user to computer ratio too high. +user to computer ration too low. +we just switched to Sprint. +it has Intel Inside +Sticky bits on disk. +Power Company having EMP problems with their reactor +The ring needs another token +new management +telnet: Unable to connect to remote host: Connection refused +SCSI Chain overterminated +It's not plugged in. +because of network lag due to too many people playing deathmatch +You put the disk in upside down. +Daemons loose in system. +User was distributing pornography on server; system seized by FBI. +BNC (brain not connected) +UBNC (user brain not connected) +LBNC (luser brain not connected) +disks spinning backwards - toggle the hemisphere jumper. +new guy cross-connected phone lines with ac power bus. +had to use hammer to free stuck disk drive heads. +Too few computrons available. +Flat tire on station wagon with tapes. ("Never underestimate the bandwidth of a station wagon full of tapes hurling down the highway" Andrew S. Tannenbaum) +Communications satellite used by the military for star wars. +Party-bug in the Aloha protocol. +Insert coin for new game +Dew on the telephone lines. +Arcserve crashed the server again. +Some one needed the powerstrip, so they pulled the switch plug. +My pony-tail hit the on/off switch on the power strip. +Big to little endian conversion error +You can tune a file system, but you can't tune a fish (from most tunefs man pages) +Dumb terminal +Zombie processes haunting the computer +Incorrect time synchronization +Defunct processes +Stubborn processes +non-redundant fan failure +monitor VLF leakage +bugs in the RAID +no "any" key on keyboard +root rot +Backbone Scoliosis +/pub/lunch +excessive collisions & not enough packet ambulances +le0: no carrier: transceiver cable problem? +broadcast packets on wrong frequency +popper unable to process jumbo kernel +NOTICE: alloc: /dev/null: filesystem full +pseudo-user on a pseudo-terminal +Recursive traversal of loopback mount points +Backbone adjustment +OS swapped to disk +vapors from evaporating sticky-note adhesives +sticktion +short leg on process table +multicasts on broken packets +ether leak +Atilla the Hub +endothermal recalibration +filesystem not big enough for Jumbo Kernel Patch +loop found in loop in redundant loopback +system consumed all the paper for paging +permission denied +Reformatting Page. Wait... +..disk or the processor is on fire. +SCSI's too wide. +Proprietary Information. +Just type 'mv * /dev/null'. +runaway cat on system. +Did you pay the new Support Fee? +We only support a 1200 bps connection. +We only support a 28000 bps connection. +Me no internet, only janitor, me just wax floors. +I'm sorry a pentium won't do, you need an SGI to connect with us. +Post-it Note Sludge leaked into the monitor. +the curls in your keyboard cord are losing electricity. +The monitor needs another box of pixels. +RPC_PMAP_FAILURE +kernel panic: write-only-memory (/dev/wom0) capacity exceeded. +Write-only-memory subsystem too slow for this machine. Contact your local dealer. +Just pick up the phone and give modem connect sounds. "Well you said we should get more lines so we don't have voice lines." +Quantum dynamics are affecting the transistors +Police are examining all internet packets in the search for a narco-net-trafficker +We are currently trying a new concept of using a live mouse. Unfortunately, one has yet to survive being hooked up to the computer.....please bear with us. +Your mail is being routed through Germany ... and they're censoring us. +Only people with names beginning with 'A' are getting mail this week (a la Microsoft) +We didn't pay the Internet bill and it's been cut off. +Lightning strikes. +Of course it doesn't work. We've performed a software upgrade. +Change your language to Finnish. +Fluorescent lights are generating negative ions. If turning them off doesn't work, take them out and put tin foil on the ends. +High nuclear activity in your area. +What office are you in? Oh, that one. Did you know that your building was built over the universities first nuclear research site? And wow, aren't you the lucky one, your office is right over where the core is buried! +The MGs ran out of gas. +The UPS doesn't have a battery backup. +Recursivity. Call back if it happens again. +Someone thought The Big Red Button was a light switch. +The mainframe needs to rest. It's getting old, you know. +I'm not sure. Try calling the Internet's head office -- it's in the book. +The lines are all busy (busied out, that is -- why let them in to begin with?). +Jan 9 16:41:27 huber su: 'su root' succeeded for .... on /dev/pts/1 +It's those computer people in X {city of world}. They keep stuffing things up. +A star wars satellite accidently blew up the WAN. +Fatal error right in front of screen +That function is not currently supported, but Bill Gates assures us it will be featured in the next upgrade. +wrong polarity of neutron flow +Lusers learning curve appears to be fractal +We had to turn off that service to comply with the CDA Bill. +Ionization from the air-conditioning +TCP/IP UDP alarm threshold is set too low. +Someone is broadcasting pygmy packets and the router doesn't know how to deal with them. +The new frame relay network hasn't bedded down the software loop transmitter yet. +Fanout dropping voltage too much, try cutting some of those little traces +Plate voltage too low on demodulator tube +You did wha... oh _dear_.... +CPU needs bearings repacked +Too many little pins on CPU confusing it, bend back and forth until 10-20% are neatly removed. Do _not_ leave metal bits visible! +_Rosin_ core solder? But... +Software uses US measurements, but the OS is in metric... +The computer fleetly, mouse and all. +Your cat tried to eat the mouse. +The Borg tried to assimilate your system. Resistance is futile. +It must have been the lightning storm we had (yesterday) (last week) (last month) +Due to Federal Budget problems we have been forced to cut back on the number of users able to access the system at one time. (namely none allowed....) +Too much radiation coming from the soil. +Unfortunately we have run out of bits/bytes/whatever. Don't worry, the next supply will be coming next week. +Program load too heavy for processor to lift. +Processes running slowly due to weak power supply +Our ISP is having {switching,routing,SMDS,frame relay} problems +We've run out of licenses +Interference from lunar radiation +Standing room only on the bus. +You need to install an RTFM interface. +That would be because the software doesn't work. +That's easy to fix, but I can't be bothered. +Someone's tie is caught in the printer, and if anything else gets printed, he'll be in it too. +We're upgrading /dev/null +The Usenet news is out of date +Our POP server was kidnapped by a weasel. +It's stuck in the Web. +Your modem doesn't speak English. +The mouse escaped. +All of the packets are empty. +The UPS is on strike. +Neutrino overload on the nameserver +Melting hard drives +Someone has messed up the kernel pointers +The kernel license has expired +Netscape has crashed +The cord jumped over and hit the power switch. +It was OK before you touched it. +Bit rot +U.S. Postal Service +Your Flux Capacitor has gone bad. +The Dilithium Crystals need to be rotated. +The static electricity routing is acting up... +Traceroute says that there is a routing problem in the backbone. It's not our problem. +The co-locator cannot verify the frame-relay gateway to the ISDN server. +High altitude condensation from U.S.A.F prototype aircraft has contaminated the primary subnet mask. Turn off your computer for 9 days to avoid damaging it. +Lawn mower blade in your fan need sharpening +Electrons on a bender +Telecommunications is upgrading. +Telecommunications is downgrading. +Telecommunications is downshifting. +Hard drive sleeping. Let it wake up on it's own... +Interference between the keyboard and the chair. +The CPU has shifted, and become decentralized. +Due to the CDA, we no longer have a root account. +We ran out of dial tone and we're and waiting for the phone company to deliver another bottle. +You must've hit the wrong any key. +PCMCIA slave driver +The Token fell out of the ring. Call us when you find it. +The hardware bus needs a new token. +Too many interrupts +Not enough interrupts +The data on your hard drive is out of balance. +Digital Manipulator exceeding velocity parameters +appears to be a Slow/Narrow SCSI-0 Interface problem +microelectronic Riemannian curved-space fault in write-only file system +fractal radiation jamming the backbone +routing problems on the neural net +IRQ-problems with the Un-Interruptible-Power-Supply +CPU-angle has to be adjusted because of vibrations coming from the nearby road +emissions from GSM-phones +CD-ROM server needs recalibration +firewall needs cooling +asynchronous inode failure +transient bus protocol violation +incompatible bit-registration operators +your process is not ISO 9000 compliant +You need to upgrade your VESA local bus to a MasterCard local bus. +The recent proliferation of Nuclear Testing +Elves on strike. (Why do they call EMAG Elf Magic) +Internet exceeded Luser level, please wait until a luser logs off before attempting to log back on. +Your EMAIL is now being delivered by the USPS. +Your computer hasn't been returning all the bits it gets from the Internet. +You've been infected by the Telescoping Hubble virus. +Scheduled global CPU outage +Your Pentium has a heating problem - try cooling it with ice cold water.(Do not turn off your computer, you do not want to cool down the Pentium Chip while he isn't working, do you?) +Your processor has processed too many instructions. Turn it off immediately, do not type any commands!! +Your packets were eaten by the terminator +Your processor does not develop enough heat. +We need a licensed electrician to replace the light bulbs in the computer room. +The POP server is out of Coke +Fiber optics caused gas main leak +Server depressed, needs Prozac +quantum decoherence +those damn raccoons! +suboptimal routing experience +A plumber is needed, the network drain is clogged +50% of the manual is in .pdf readme files +the AA battery in the wallclock sends magnetic interference +the xy axis in the trackball is coordinated with the summer solstice +the butane lighter causes the pincushioning +old inkjet cartridges emanate barium-based fumes +manager in the cable duct +We'll fix that in the next (upgrade, update, patch release, service pack). +HTTPD Error 666 : BOFH was here +HTTPD Error 4004 : very old Intel cpu - insufficient processing power +The ATM board has run out of 10 pound notes. We are having a whip round to refill it, care to contribute ? +Network failure - call NBC +Having to manually track the satellite. +Your/our computer(s) had suffered a memory leak, and we are waiting for them to be topped up. +The rubber band broke +We're on Token Ring, and it looks like the token got loose. +Stray Alpha Particles from memory packaging caused Hard Memory Error on Server. +paradigm shift...without a clutch +PEBKAC (Problem Exists Between Keyboard And Chair) +The cables are not the same length. +Second-system effect. +Chewing gum on /dev/sd3c +Boredom in the Kernel. +the daemons! the daemons! the terrible daemons! +I'd love to help you -- it's just that the Boss won't let me near the computer. +struck by the Good Times virus +YOU HAVE AN I/O ERROR -> Incompetent Operator error +Your parity check is overdrawn and you're out of cache. +Communist revolutionaries taking over the server room and demanding all the computers in the building or they shoot the sysadmin. Poor misguided fools. +Plasma conduit breach +Out of cards on drive D: +Sand fleas eating the Internet cables +parallel processors running perpendicular today +ATM cell has no roaming feature turned on, notebooks can't connect +Webmasters kidnapped by evil cult. +Failure to adjust for daylight savings time. +Virus transmitted from computer to sysadmins. +Virus due to computers having unsafe sex. +Incorrectly configured static routes on the corerouters. +Forced to support NT servers; sysadmins quit. +Suspicious pointer corrupted virtual machine +It's the InterNIC's fault. +Root name servers corrupted. +Budget cuts forced us to sell all the power cords for the servers. +Someone hooked the twisted pair wires into the answering machine. +Operators killed by year 2000 bug bite. +We've picked COBOL as the language of choice. +Operators killed when huge stack of backup tapes fell over. +Robotic tape changer mistook operator's tie for a backup tape. +Someone was smoking in the computer room and set off the halon systems. +Your processor has taken a ride to Heaven's Gate on the UFO behind Hale-Bopp's comet. +it's an ID-10-T error +Dyslexics retyping hosts file on servers +The Internet is being scanned for viruses. +Your computer's union contract is set to expire at midnight. +Bad user karma. +/dev/clue was linked to /dev/null +Increased sunspot activity. +We already sent around a notice about that. +It's union rules. There's nothing we can do about it. Sorry. +Interference from the Van Allen Belt. +Jupiter is aligned with Mars. +Redundant ACLs. +Mail server hit by UniSpammer. +T-1's congested due to porn traffic to the news server. +Data for intranet got routed through the extranet and landed on the internet. +We are a 100% Microsoft Shop. +We are Microsoft. What you are experiencing is not a problem; it is an undocumented feature. +Sales staff sold a product we don't offer. +Secretary sent chain letter to all 5000 employees. +Sysadmin didn't hear pager go off due to loud music from bar-room speakers. +Sysadmin accidentally destroyed pager with a large hammer. +Sysadmins unavailable because they are in a meeting talking about why they are unavailable so much. +Bad cafeteria food landed all the sysadmins in the hospital. +Route flapping at the NAP. +Computers under water due to SYN flooding. +The vulcan-death-grip ping has been applied. +Electrical conduits in machine room are melting. +Traffic jam on the Information Superhighway. +Radial Telemetry Infiltration +Cow-tippers tipped a cow onto the server. +tachyon emissions overloading the system +Maintenance window broken +We're out of slots on the server +Computer room being moved. Our systems are down for the weekend. +Sysadmins busy fighting SPAM. +Repeated reboots of the system failed to solve problem +Feature was not beta tested +Domain controller not responding +Someone else stole your IP address, call the Internet detectives! +It's not RFC-822 compliant. +operation failed because: there is no message for this error (#1014) +stop bit received +internet is needed to catch the etherbunny +network down, IP packets delivered via UPS +Firmware update in the coffee machine +Temporal anomaly +Mouse has out-of-cheese-error +Borg implants are failing +Borg nanites have infested the server +error: one bad user found in front of screen +Please state the nature of the technical emergency +Internet shut down due to maintenance +Daemon escaped from pentagram +crop circles in the corn shell +sticky bit has come loose +Hot Java has gone cold +Cache miss - please take better aim next time +Hash table has woodworm +Trojan horse ran out of hay +Zombie processes detected, machine is haunted. +overflow error in /dev/null +Browser's cookie is corrupted -- someone's been nibbling on it. +Mailer-daemon is busy burning your message in hell. +According to Microsoft, it's by design +vi needs to be upgraded to vii +greenpeace free'd the mallocs +Terrorists crashed an airplane into the server room, have to remove /bin/laden. (rm -rf /bin/laden) +astropneumatic oscillations in the water-cooling +Somebody ran the operating system through a spelling checker. +Rhythmic variations in the voltage reaching the power supply. +Keyboard Actuator Failure. Order and Replace. +Packet held up at customs. +Propagation delay. +High line impedance. +Someone set us up the bomb. +Power surges on the Underground. +Don't worry; it's been deprecated. The new one is worse. +Excess condensation in cloud network +It is a layer 8 problem +The math co-processor had an overflow error that leaked out and shorted the RAM +Leap second overloaded RHEL6 servers +DNS server drank too much and had a hiccup +Your machine had the fuses in backwards. diff --git a/bbs/excuses b/bbs/excuses new file mode 100644 index 0000000..ca5c311 --- /dev/null +++ b/bbs/excuses @@ -0,0 +1,466 @@ +clock speed +solar flares +electromagnetic radiation from satellite debris +static from nylon underwear +static from plastic slide rules +global warming +poor power conditioning +static buildup +doppler effect +hardware stress fractures +magnetic interference from money/credit cards +dry joints on cable plug +we're waiting for [the phone company] to fix that line +sounds like a Windows problem, try calling Microsoft support +temporary routing anomaly +somebody was calculating pi on the server +fat electrons in the lines +excess surge protection +floating point processor overflow +divide-by-zero error +POSIX compliance problem +monitor resolution too high +improperly oriented keyboard +network packets travelling uphill (use a carrier pigeon) +Decreasing electron flux +first Saturday after first full moon in Winter +radiosity depletion +CPU radiator broken +It works the way the Wang did, what's the problem +positron router malfunction +cellular telephone interference +techtonic stress +piezo-electric interference +(l)user error +working as designed +dynamic software linking table corrupted +heavy gravity fluctuation, move computer to floor rapidly +secretary plugged hairdryer into UPS +terrorist activities +not enough memory, go get system upgrade +interrupt configuration error +spaghetti cable cause packet failure +boss forgot system password +bank holiday - system operating credits not recharged +virus attack, luser responsible +waste water tank overflowed onto computer +Complete Transient Lockout +bad ether in the cables +Bogon emissions +Change in Earth's rotational speed +Cosmic ray particles crashed through the hard disk platter +Smell from unhygienic janitorial staff wrecked the tape heads +Little hamster in running wheel had coronary; waiting for replacement to be Fedexed from Wyoming +Evil dogs hypnotised the night shift +Plumber mistook routing panel for decorative wall fixture +Electricians made popcorn in the power supply +Groundskeepers stole the root password +high pressure system failure +failed trials, system needs redesigned +system has been recalled +not approved by the FCC +need to wrap system in aluminum foil to fix problem +not properly grounded, please bury computer +CPU needs recalibration +system needs to be rebooted +bit bucket overflow +descramble code needed from software company +only available on a need to know basis +knot in cables caused data stream to become twisted and kinked +nesting roaches shorted out the ether cable +The file system is full of it +Satan did it +Daemons did it +You're out of memory +There isn't any problem +Unoptimized hard drive +Typo in the code +Yes, yes, its called a design limitation +Look, buddy: Windows 3.1 IS A General Protection Fault. +That's a great computer you have there; have you considered how it would work as a BSD machine? +Please excuse me, I have to circuit an AC line through my head to get this database working. +Yeah, yo mama dresses you funny and you need a mouse to delete files. +Support staff hung over, send aspirin and come back LATER. +Someone is standing on the ethernet cable, causing a kink in the cable +Windows 95 undocumented "feature" +Runt packets +Password is too complex to decrypt +Boss' kid fucked up the machine +Electromagnetic energy loss +Budget cuts +Mouse chewed through power cable +Stale file handle (next time use Tupperware(tm)!) +Feature not yet implemented +Internet outage +Pentium FDIV bug +Vendor no longer supports the product +Small animal kamikaze attack on power supplies +The vendor put the bug there. +SIMM crosstalk. +IRQ dropout +Collapsed Backbone +Power company testing new voltage spike (creation) equipment +operators on strike due to broken coffee machine +backup tape overwritten with copy of system manager's favourite CD +UPS interrupted the server's power +The electrician didn't know what the yellow cable was so he yanked the ethernet out. +The keyboard isn't plugged in +The air conditioning water supply pipe ruptured over the machine room +The electricity substation in the car park blew up. +The rolling stones concert down the road caused a brown out +The salesman drove over the CPU board. +The monitor is plugged into the serial port +Root nameservers are out of sync +electro-magnetic pulses from French above ground nuke testing. +your keyboard's space bar is generating spurious keycodes. +the real ttys became pseudo ttys and vice-versa. +the printer thinks its a router. +the router thinks its a printer. +evil hackers from Serbia. +we just switched to FDDI. +halon system went off and killed the operators. +because Bill Gates is a Jehovah's witness and so nothing can work on St. Swithin's day. +user to computer ratio too high. +user to computer ration too low. +we just switched to Sprint. +it has Intel Inside +Sticky bits on disk. +Power Company having EMP problems with their reactor +The ring needs another token +new management +telnet: Unable to connect to remote host: Connection refused +SCSI Chain overterminated +It's not plugged in. +because of network lag due to too many people playing deathmatch +You put the disk in upside down. +Daemons loose in system. +User was distributing pornography on server; system seized by FBI. +BNC (brain not connected) +UBNC (user brain not connected) +LBNC (luser brain not connected) +disks spinning backwards - toggle the hemisphere jumper. +new guy cross-connected phone lines with ac power bus. +had to use hammer to free stuck disk drive heads. +Too few computrons available. +Flat tire on station wagon with tapes. ("Never underestimate the bandwidth of a station wagon full of tapes hurling down the highway" Andrew S. Tannenbaum) +Communications satellite used by the military for star wars. +Party-bug in the Aloha protocol. +Insert coin for new game +Dew on the telephone lines. +Arcserve crashed the server again. +Some one needed the powerstrip, so they pulled the switch plug. +My pony-tail hit the on/off switch on the power strip. +Big to little endian conversion error +You can tune a file system, but you can't tune a fish (from most tunefs man pages) +Dumb terminal +Zombie processes haunting the computer +Incorrect time synchronization +Defunct processes +Stubborn processes +non-redundant fan failure +monitor VLF leakage +bugs in the RAID +no "any" key on keyboard +root rot +Backbone Scoliosis +/pub/lunch +excessive collisions & not enough packet ambulances +le0: no carrier: transceiver cable problem? +broadcast packets on wrong frequency +popper unable to process jumbo kernel +NOTICE: alloc: /dev/null: filesystem full +pseudo-user on a pseudo-terminal +Recursive traversal of loopback mount points +Backbone adjustment +OS swapped to disk +vapors from evaporating sticky-note adhesives +sticktion +short leg on process table +multicasts on broken packets +ether leak +Atilla the Hub +endothermal recalibration +filesystem not big enough for Jumbo Kernel Patch +loop found in loop in redundant loopback +system consumed all the paper for paging +permission denied +Reformatting Page. Wait... +..disk or the processor is on fire. +SCSI's too wide. +Proprietary Information. +Just type 'mv * /dev/null'. +runaway cat on system. +Did you pay the new Support Fee? +We only support a 1200 bps connection. +We only support a 28000 bps connection. +Me no internet, only janitor, me just wax floors. +I'm sorry a pentium won't do, you need an SGI to connect with us. +Post-it Note Sludge leaked into the monitor. +the curls in your keyboard cord are losing electricity. +The monitor needs another box of pixels. +RPC_PMAP_FAILURE +kernel panic: write-only-memory (/dev/wom0) capacity exceeded. +Write-only-memory subsystem too slow for this machine. Contact your local dealer. +Just pick up the phone and give modem connect sounds. "Well you said we should get more lines so we don't have voice lines." +Quantum dynamics are affecting the transistors +Police are examining all internet packets in the search for a narco-net-trafficker +We are currently trying a new concept of using a live mouse. Unfortunately, one has yet to survive being hooked up to the computer.....please bear with us. +Your mail is being routed through Germany ... and they're censoring us. +Only people with names beginning with 'A' are getting mail this week (a la Microsoft) +We didn't pay the Internet bill and it's been cut off. +Lightning strikes. +Of course it doesn't work. We've performed a software upgrade. +Change your language to Finnish. +Fluorescent lights are generating negative ions. If turning them off doesn't work, take them out and put tin foil on the ends. +High nuclear activity in your area. +What office are you in? Oh, that one. Did you know that your building was built over the universities first nuclear research site? And wow, aren't you the lucky one, your office is right over where the core is buried! +The MGs ran out of gas. +The UPS doesn't have a battery backup. +Recursivity. Call back if it happens again. +Someone thought The Big Red Button was a light switch. +The mainframe needs to rest. It's getting old, you know. +I'm not sure. Try calling the Internet's head office -- it's in the book. +The lines are all busy (busied out, that is -- why let them in to begin with?). +Jan 9 16:41:27 huber su: 'su root' succeeded for .... on /dev/pts/1 +It's those computer people in X {city of world}. They keep stuffing things up. +A star wars satellite accidently blew up the WAN. +Fatal error right in front of screen +That function is not currently supported, but Bill Gates assures us it will be featured in the next upgrade. +wrong polarity of neutron flow +Lusers learning curve appears to be fractal +We had to turn off that service to comply with the CDA Bill. +Ionization from the air-conditioning +TCP/IP UDP alarm threshold is set too low. +Someone is broadcasting pygmy packets and the router doesn't know how to deal with them. +The new frame relay network hasn't bedded down the software loop transmitter yet. +Fanout dropping voltage too much, try cutting some of those little traces +Plate voltage too low on demodulator tube +You did wha... oh _dear_.... +CPU needs bearings repacked +Too many little pins on CPU confusing it, bend back and forth until 10-20% are neatly removed. Do _not_ leave metal bits visible! +_Rosin_ core solder? But... +Software uses US measurements, but the OS is in metric... +The computer fleetly, mouse and all. +Your cat tried to eat the mouse. +The Borg tried to assimilate your system. Resistance is futile. +It must have been the lightning storm we had (yesterday) (last week) (last month) +Due to Federal Budget problems we have been forced to cut back on the number of users able to access the system at one time. (namely none allowed....) +Too much radiation coming from the soil. +Unfortunately we have run out of bits/bytes/whatever. Don't worry, the next supply will be coming next week. +Program load too heavy for processor to lift. +Processes running slowly due to weak power supply +Our ISP is having {switching,routing,SMDS,frame relay} problems +We've run out of licenses +Interference from lunar radiation +Standing room only on the bus. +You need to install an RTFM interface. +That would be because the software doesn't work. +That's easy to fix, but I can't be bothered. +Someone's tie is caught in the printer, and if anything else gets printed, he'll be in it too. +We're upgrading /dev/null +The Usenet news is out of date +Our POP server was kidnapped by a weasel. +It's stuck in the Web. +Your modem doesn't speak English. +The mouse escaped. +All of the packets are empty. +The UPS is on strike. +Neutrino overload on the nameserver +Melting hard drives +Someone has messed up the kernel pointers +The kernel license has expired +Netscape has crashed +The cord jumped over and hit the power switch. +It was OK before you touched it. +Bit rot +U.S. Postal Service +Your Flux Capacitor has gone bad. +The Dilithium Crystals need to be rotated. +The static electricity routing is acting up... +Traceroute says that there is a routing problem in the backbone. It's not our problem. +The co-locator cannot verify the frame-relay gateway to the ISDN server. +High altitude condensation from U.S.A.F prototype aircraft has contaminated the primary subnet mask. Turn off your computer for 9 days to avoid damaging it. +Lawn mower blade in your fan need sharpening +Electrons on a bender +Telecommunications is upgrading. +Telecommunications is downgrading. +Telecommunications is downshifting. +Hard drive sleeping. Let it wake up on it's own... +Interference between the keyboard and the chair. +The CPU has shifted, and become decentralized. +Due to the CDA, we no longer have a root account. +We ran out of dial tone and we're and waiting for the phone company to deliver another bottle. +You must've hit the wrong any key. +PCMCIA slave driver +The Token fell out of the ring. Call us when you find it. +The hardware bus needs a new token. +Too many interrupts +Not enough interrupts +The data on your hard drive is out of balance. +Digital Manipulator exceeding velocity parameters +appears to be a Slow/Narrow SCSI-0 Interface problem +microelectronic Riemannian curved-space fault in write-only file system +fractal radiation jamming the backbone +routing problems on the neural net +IRQ-problems with the Un-Interruptible-Power-Supply +CPU-angle has to be adjusted because of vibrations coming from the nearby road +emissions from GSM-phones +CD-ROM server needs recalibration +firewall needs cooling +asynchronous inode failure +transient bus protocol violation +incompatible bit-registration operators +your process is not ISO 9000 compliant +You need to upgrade your VESA local bus to a MasterCard local bus. +The recent proliferation of Nuclear Testing +Elves on strike. (Why do they call EMAG Elf Magic) +Internet exceeded Luser level, please wait until a luser logs off before attempting to log back on. +Your EMAIL is now being delivered by the USPS. +Your computer hasn't been returning all the bits it gets from the Internet. +You've been infected by the Telescoping Hubble virus. +Scheduled global CPU outage +Your Pentium has a heating problem - try cooling it with ice cold water.(Do not turn off your computer, you do not want to cool down the Pentium Chip while he isn't working, do you?) +Your processor has processed too many instructions. Turn it off immediately, do not type any commands!! +Your packets were eaten by the terminator +Your processor does not develop enough heat. +We need a licensed electrician to replace the light bulbs in the computer room. +The POP server is out of Coke +Fiber optics caused gas main leak +Server depressed, needs Prozac +quantum decoherence +those damn raccoons! +suboptimal routing experience +A plumber is needed, the network drain is clogged +50% of the manual is in .pdf readme files +the AA battery in the wallclock sends magnetic interference +the xy axis in the trackball is coordinated with the summer solstice +the butane lighter causes the pincushioning +old inkjet cartridges emanate barium-based fumes +manager in the cable duct +We'll fix that in the next (upgrade, update, patch release, service pack). +HTTPD Error 666 : BOFH was here +HTTPD Error 4004 : very old Intel cpu - insufficient processing power +The ATM board has run out of 10 pound notes. We are having a whip round to refill it, care to contribute ? +Network failure - call NBC +Having to manually track the satellite. +Your/our computer(s) had suffered a memory leak, and we are waiting for them to be topped up. +The rubber band broke +We're on Token Ring, and it looks like the token got loose. +Stray Alpha Particles from memory packaging caused Hard Memory Error on Server. +paradigm shift...without a clutch +PEBKAC (Problem Exists Between Keyboard And Chair) +The cables are not the same length. +Second-system effect. +Chewing gum on /dev/sd3c +Boredom in the Kernel. +the daemons! the daemons! the terrible daemons! +I'd love to help you -- it's just that the Boss won't let me near the computer. +struck by the Good Times virus +YOU HAVE AN I/O ERROR -> Incompetent Operator error +Your parity check is overdrawn and you're out of cache. +Communist revolutionaries taking over the server room and demanding all the computers in the building or they shoot the sysadmin. Poor misguided fools. +Plasma conduit breach +Out of cards on drive D: +Sand fleas eating the Internet cables +parallel processors running perpendicular today +ATM cell has no roaming feature turned on, notebooks can't connect +Webmasters kidnapped by evil cult. +Failure to adjust for daylight savings time. +Virus transmitted from computer to sysadmins. +Virus due to computers having unsafe sex. +Incorrectly configured static routes on the corerouters. +Forced to support NT servers; sysadmins quit. +Suspicious pointer corrupted virtual machine +It's the InterNIC's fault. +Root name servers corrupted. +Budget cuts forced us to sell all the power cords for the servers. +Someone hooked the twisted pair wires into the answering machine. +Operators killed by year 2000 bug bite. +We've picked COBOL as the language of choice. +Operators killed when huge stack of backup tapes fell over. +Robotic tape changer mistook operator's tie for a backup tape. +Someone was smoking in the computer room and set off the halon systems. +Your processor has taken a ride to Heaven's Gate on the UFO behind Hale-Bopp's comet. +it's an ID-10-T error +Dyslexics retyping hosts file on servers +The Internet is being scanned for viruses. +Your computer's union contract is set to expire at midnight. +Bad user karma. +/dev/clue was linked to /dev/null +Increased sunspot activity. +We already sent around a notice about that. +It's union rules. There's nothing we can do about it. Sorry. +Interference from the Van Allen Belt. +Jupiter is aligned with Mars. +Redundant ACLs. +Mail server hit by UniSpammer. +T-1's congested due to porn traffic to the news server. +Data for intranet got routed through the extranet and landed on the internet. +We are a 100% Microsoft Shop. +We are Microsoft. What you are experiencing is not a problem; it is an undocumented feature. +Sales staff sold a product we don't offer. +Secretary sent chain letter to all 5000 employees. +Sysadmin didn't hear pager go off due to loud music from bar-room speakers. +Sysadmin accidentally destroyed pager with a large hammer. +Sysadmins unavailable because they are in a meeting talking about why they are unavailable so much. +Bad cafeteria food landed all the sysadmins in the hospital. +Route flapping at the NAP. +Computers under water due to SYN flooding. +The vulcan-death-grip ping has been applied. +Electrical conduits in machine room are melting. +Traffic jam on the Information Superhighway. +Radial Telemetry Infiltration +Cow-tippers tipped a cow onto the server. +tachyon emissions overloading the system +Maintenance window broken +We're out of slots on the server +Computer room being moved. Our systems are down for the weekend. +Sysadmins busy fighting SPAM. +Repeated reboots of the system failed to solve problem +Feature was not beta tested +Domain controller not responding +Someone else stole your IP address, call the Internet detectives! +It's not RFC-822 compliant. +operation failed because: there is no message for this error (#1014) +stop bit received +internet is needed to catch the etherbunny +network down, IP packets delivered via UPS +Firmware update in the coffee machine +Temporal anomaly +Mouse has out-of-cheese-error +Borg implants are failing +Borg nanites have infested the server +error: one bad user found in front of screen +Please state the nature of the technical emergency +Internet shut down due to maintenance +Daemon escaped from pentagram +crop circles in the corn shell +sticky bit has come loose +Hot Java has gone cold +Cache miss - please take better aim next time +Hash table has woodworm +Trojan horse ran out of hay +Zombie processes detected, machine is haunted. +overflow error in /dev/null +Browser's cookie is corrupted -- someone's been nibbling on it. +Mailer-daemon is busy burning your message in hell. +According to Microsoft, it's by design +vi needs to be upgraded to vii +greenpeace free'd the mallocs +Terrorists crashed an airplane into the server room, have to remove /bin/laden. (rm -rf /bin/laden) +astropneumatic oscillations in the water-cooling +Somebody ran the operating system through a spelling checker. +Rhythmic variations in the voltage reaching the power supply. +Keyboard Actuator Failure. Order and Replace. +Packet held up at customs. +Propagation delay. +High line impedance. +Someone set us up the bomb. +Power surges on the Underground. +Don't worry; it's been deprecated. The new one is worse. +Excess condensation in cloud network +It is a layer 8 problem +The math co-processor had an overflow error that leaked out and shorted the RAM +Leap second overloaded RHEL6 servers +DNS server drank too much and had a hiccup +Your machine had the fuses in backwards. diff --git a/bbs/fakeenv.py b/bbs/fakeenv.py new file mode 100644 index 0000000..8e58409 --- /dev/null +++ b/bbs/fakeenv.py @@ -0,0 +1,81 @@ +import platform + +class BBSFakeUserEnv: + _user = "" + _node = "" + _name = "" + _hideRealUname = False + _runningInsideLXC = False + _pwd = "C:" + _fileSystem = { + "A:": { + "BOFH.TXT": "Easter Egg:\n\nRun `bofh` or `sry` to get an random BOFH excuse", + "DOCTOR.TXT": "Easter Egg 2:\n\nTry logging in as `doctor` or `doctorwho`, and run `hostname`...", + }, + "C:": { + "HELLO.TXT": "Hello World!", + "ROLLTREPPE3.URL": "https://rolltreppe3.de", + }, + } + + def setUser(self, _user): + self._user = _user + + def getUser(self): + return self._user + + def setNode(self, _node): + self._node = _node + + def getNode(self): + return self._node + + def getName(self): + return self._name + + def setHideRealUname(self, _hideRealUname): + self._hideRealUname = _hideRealUname + + def setRunningInsideLXC(self, _isInsideLXC): + self._runningInsideLXC = _isInsideLXC + + def getRunningInsideLXC(self): + return self._runningInsideLXC + + def getHome(self): + #return "/usr/home/" + self.getUser() + _user = self.getUser().upper() + if len(_user) > 10: + _user = _user[:8] + "~1" + return "C:\\DATA\\" + _user + "\\" + + def getCurrentDir(self, realPwd=False): + if not realPwd and self._pwd == "C:": + return self.getHome() + else: + return self._pwd + "\\" + + def setCurrentDir(self, new_pwd): + self._pwd = new_pwd + + def getDirListing(self): + return self._fileSystem[self._pwd].keys() + + def getFileContents(self, filename): + return self._fileSystem[self._pwd][filename] + + def getPrompt(self, ps1="%w>"): + return ps1.replace("%w", self.getCurrentDir(True)) + + def getUName(self): + if not self._hideRealUname: + return platform.uname()[0]+" "+platform.uname()[1]+" "+platform.uname()[2] + else: + return "BBS-UX "+self.getNode()+" r42" + + def __init__(self): + self._user = "doctor_who" + self._node = platform.node() + #self._node = platform.uname()[1] + self._name = "I am the Doctor!" + diff --git a/bbs/mfingerd.py b/bbs/mfingerd.py new file mode 100644 index 0000000..0d3386c --- /dev/null +++ b/bbs/mfingerd.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- + +__doc__ = """ mFingerd + +Copyright (c) 2012,2013,2016 Malte Bublitz +All rights reserved. + +Configuration is done in the CONFIG variable. +Set CONFIG.ServerInfo to the server information that +should be returned to the user if no username was +specified. +CONFIG.UserInfo contains the information for the users +that can be queried. +CONFIG.UserNonExistentError is returned if a user was +specified, but not listed in CONFIG.UserInfo. +""" + +class AppInfo(object): + Name = "mFingerd" + Version = "0.2" + Vendor = "rolltreppe3" + WebsiteURL = "https://rolltreppe3.de" + DBFile = "fingerinfo.db" + + +import sys +import os +import logging +import socketserver +import string +from socket import getfqdn +import signal +import .bbs.bofh +import pickledb +import datetime + + +class FingerHandler(socketserver.StreamRequestHandler): + def handle(self): + self._db = pickledb.load(AppInfo.DBFile, False) + + # read a line (limited to 512 byte to + # avoid megabytes of data to process + #username = self.rfile.readline(512) + username = self.rfile.readline(32) + + # strip the username string + username = username.strip() + + logging.info(f"Got query from {self.client_address}: {username}") + + # send the requested username. + if username == '' and self._db.exists("@"): + info = self._db.get("@") + + elif username == '': + info = self._db.get("404") + + elif self._db.exists(username): + info = self._db.get(username) + + # if "%%IP%%" in info: + # info = info.replace("%%IP%%", self.client_address[0]) + # elif "%%FQDN%%" in info: + # info = info.replace("%%FQDN%%", getfqdn(self.client_address[0])) + # elif "%%BOFH%%" in info: + # info = info.replace("%%BOFH%%", bofh.get_excuse()) + info = info.replace( + "%%IP%%", + self.client_address[0] + ) + # elif "%%FQDN%%" in info: + # info = info.replace("%%FQDN%%", getfqdn(self.client_address[0])) + # elif "%%BOFH%%" in info: + # info = info.replace("%%BOFH%%", bofh.get_excuse()) + else: + info = self._db.get("404") + + self.wfile.write(info.encode("utf-8") + b"\n") + +def main(): + # Get UID + uid = os.getuid() + + # Port to listen on + # If running as root/uid=0, use default port 79; if not, + # use 7079 as a fallback. + if uid == 0: + PORT = 79 + else: + PORT = 7079 + + # IP + port to listen on + listen_on = ("", PORT) + + # Load database + global db + db = pickledb.load("fingerinfo.db", False) + + # + # Create an server instance + # + global server + server = socketserver.TCPServer( + listen_on, + FingerHandler + ) + + def stop_server(signum = 0, frame = 0): + global server + + # https://www.generacodice.com/en/articolo/4343888/python-2-does-not-handle-signals-if-tcpserver-is-running-in-another-thread + server.running = False + #print "stop_server(",signum,",",repr(frame),") :: server.shutdown()" + # + server.shutdown() + + #print "stop_server(",signum,",",repr(frame),") :: server.server_close()" + server.server_close() + + #print "stop_server(",signum,",",repr(frame),") :: sys.exit(0)" + sys.exit(0) + + # + # Allow terminating via SIGINT, SIGTERM or SIGUSR1 + # + signal.signal(signal.SIGINT, stop_server) + signal.signal(signal.SIGTERM, stop_server) + signal.signal(signal.SIGUSR2, stop_server) + + # + # Run the server + # + try: + logging.info(f"{AppInfo.Name} {AppInfo.Version} :: Listening on {str(listen_on[0])}:{str(listen_on[1])}") + # print("Press Ctrl+C at any time (or send SIGTERM/SIGUSR2) to exit...") + + server.serve_forever() + + except KeyboardInterrupt: + #print("\nCtr+C pressed.\nAborting...") + logging.warning("Shutting down after SIGTERM") + #stop_server() + server.shutdown() + server.server_close() + #sys.exit(0) + +if __name__=='__main__': + main() + diff --git a/bbs/mfingerd_daemon.py b/bbs/mfingerd_daemon.py new file mode 100755 index 0000000..c7a536c --- /dev/null +++ b/bbs/mfingerd_daemon.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +import sys, time +import bbs.daemon2 +import bbs.mfingerd + +class MyFingerDaemon(bbs.daemon2.Daemon): + def run(self): + bbs.mfingerd.main() + +def main(pidfile): + daemon = MyFingerDaemon(pidfile) + + if len(sys.argv) == 2: + if 'start' == sys.argv[1]: + daemon.start() + + elif 'stop' == sys.argv[1]: + daemon.stop() + + elif 'restart' == sys.argv[1]: + daemon.restart() + + else: + print "Unknown command" + sys.exit(2) + + sys.exit(0) + + else: + print(f"usage: {sys.argv[0]} start|stop|restart", file=sys.stderr) + sys.exit(2) + +if __name__ == "__main__": + main("/tmp/mfingerd.pid") + diff --git a/bbs/minishell.py b/bbs/minishell.py new file mode 100644 index 0000000..77bd9ed --- /dev/null +++ b/bbs/minishell.py @@ -0,0 +1,248 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Minimal Shell +# Use whenever a user should be able to launch a shell, +# but not to execute commands. +# +# Copyright (c) 2013-2015 Malte Bublitz. +# All rights reserved. +# +# Licensed under the terms of the 2-clause BSD license. +# See LICENSE for details. +# + +import platform +import os +import sys +import getpass +#TODO: import readline + +os.chdir(os.path.dirname(sys.argv[0])) + +from . import fakeenv +from . import bofh + +def getuser(): + return "doctorwho" + +def issue(): + # Escape codes for clearing the screen: + # ansi/vt100/vt220 + # \e[H\e[J + # xterm-256color + # \e[3J\e[H\e[2J + # + os.system("clear") + #print("") + #os.system("figlet -f slant T.A.R.D.I.S.") + #print("") + #print(chr(27)+"[H"+chr(27)+"[J", end="") + print(""" + ______ ___ ____ ____ ____ _____ + /_ __/ / | / __ \ / __ \ / _/ / ___/ + / / / /| | / /_/ / / / / / / / \__ \ + / / _ / ___ |_ / _, _/ / /_/ / _/ / _ ___/ / +/_/ (_)_/ |_(_)_/ |_(_)_____(_)___/(_)____(_) + +""") + +def login(prompt1="login: ", prompt2="Password: ", clear_before = True): + if clear_before: + #os.system("clear") + pass + + login_data = ["", ""] + while len(login_data[0]) < 2: + try: + login_data[0] = input(prompt1) + except EOFError: + print("^D") + + login_data[1] = getpass.getpass(prompt2) + + return login_data + +def minishell(ps1="%w> "): + """ + ps1 is used as the prompt, and %w will be replaced by the current working directory + """ + env = fakeenv.BBSFakeUserEnv() + commands_allowed = ( + "", + "exit", + "logout", + "help", + "whoami", + "id", + "hostname", + "pwd", + "ls", "dir", + "cat", "type", + "uname", + "clear", + "sry", "bofh", + ) + command = "" + + # /etc/issue + issue() + + # Log in + try: + env.setUser(login(clear_before=False)[0]) + except KeyboardInterrupt: + #sys.exit(0) + env.setUser("john.doe") + + env.setHideRealUname(True) + env.setNode("bbs.malte70.de") + if env.getUser() in ["doctor", "doctorwho", "doctor_who"]: + #env.setNode("torchwood.tardis.malte70.de") + env.setNode("bbs.torchwood-cardiff.torchwood.gov.uk") + + if "--lxc" in sys.argv[1:]: + env.setRunningInsideLXC(True) + + print("\nWelcome on "+env.getNode()+", "+env.getUser()+"!\n") + + if env.getRunningInsideLXC(): + # Show an unneccessary cryptic message if running inside LXC + print(" [SYS$LOG] Installing BBS-UX LXC services...\n") + + try: + while command != "exit": + #print(ps1, end="") + print(env.getPrompt(ps1), end="") + try: + command = input().lower() + + except KeyboardInterrupt: + print("") + continue + + # Split command from command_args + command_args = " ".join(command.split(" ")[1:]) + command = command.split(" ")[0] + + if command == "logout" or command == "exit": + command = "exit" + + elif command == "help" and len(command_args) < 1: + print("""Help +Commands: + whoami + id + hostname + pwd + ls + cat + uname + clear + help + logout/exit +""") + + elif command == "help" and len(command_args) > 1: + help_topic = command_args.split(" ")[0] + if help_topic == "sry": + print("SRY\n\tEaster Egg. Just try it!") + elif help_topic == "two": + print("TWO\n\tTime Wasting Option") + print("\tDon't conflate TWO with TSO in the OS/360") + print("\tfamily of mainframe systems!") + elif help_topic in ("shutdown", "poweroff", "halt"): + print("shutdown/poweroff/halt") + print("\tRunning them is interpreted as an act of violence") + print("\tagainst the Dalek!") + else: + print(help_topic) + print("\tFAKENEWS!") + + elif command == "whoami": + if not env.getUser() in ["doctor", "doctorwho", "doctor_who"]: + print(env.getUser()) + else: + #print("I am the Doctor!") + print(env.getName()) + print("") + print("I should behave politely, so maybe excuse for") + print("future mistakes with \"sry\" (Yes, an easter egg!)") + print("") + + elif command == "shutdown" or command == "poweroff" or command == "halt": + print("Exterminate!") + print("Exterminate!".upper()) + sys.exit(0) + + elif command == "id": + print("uid=42(" + env.getUser() + ") gid=100(users) groups=42(" + env.getUser() + "),9999(telnet)") + + elif command == "hostname": + print(env.getNode()) + + elif command == "pwd": + #print("/usr/home/"+getuser()) + print(env.getCurrentDir(True)) + + elif command == "ls" or command == "dir": + #print("A: TARDIS ZIP : DALEK EXE") + #print("A: CLARA DOC : ASHILDR GIF") + _dir = env.getDirListing() + for _entry in _dir: + print(" " + env.getCurrentDir()[:2] + " " + _entry) + + elif command == "cat" or command == "type": + # DEBUG: + #print("CMD = \"" + command + "\"") + #print("ARGS = \"" + command_args + "\"") + + filename = command_args.upper() + print(env.getFileContents(filename)) + + elif command == "uname": + print(env.getUName()) + + elif command == "clear": + # clear screen + ret_code = os.system("clear") + + elif command == "sry" or command == "bofh": + # BOFH excuse + print(" "+bofh.get_excuse()) + + elif len(command) == 2 and command[1] == ":": + # Change drive/working directory + env.setCurrentDir(command.upper()) + + #elif not command in commands_allowed: + # print("-minishell: "+command.split(" ")[0]+": Command not found.") + elif len(command) > 0: + print("TWO: "+command.split(" ")[0]+": Command not found.") + + except EOFError: + print("") + + print("Good bye.") + +if __name__ == "__main__": + # + # ==> Prompt ideas: + # + # sh + # ps1='$ ' + # CP/M and early MS-DOS versions + # 'C> + # MS-DOS (later versions) + #ps1='C:\> ' + #ps1='%w> ' + # ITS + #ps1=':' + # BASIC prompt for INPUT + #ps1='? ' + + # New default + ps1='%w> ' + + minishell(ps1) + diff --git a/bin/lxc-launcher b/bin/lxc-launcher new file mode 100755 index 0000000..08a978e --- /dev/null +++ b/bin/lxc-launcher @@ -0,0 +1,11 @@ +#!/bin/bash +# +# Usage: +# /lxc-fs-path/bin/lxc-launcher /lxc-fs-path +# + +cd "$1" + +pwd +python -m bbs.minishell + diff --git a/bin/tardis-minishell b/bin/tardis-minishell new file mode 100755 index 0000000..f0e1f88 --- /dev/null +++ b/bin/tardis-minishell @@ -0,0 +1,12 @@ +#!/bin/bash + +pwd + +#cd $(basename $0)/.. + + +python -m bbs.minishell + + +echo -n 'Press ... '; read + diff --git a/deepthought.fingerinfo.db b/deepthought.fingerinfo.db new file mode 100644 index 0000000..09b5c06 --- /dev/null +++ b/deepthought.fingerinfo.db @@ -0,0 +1 @@ +{"@": "This is spandau.rolltreppe3.de.\nTry:\n\tfinger ip@spandau.rolltreppe3.de\n\tfinger myip@spandau.rolltreppe3.de\n\tfinger malte70@spandau.rolltreppe3.de\n", "ip": "%%IP%%", "myip": "Your IP: %%IP%%\nYour Hostname: %%FQDN%%", "404": "The requested user does not exist.", "malte70": "Full name: Malte Bublitz\nTwitter: @malte70\nEMail: malte@rolltreppe3.de\nGnuPG: B214 8955 F6A6 6A8B 8FA3 F59B 605D A5C7 29F9 C184\nWeb: https://malte70.de\nWork: https://rolltreppe3.de\nXMPP: malte.bublitz@riseup.net", "bofh": "%%BOFH%%"} \ No newline at end of file diff --git a/doc/bbs-minishell.libvirt-lxc-domain.xml b/doc/bbs-minishell.libvirt-lxc-domain.xml new file mode 100644 index 0000000..ac12b00 --- /dev/null +++ b/doc/bbs-minishell.libvirt-lxc-domain.xml @@ -0,0 +1,36 @@ + + bbs-minishell + ea9d54d2-d0e1-4375-b704-6cac72a8796c + T.A.R.D.I.S. + 65536 + 16384 + 1 + + /machine + + + exe + /bbs/bin/lxc-launcher + /bbs + + + destroy + restart + destroy + + /usr/lib/libvirt/libvirt_lxc + + + + + + + + + + + + + + + diff --git a/doc/config_backup_spandau.py b/doc/config_backup_spandau.py new file mode 100644 index 0000000..5ed9e09 --- /dev/null +++ b/doc/config_backup_spandau.py @@ -0,0 +1,35 @@ +CONFIG = { + #"ServerInfo": "This is host.example.com.", + "ServerInfo": """This is spandau.rolltreppe3.de. +Try: + finger ip@spandau.rolltreppe3.de + finger myip@spandau.rolltreppe3.de + finger malte70@spandau.rolltreppe3.de +""", + "UserInfo": { + "malte": "Lookup malte70 instead.", + "malte70": """Full name: Malte Bublitz +Twitter..: @malte70 +EMail....: malte@rolltreppe3.de +Web......: https://malte70.de +Work.....: https://rolltreppe3.de +XMPP.....: malte.bublitz@riseup.net""", + "timo": "Lookup stardustdestruktor instead.", + "stardustdestruktor": """Full name: Timo König +Twitter..: *hidden* +EMail....: *hidden* +Web......: https://tmkng.de +Work.....: https://rolltreppe3.de""", + "rolltreppe3": "%%LOGO%%", + "r3": "%%LOGO%%", + "rt3x": "%%LOGO%%", + "ip": "%%IP%%", + "fqdn": "%%FQDN%%", + "hostname": "%%FQDN%%", + #"john": "John Doe", + "myip": """Your IP: %%IP%% +Your Hostname: %%FQDN%%""", + "bofh": "%%BOFH%%" + }, + "UserNonExistentError": "The requested user does not exist." +} diff --git a/doc/logo.txt b/doc/logo.txt new file mode 100644 index 0000000..37d94a4 --- /dev/null +++ b/doc/logo.txt @@ -0,0 +1,32 @@ + + + .&&&&&&&&&&&&&&&&&&* + &%#((((((((((((((((%%%&% + &%#((%%%%%%%%%%%%%%((((%%& + &%#((%&* &&%(((%%% /################### + &%#((%&* /&%(((%& #////////////////////## + &%#((%&* #&%(((%& #///,,///////////////## + &%#((%&* &&%(((%%% #///,//(############# + &%#((%&&&&&&&&&%%%%(((#%&& #///,//## + &%#((((((((((((((((%%%&% #///,//## + &%#((%&&&&&&%#((%%%( ###############///,//## + &%#((%&* &%%(((%%& ##/////////////////,,//## + &%#((%&* (&%(((%%& #(//,,,////////////////## + &%#((%&* &%%(((%&% #(//,///###############* + &%#((%&* #&%(((%%& #(//,///# + &%#((%&* %%%(((%&& #(//,///# %%%######%%%* + &%#((%&* ##############(//,///# %%##(///////////##%/ + ,&&&& #/////////////////,,///# %#(/////######/////##% + #//*,,,////////////////# %%###%%, %##////#%, + #//*,///############### %%#////#%, + #//*///# %%%%%%###////##% + #//*///# %#(////////###% + #//*///# %#(//////////##%# + ##/////////////////,///# ,(%%%%%##////##% + #///****************///# /%#////#%/ + #(//////////////////(## %%###%% %%#////#%* + %##////####%%###/////##% + %%##//////////////##%( + %%%##########%%% + + diff --git a/fingerinfo.db b/fingerinfo.db new file mode 100644 index 0000000..09b5c06 --- /dev/null +++ b/fingerinfo.db @@ -0,0 +1 @@ +{"@": "This is spandau.rolltreppe3.de.\nTry:\n\tfinger ip@spandau.rolltreppe3.de\n\tfinger myip@spandau.rolltreppe3.de\n\tfinger malte70@spandau.rolltreppe3.de\n", "ip": "%%IP%%", "myip": "Your IP: %%IP%%\nYour Hostname: %%FQDN%%", "404": "The requested user does not exist.", "malte70": "Full name: Malte Bublitz\nTwitter: @malte70\nEMail: malte@rolltreppe3.de\nGnuPG: B214 8955 F6A6 6A8B 8FA3 F59B 605D A5C7 29F9 C184\nWeb: https://malte70.de\nWork: https://rolltreppe3.de\nXMPP: malte.bublitz@riseup.net", "bofh": "%%BOFH%%"} \ No newline at end of file diff --git a/mcbxDOS_bbs.py b/mcbxDOS_bbs.py new file mode 100755 index 0000000..47e6191 --- /dev/null +++ b/mcbxDOS_bbs.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python + +from twisted.internet.protocol import Factory +from twisted.protocols.basic import LineReceiver +from twisted.internet import reactor +import datetime + +MOTD = """ +Starting MCBX DOS... +""" + +class DOSBBS(LineReceiver): + _DOS = { + "Version": "1.0", + "Name": "MCBX DOS" + } + _DATA = { + "A": { + "DATA": { + "LETTER.DOC": "Hello my friend." + }, + "VER.COM": "0xEXE", + "DATE.COM": "0xEXE", + "SHELL.EXE": "0xEXE", + "CONFIG.SYS": "REM DOS CONFIG\nDEVICE=A:\\DOS.SYS\nDEVICE=A:\\BIOS.SYS\nDOS=UNIX", + "DOS.SYS": "0xSYS", + "BIOS.SYS": "0xSYS" + }, + "B": { + "ERROR.EXE": "0xEXE" + } + } + def getPath(self): + p = self.path[0] + ":" + if len(self.path) > 1: + for d in self.path[1:]: + p += "\\" + d + return p + + def connectionMade(self): + self.delimiter = '\n' + self.path = ["A", "DATA"] + #self.transport.write(b"") + self.sendLine(MOTD) + p = self.path[0] + ":" + if len(self.path) > 1: + for d in self.path[1:]: + p += "\\" + d + self.transport.write(bytes(self.getPath()+">","utf8")) + + def lineReceived(self, line): + command = line.upper() + #print + if command.startswith("VER"): + self.sendLine("") + self.sendLine(self._DOS["Name"] + " " + self._DOS["Version"]) + self.sendLine("") + elif command.startswith("EXIT") or command.startswith("QUIT") or command.startswith("LOGOUT"): + self.sendLine("bye.") + self.transport.loseConnection() + elif command.startswith("DATE"): + now = datetime.datetime.now() + self.sendLine(now.strftime("%Y-%m-%d")) + elif command.startswith("HELP"): + title = self._DOS["Name"] + " " + self._DOS["Version"] + " HELP" + self.sendLine(title) + self.sendLine(len(title) * "=") + self.sendLine("Commands:\n\tVER\n\tEXIT\n\tHELP\n","utf8") + elif command.startswith("DIR"): + listing = "\n" + listing += " Volume in drive " + self.path[0] + " is FLOPPY~" + self.path[0] + "\n" + listing += " Volume Serial Number is 1337-42-" + listing += "ACAB" if self.path[0] == "A" else "BEEF" + listing += "\n Directory of " + self.getPath() + "\n" + listing += "\n" + #for _name, _cont in + + self.sendLine(listing) + elif line.startswith("malte70"): + self.sendLine("Malte Bublitz\n@malte70\nMore coming soon.") + + # prevent printing prompt when user wantrs to disconnect. + if not command.startswith("EXIT"): + p = self.path[0] + ":" + if len(self.path) > 1: + for d in self.path[1:]: + p += "\\" + d + self.transport.write(bytes(p+">", "utf8")) + +factory = Factory() +factory.protocol = DOSBBS +reactor.listenTCP(7079, factory) +reactor.run() diff --git a/mfingerd.service b/mfingerd.service new file mode 100644 index 0000000..cd429bf --- /dev/null +++ b/mfingerd.service @@ -0,0 +1,16 @@ +# vim:set ft=systemd: + +[Unit] +Description=Malte's Finger Daemon +Requires=network.target +After=network.target + +[Service] +Type=simple +#ExecStart=/usr/bin/env python2 /opt/bbs/mfingerd.py +ExecStart=/usr/bin/env python2 mfingerd.py +WorkingDirectory=/opt/bbs + +[Install] +WantedBy=multi-user.target + diff --git a/my_daemon2.py b/my_daemon2.py new file mode 100644 index 0000000..7fcb129 --- /dev/null +++ b/my_daemon2.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +import sys, time +from daemon import Daemon + +class MyDaemon(Daemon): + def run(self): + while True: + time.sleep(1) + +if __name__ == "__main__": + daemon = MyDaemon('/tmp/daemon-example.pid') + if len(sys.argv) == 2: + if 'start' == sys.argv[1]: + daemon.start() + elif 'stop' == sys.argv[1]: + daemon.stop() + elif 'restart' == sys.argv[1]: + daemon.restart() + else: + print "Unknown command" + sys.exit(2) + sys.exit(0) + else: + print "usage: %s start|stop|restart" % sys.argv[0] + sys.exit(2) \ No newline at end of file diff --git a/qotd b/qotd new file mode 100755 index 0000000..f9cd576 --- /dev/null +++ b/qotd @@ -0,0 +1,47 @@ +#!/bin/sh +# +# See also: +# RFC 865 - Quote of the Day Protocol +# + +PATH=/usr/games:$PATH + +fortune \ + letzteworte \ + ms \ + murphy \ + namen \ + quiz \ + regeln \ + sicherheitshinweise \ + sprueche \ + stilblueten \ + tips \ + translations \ + unfug \ + vornamen \ + witze \ + woerterbuch \ + wusstensie \ + zitate \ + | sed \ + -e's/Ä/Ae/g' \ + -e's/Ö/Oe/g' \ + -e's/Ü/Ue/g' \ + -e's/ä/ae/g' \ + -e's/ö/oe/g' \ + -e's/ü/ue/g' \ + -e's/ß/ss/g' \ + | iconv -f UTF-8 -t US-ASCII + +# | uni2ascii \ +# -c -d -e -f -x \ +# -S U+00E4:ae \ +# -S U+00C4:Ae \ +# -S U+00F6:oe \ +# -S U+00D6:Oe \ +# -S U+00FC:ue \ +# -S U+00DC:Ue \ +# -S U+00DF:ss \ +# -q + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5e5ea0a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +# requirements.txt +pickleDB>=0.9.2 +Twisted>=22.10.0 + diff --git a/spandau.fingerinfo.db b/spandau.fingerinfo.db new file mode 100644 index 0000000..803fe73 --- /dev/null +++ b/spandau.fingerinfo.db @@ -0,0 +1 @@ +{"@": "This is spandau.rolltreppe3.de.\nTry:\n\tfinger ip@spandau.rolltreppe3.de\n\tfinger myip@spandau.rolltreppe3.de\n\tfinger malte70@spandau.rolltreppe3.de\n", "rt3x": "%%LOGO%%", "stardustdestruktor": "Full name: Timo K\u00f6nig\nTwitter..: *hidden*\nEMail....: *hidden*\nWeb......: https://tmkng.de\nWork.....: https://rolltreppe3.de", "r3": "%%LOGO%%", "ip": "%%IP%%", "malte": "Lookup malte70 instead.", "hostname": "%%FQDN%%", "fqdn": "%%FQDN%%", "rolltreppe3": "%%LOGO%%", "404": "The requested user does not exist.", "myip": "Your IP: %%IP%%\nYour Hostname: %%FQDN%%", "aribor": "Lookup malte70 instead.", "malte70": "Full name: Malte Bublitz\nTwitter..: @malte70\nEMail....: malte@rolltreppe3.de\nWeb......: https://malte70.de\nWork.....: https://rolltreppe3.de\nXMPP.....: malte.bublitz@riseup.net", "bofh": "%%BOFH%%", "timo": "Lookup stardustdestruktor instead.", "aribor42": "Lookup malte70 instead."} \ No newline at end of file diff --git a/test.py b/test.py new file mode 100644 index 0000000..97355aa --- /dev/null +++ b/test.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- + +import pickledb + +db = pickledb.load("fingerinfo.db", False) + +UserInfo = { + "@": """This is spandau.rolltreppe3.de. +Try: + finger ip@spandau.rolltreppe3.de + finger myip@spandau.rolltreppe3.de + finger malte70@spandau.rolltreppe3.de +""", + "404": "The requested user does not exist.", + "malte": "Lookup malte70 instead.", + "aribor": "Lookup malte70 instead.", + "aribor42": "Lookup malte70 instead.", + "malte70": """Full name: Malte Bublitz +Twitter..: @malte70 +EMail....: malte@rolltreppe3.de +Web......: https://malte70.de +Work.....: https://rolltreppe3.de +XMPP.....: malte.bublitz@riseup.net""", + "timo": "Lookup stardustdestruktor instead.", + "stardustdestruktor": """Full name: Timo König +Twitter..: *hidden* +EMail....: *hidden* +Web......: https://tmkng.de +Work.....: https://rolltreppe3.de""", + "rolltreppe3": "%%LOGO%%", + "r3": "%%LOGO%%", + "rt3x": "%%LOGO%%", + "ip": "%%IP%%", + "fqdn": "%%FQDN%%", + "hostname": "%%FQDN%%", + #"john": "John Doe", + "myip": """Your IP: %%IP%% +Your Hostname: %%FQDN%%""", + "bofh": "%%BOFH%%" +} +import pprint;print "--> UserInfo";pprint.pprint(UserInfo) + +for k in UserInfo.keys(): + if not db.exists(k): + print "Adding UserInfo[\""+k+"\"] to pickledb" + db.set(k, UserInfo[k]) + else: + print "Skipping \""+k+"\"" + +db.dump() diff --git a/twisted-tutorial/README.md b/twisted-tutorial/README.md new file mode 100644 index 0000000..0683161 --- /dev/null +++ b/twisted-tutorial/README.md @@ -0,0 +1,6 @@ +# Code based on the official Twisted Tutorial + +- QOTD + - [Setting up the TwistedQuotes application — Twisted 22.10.0 documentation](https://docs.twisted.org/en/stable/core/howto/quotes.html) + - [Designing Twisted Applications — Twisted 22.10.0 documentation](https://docs.twisted.org/en/stable/core/howto/design.html) + diff --git a/twisted-tutorial/TwistedQuotes/__init__.py b/twisted-tutorial/TwistedQuotes/__init__.py new file mode 100644 index 0000000..ed6bd97 --- /dev/null +++ b/twisted-tutorial/TwistedQuotes/__init__.py @@ -0,0 +1,3 @@ +""" +Twisted Quotes +""" diff --git a/twisted-tutorial/TwistedQuotes/quoteproto.py b/twisted-tutorial/TwistedQuotes/quoteproto.py new file mode 100644 index 0000000..28798b9 --- /dev/null +++ b/twisted-tutorial/TwistedQuotes/quoteproto.py @@ -0,0 +1,35 @@ +from zope.interface import Interface + +from twisted.internet.protocol import Factory, Protocol + + +class IQuoter(Interface): + """ + An object that returns quotes. + """ + + def getQuote(): + """ + Return a quote. + """ + + +class QOTD(Protocol): + def connectionMade(self): + self.transport.write(self.factory.quoter.getQuote() + "\r\n") + self.transport.loseConnection() + + +class QOTDFactory(Factory): + """ + A factory for the Quote of the Day protocol. + + @type quoter: L{IQuoter} provider + @ivar quoter: An object which provides L{IQuoter} which will be used by + the L{QOTD} protocol to get quotes to emit. + """ + + protocol = QOTD + + def __init__(self, quoter): + self.quoter = quoter diff --git a/twisted-tutorial/TwistedQuotes/quoters.py b/twisted-tutorial/TwistedQuotes/quoters.py new file mode 100644 index 0000000..4e596e9 --- /dev/null +++ b/twisted-tutorial/TwistedQuotes/quoters.py @@ -0,0 +1,33 @@ +from random import choice + +from zope.interface import implementer + +from TwistedQuotes import quoteproto + + +@implementer(quoteproto.IQuoter) +class StaticQuoter: + """ + Return a static quote. + """ + + def __init__(self, quote): + self.quote = quote + + def getQuote(self): + return self.quote + + +@implementer(quoteproto.IQuoter) +class FortuneQuoter: + """ + Load quotes from a fortune-format file. + """ + + def __init__(self, filenames): + self.filenames = filenames + + def getQuote(self): + with open(choice(self.filenames)) as quoteFile: + quotes = quoteFile.read().split("\n%\n") + return choice(quotes) -- 2.30.2