gemini.git

going-flying.com gemini git repository

summary

tree

log

refs

21ed8ef9257d39a9b511d5838d9953bc8757f4b2 - Matthew Ernisse - 1613849491

Merge branch 'master' of ssl.ub3rgeek.net:gemini

view tree

view raw

diff --git a/cgi-bin/converter b/cgi-bin/converter
index 3eef4c1..ab82bde 100755
--- a/cgi-bin/converter
+++ b/cgi-bin/converter
@@ -28,6 +28,7 @@ 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 base64
+import datetime
 import os
 import secrets
 import sys
@@ -62,6 +63,10 @@ While I have taken care to be fairly reasonable with these things, please note t
 => random/base32	Random number, Base32 encoded
 => random/totp		Random number, encoded as a TOTP secret
 
+## Other Stuff
+
+=> unixdate		Unix timestamp to UTC date
+
 ## Suggestions?
 Want to see something here?  Feel free to drop me a line.
 => mailto:matt@going-flying.com
@@ -262,6 +267,10 @@ if __name__ == '__main__':
 			png.save(sys.stdout.buffer)
 			sys.stdout.flush()
 
+		# Unixdate
+		elif cgi.path_info == 'unixdate':
+			cgi.Response.Input('UNIX Timestamp?')
+			
 		else:
 			cgi.Response.Redirect(BACK_LINK)
 	else:
@@ -364,6 +373,24 @@ if __name__ == '__main__':
 				True
 			)
 
+		# Unixdate
+		elif cgi.path_info == 'unixdate':
+			ts = cgi.query_dequoted
+			try:
+				dt = datetime.datetime.fromtimestamp(float(ts))
+				t = dt.strftime('%A %d %B %Y %H:%M:%S UTC')
+
+			except Exception:
+				cgi.Response.Fail()
+				sys.exit()
+
+			cgi.Response.Ok('text/gemini')
+			output = f'# UNIX Timestamp {ts}\n'
+			output += f'{t}\n\n'
+			output += f'=> {BACK_LINK}	Back\n'
+			output += f'=> /	Home'
+			print(output)
+
 		else:
 			cgi.Response.NotFound()
 
diff --git a/users/mernisse/articles/18.gmi b/users/mernisse/articles/18.gmi
new file mode 100644
index 0000000..dcf407b
--- /dev/null
+++ b/users/mernisse/articles/18.gmi
@@ -0,0 +1,47 @@
+---
+Title: Gemini as an excuse to make toys again
+Date: 2/11/2021 13:21
+
+I mentioned back in my second gemlog post that I had, a long time ago, a
+penchant for hooking random things up to the Internet.  The reality is that
+in one form or another the early days of the World Wide Web encouraged a lot
+of experimentation that seems largely to be discouraged now.  It was at the
+very least an interesting challenge to see what you could create, or at least
+connect.  In no small part the security concerns of putting things up on port
+443, or I suppose out in general, weigh heavily upon me now when deciding what
+kind of silly things to build.  There is a reason that to get to any of the
+Docker containers that I have running you have to go through at the very
+least Apache and then nginx.  It's all about layers.  Defense in depth.  Not
+so much about fun.  I ran into some archived PHP the other day when cleaning
+of a system I had made so you could play Zork 1 (and other old text adventures)
+online...  It turns out the Internet Archive even snagged a copy of the website
+I made for it.
+
+=> /~mernisse/01.gmi	My second post
+=> https://web.archive.org/web/20020126054202/http://zork.ub3rgeek.net/	Zork, circa 2002
+
+Gemini brings back some of that low-risk feeling for me.  The places where
+it is more web like than gopher like open up just enough interesting
+possibilities, while still feeling like it is safe to experiment.  Some of it
+is the architecture of the protocol, the ecosystem of the browsers, and the
+way I have this server isolated, but there is also a real feeling that putting
+something out on Gemini is more like putting it out to a small community.
+
+All of that was just a long-winded nostalgia trip justifying the random 
+novelty scripts I have found writing over the last few months.  You can
+see them all listed on the root page of this capsule, and I finally got
+git.gmi working so you can browse the source if you are interested.
+
+=> /
+=> https://git.sr.ht/~fkfd/git.gmi	git.gmi
+=> /git/cgi/gemini.git/summary		Capsule Source
+
+The most amusing novelty I have built so far is a bit of a junk drawer.  It
+contains things I find myself needing to do from time to time and always
+searching for a quick web app to do it.  It can convert number bases, base64
+encode and decode, urlquote and unquote, convert UNIX time stamps to something
+human readable and a few more things.
+
+=> /cgi-bin/converter/
+
+More to come?  Probably.