gemini.git

going-flying.com gemini git repository

summary

tree

log

refs

c829a724c972ab72b59edd75a111f82f28e22f75 - Matthew Ernisse - 1612574362

new toy

view tree

view raw

diff --git a/cgi-bin/ferengi b/cgi-bin/ferengi
new file mode 100644
index 0000000..72ce6f1
--- /dev/null
+++ b/cgi-bin/ferengi
@@ -0,0 +1,47 @@
+1. Once you have their money, you never give it back.
+3. Never spend more for an acquisition than you have to.
+6. Never allow family to stand in the way of opportunity.
+7. Keep your ears open.
+9. Opportunity plus instinct equals profit.
+10. Greed is eternal.
+16. A deal is a deal.
+17. A contract is a contract is a contract… but only between Ferengi.
+18. A Ferengi without profit is no Ferengi at all.
+21. Never place friendship above profit.
+22. A wise man can hear profit in the wind.
+23. Nothing is more important than your health… except for your money.
+31. Never make fun of a Ferengi's mother.
+33. It never hurts to suck up to the boss.
+34. War is good for business.
+35. Peace is good for business.
+45. Expand or die.
+47. Don't trust a man wearing a better suit than your own.
+48. The bigger the smile, the sharper the knife.
+57. Good customers are as rare as latinum. Treasure them.
+59. Free advice is seldom cheap.
+62. The riskier the road, the greater the profit.
+74. Knowledge equals profit.
+75. Home is where the heart is, but the stars are made of latinum.
+76. Every once in a while, declare peace. It confuses the hell out of your enemies.
+94. Females and finances don't mix.
+95. Expand or die.
+98. Every man has his price.
+102. Nature decays, but latinum lasts forever.
+103. Sleep can interfere with…
+109. Dignity and an empty sack is worth the sack.
+111. Treat people in your debt like family… exploit them.
+112. Never have sex with the boss' sister.
+125. You can't make a deal if you're dead.
+139. Wives serve, brothers inherit.
+168. Whisper your way to success.
+190. Hear all, trust nothing.
+194. It's always good business to know about new customers before they walk in your door.
+203. New customers are like razor-toothed gree-worms. They can be succulent, but sometimes they bite back.
+208. Sometimes the only thing more dangerous than a question is an answer.
+211. Employees are the rungs on the ladder of success. Don't hesitate to step on them.
+214. Never begin a business negotiation on an empty stomach.
+217. You can't free a fish from water.
+229. Latinum lasts longer than lust.
+239. Never be afraid to mislabel a product.
+263. Never allow doubt to tarnish your lust for latinum.
+285. No good deed ever goes unpunished.
diff --git a/cgi-bin/rules.py b/cgi-bin/rules.py
new file mode 100755
index 0000000..9ee39c6
--- /dev/null
+++ b/cgi-bin/rules.py
@@ -0,0 +1,91 @@
+#!/usr/bin/env python3
+# -*- coding: UTF-8 -*-
+'''rules.py (c) 2021 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.
+'''
+# 'Official' Rules of Acquisition from Memory Alpha.  There are many
+# lists but this one has attributions to official sources for each one.
+# https://memory-alpha.fandom.com/wiki/Rules_of_Acquisition
+#
+# Ferengi ship ASCII from https://ascii.co.uk/art/startrek
+
+import random
+import os
+import sys
+
+
+if __name__ == '__main__':
+	fn = os.path.dirname(os.environ.get('SCRIPT_PATH','.'))
+	fn = os.path.join(fn, 'ferengi')
+
+	if not os.path.exists(fn):
+		print('20 text/plain\r\n')
+		print('When no appropriate rule applies, make one up.')
+		sys.exit()
+		
+	try:
+
+		with open(fn) as fd:
+			rules = fd.readlines()
+	except Exception:
+		print('20 text/plain\r\n')
+		print('If that\'s what\'s written, then that\'s what\'s written.')
+		sys.exit()
+
+	r_num, rule = rules[random.randint(0, len(rules))].split('.', 1)
+	rule.strip()
+
+	print('20 text/gemini\r\n')
+	print('# A Reading from the Ferengi Rules of Acquisition')
+	print('''```
+          __,----.____
+      _,-' ___// _,','(=
+    ,'\        /,' / ~
+  ,'\        /_/  /           ____
+ /-        /_ /--|        ,--'   ,`-
+/-        /__/ []|_______/     ,'- /
+|         /  |  /.........\  ,'-,-|
+|]      _|,---,  __________ |--|  |
+|  []  [__    |] __________ |--|  |
+|]       |`---'  .........  |--|  |
+|         \__|   \_______ /  `.-`-|
+\-        \ _\ []|       \     `.- \\
+ \-        \ _\--|        `--.____,-
+  `./        \_\  \\
+    `./    ____\`. \ _
+       `-.__  \\\\  `_`,(=
+            `----'~
+```''')
+	print()
+	print(f'## Rule number {r_num}...')
+	print(f'> {rule}')
+	print()
+	print('That will be one slip of latinum.')
+	print()
+	print('=> https://memory-alpha.fandom.com/wiki/Rules_of_Acquisition	Rules from Memory Alpha')
+	print('=> https://ascii.co.uk/art/startrek ASCII Ferengi Ship')
+	print('=> / Home')
diff --git a/index.gmi b/index.gmi
index a83da3b..9b0b3a8 100644
--- a/index.gmi
+++ b/index.gmi
@@ -17,6 +17,7 @@ For the interested this capsule is running on Molly Brown in a Docker container,
 => /thoughts/	Gemini mirror of my web microblog, basically.
 => /how-built.gmi	How this capsule is built, vaguely.
 => /cgi-bin/bofh.py	BOFH-style Excuse Server
+=> /cgi-bin/rules.py	Random Ferengi Rule of Acquisition
 => /cgi-bin/vfdsay.py	VFD Message Display
 => /~mernisse/01.gmi	(About the VFD message display)