gemini.git

going-flying.com gemini git repository

summary

tree

log

refs

a0499eee909dc58f5d3fe564f57ad3a51d73e2e1 - Matthew Ernisse - 1595801790

I think I am going to go kinda hard here...

view tree

view raw

diff --git a/cgi-bin/vfdsay.py b/cgi-bin/vfdsay.py
new file mode 100755
index 0000000..0448517
--- /dev/null
+++ b/cgi-bin/vfdsay.py
@@ -0,0 +1,87 @@
+#!/usr/bin/env python3
+# -*- coding: UTF-8 -*-
+'''vfdsay.py (c) 2020 Matthew J Ernisse <matt@going-flying.com>
+All Rights Reserved.
+
+Redistribution and use in source and binary forms,
+with or without modification, are permitted provided
+that the following conditions are met:
+
+    * Redistributions of source code must retain the
+      above copyright notice, this list of conditions
+      and the following disclaimer.
+    * Redistributions in binary form must reproduce
+      the above copyright notice, this list of conditions
+      and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+import json
+import os
+import sys
+
+from urllib.parse import unquote
+
+def unicodeCheck(ch):
+	''' The Noritake Itron VFD connected to the other end of all
+	of this nonsense has the 'katakana character font', which means
+	that basically 0x20 - 0x7D corrispond to the ASCII equiv but the
+	rest may not.
+	'''
+	if ord(ch) > 0x7D or ord(ch) < 0x20:
+		raise Exception('unacceptable character')
+
+
+if __name__ == '__main__':
+	qs = os.environ.get('QUERY_STRING')
+	if not qs:
+		print('10 What would you like to say?\r\n')
+		sys.exit(0)
+
+	if len(qs) > 24:
+		print('50 Maximum line length is 24 characters.\r\n')
+		sys.exit(0)
+
+	try:
+		qs = unquote(qs)
+		list(map(unicodeCheck, qs))
+	except Exception as e:
+		print(f'50 {e} in input\r\n')
+		sys.exit(0)
+
+	print("20 text/gemini\r\n")
+	print(f'''```
+
+                   ┌───────────────────┐
+┌──────────────────┘                   └──────────────────┐
+│  SmartModem 28800       ▀▀      ▀▀  ▀▀      ▀▀  ▀▀  ▀▀  │
+│  Hayes                  HS  AA  CD  OH  RD  SD  TR  MR  │
+└─────────────────────────────────────────────────────────┘
+```
+
+```
+ATDT 10.0.0.2
+DIALING...
+CONNECT 9600
+
+VFD "{qs}"
+OK
++++
+OK
+ATH
+DISCONNECTED
+```
+
+=> /vfd.gmi	Return
+''')
diff --git a/vfd.gmi b/vfd.gmi
new file mode 100644
index 0000000..ea25c33
--- /dev/null
+++ b/vfd.gmi
@@ -0,0 +1,14 @@
+# Internetting like it's 1998 again
+## Author: mernisse
+## Date: 26/July/2020
+
+A long time ago I hooked up a small plastic box with three LEDs on it up to the parallel port of my desktop computer.  I wrote a small CGI program in Turbo Pascal (of all things) that let a visitor to my web site turn on or off any of the LEDs.  This little box sat on my desk under my monitor so it was an early and rudimentary way for people to say hello to me while I was working away on the computer.
+
+=> /thoughts/WWWLEDSM.JPG
+
+To me Gemini feels a lot like those days.  An innocent era of computing teetering between the BBS and the 'world wide web'.  In that way it just feels natural to return to some of the tropes of that era, so what you are looking at is a fusion of the modern and the past.  On the other side of the link below this paragraph you will interact with a CGI script written in Python, executed by Molly Brown, which is written in Go, running in a Docker container on a virtual machine.  That Python script will make a HTTP connection over an IPSec VPN to a machine which will make a serial over USB connection to an Atmel ATmega32U4 and ultimately send your bytes to a Noritake itron VFD.  Whatever you type into the prompt will be displayed until someone else comes along and changes it.
+
+=> /cgi-bin/vfdsay.py	Say Something
+
+There is no log, no webcam, no video stream, no way for me to know who or what is being sent to this little VFD other than to be sitting at the desk and notice it.  No way for you to know it was sent other than to trust me, dear reader.  Harkening back to a much more innocent era of computing, I am giving you, a completely anonymous person on the other end of an un-knowable chain of Other People's devices write access to a physical piece of glass sitting in my home.
+