1
0

not a single test since last commit

This commit is contained in:
dtb 2023-07-19 23:27:46 -04:00
parent bfea5f032e
commit 5cd709a449

View File

@ -1,34 +1,82 @@
#!/bin/sh
#llllmmmm11234567892123456789312345678941234567895123456789612345678971234567890
set -ex
<"$0" python3 -c "
<"$0" python3 -c '
import os, sys
cleanupsh = '#!/bin/sh\n'
for day in sys.stdin.read().split('\n\n\n'):
f = day.split('\n')[0]
if '\t' in f:
fa = f.split('\t')[1].split(',')
f = f.split('\t')[0]
else:
fa = ['']
if f[0] != '/':
continue
f = '.' + f
if os.path.isfile(f):
continue
d = '/'.join(f.split('/')[:-1])
if '/' in f and not(os.path.isdir(d)) and not(d == ''):
os.makedirs(d)
cleanupsh += 'rm -r -- ' + d + '\n'
with open(f,'w') as fd:
fd.write(day)
if cleanupsh == '':
cleanupsh = '#!/bin/sh\n'
cleanupsh += 'rm -- ' + f + '\n'
if len(cleanupsh.split('\n')) > 2:
with open('cleanup.sh', 'w') as fd:
fd.write(cleanupsh)
"
class File:
attributes = [ # last in order wins in conflict, list must have both
"literally", "figuratively",
"append", "replace",
"verbatim", "stub"
]
content = ""
def __init__(self, **kwargs):
if "attributes" in kwargs:
self.attributes += kwargs["attributes"]
del(kwargs["attributes"])
for key in kwargs:
if key == "attributes": self.attributes+=kwargs["key"]
else: setattr(self, key, kwargs[key])
files = {"./cleanup.sh": File(attributes=["verbatim"], content="#!/bin/sh\n")}
for part in sys.stdin.read().split("\n\n\n").reverse():
name = part.split("\n")[0]
substitutions = dict()
if "\t" in "." + name:
attributes = name.split("\t")[1].split(",")
name = name.split("\t")[0]
else: attributes = default_attributes
if len(name) > 1 and name[1] != "/": continue
for s in part[len(name)+1:].split("\n\n")[0].split("\n"):
s = s.split("\t")
if len(s) == 2: substitutions[s[0]] = s[1]
content = part[len(substitutions)+2:]
if attributes.index("append") > attributes.index("replace"):
if not(name in files):
sys.stderr.write(sys.argv[0] + ": " + name + ": "
+ "appending to nothing\n")
else:
content = files[name].content + content
files += {name: File(attributes = attributes, content = content,
substitutions = substitutions)}
for name in files:
if name == "./cleanup.sh": continue
attributes = files[name].attributes
directory = "/".join(name.split("/")[:-1])
if attributes.index("stub") > attributes.index("verbatim"):
prefix = ""
suffix = ""
for d in directory.split("/"):
if d + "/Prefix" in files.keys():
prefix = files[d + "/Prefix"].content
if d + "/Suffix" in files.keys():
suffix = files[d + "/Suffix"].content
files[name].content = prefix + files[name].content + suffix
if attributes.index("figuratively") > attributes.index("literally"):
content = files[name].content
for s in files[name].substitutions:
instances = []
i = 0
while True:
instance = content.find(s, i)
if instance == -1: break
intances += [instance]
i = instance + len(s)
if len(instances) == 0: continue
for i in intances.reverse():
content = (content[:i] + substitutions[s]
+ content[i+len(s):])
files[name].content = content
if not(os.path.isdir(directory)):
os.makedirs(directory)
files["./cleanup.sh"].content += "rm -r -- " + directory + "\n"
else if directory == ".":
files["./cleanup.sh"].content += "rm -- " + name + "\n"
with open(name, "w") as fd:
fd.write(f)
if len(files["./cleanup.sh"].content.split("\n")) > 2:
with open("./cleanup.sh", "w") as fd:
fd.write(files["./cleanup.sh"].content)
'
test -f homepage.local \
&& exec ./homepage.local \
|| exit 0
@ -63,8 +111,8 @@ For more information, please refer to <http://unlicense.org/>
/homepage.html
$! __TITLE__ &quot;homepage&quot; documentation
$! __DESCRIPTION one file, one website
$!TITLE &quot;homepage&quot; documentation
$!DESCRIPTION one file, one website
<H1>&quot;homepage&quot; documentation</H1>
<H2>the forest</H2>
@ -109,14 +157,62 @@ appended. The "stub" attribute indicates the opposite, though its behavior is
default.
</P>
<P>
The "literal" attribute indicates that the file should not be subject to
macro expansion despite any other directives. The "figurative" attribute
The "literally" attribute indicates that the file should not be subject to
macro expansion despite any other directives. The "figuratively" attribute
indicates the opposite, though its behavior is default.
</P>
/praise/index.html append,literally
<LI>[<TIME datetime="2023-07-18 12:27">2023</TIME>] Doctor Eli Selig !!JQHA6kqyl91: >Maid Phone user / >mfw / ["Heart hands.jpg"]</LI>
/praise/Prefix
<!DOCTYPE html>
<HTML lang="en-US">
<HEAD>
<LINK HREF="https://trinity.moe/_PAGE" REL="canonical" />
<LINK HREF="/img/icons/favicon.ico" REL="shortcut icon" TYPE="image/x-icon" />
<LINK HREF="/css/2023.css" ID="styling" REL="stylesheet" />
<META CHARSET="UTF-8" />
<META CONTENT="dtb" NAME="author" />
<META CONTENT="praise for trinity / dot moe" NAME="description" />
<META CONTENT="width=device-width, initial-scale=1" NAME="viewport" />
<META CONTENT="img/trinnow.bmp" NAME="og:image" />
<META CONTENT="noindex" NAME="googlebot" /> <!-- FUCK GOOGLE -->
<META CONTENT="interest-cohort=()" HTTP-EQUIV="Permissions-Policy" /> <!-- FUCK GOOGLE -->
<STYLE>
li { font-family: monospace }
</STLYE>
<TITLE>praise</TITLE>
</HEAD>
<BODY>
<P><A HREF="..">~ www.trinity.moe</A></P>
<UL>
/praise/index.html literally
<LI>[<TIME datetime="2004-12-09">2004</TIME>] Dr. Gene Ray: <A HREF="https://web.archive.org/web/20041209065507/http://timecube.com:80/index.html">Life rotation debunks Trinity.</A></LI>
<LI>[<TIME datetime="2021-03-27 04:44">2021<TIME>] 🛸UFO🛸: I wanna hug trinity</LI>
<LI>[<TIME datetime="2021-05-03">2021</TIME>] Вероника Заглотова: <A HREF="https://invidious.tube/watch?v=fUpZO9LnNo0">my computer is making mustard gases</A></LI>
<LI>[<TIME datetime="2021-05-10 10:47">2021</TIME>] Аноним: [<I>screenshot of this website next to a screenshot of a wojak</I>]</LI> <!-- https://web.archive.org/web/20210510123535mp_/https://2ch.hk/s/res/2981671.html -->
<LI>[<TIME datetime="2021-05-15 08:49">2021</TIME>] Anonymous: deven's website is the best~!</LI>
<LI>[<TIME datetime="2021-05-15 09:17">2021</TIME>] Anonymous: this is what developing mental illness in teen years looks like</LI>
<LI>[<TIME>2021</TIME>] MetaMask/eth-phishing-detect: <A HREF="https://github.com/MetaMask/eth-phishing-detect/issues/5119">This domain was blocked for its similarity to dfinity.org, a historical phishing target.</A></LI>
<LI>[<TIME datetime="2022-05-11 21:43">2022</TIME>] Eminav_B: Never watching a movie with trinity</LI>
<LI>[<TIME datetime="2022-09-15 21:11">2022</TIME>] Milady Sonora Sprite: hi</LI>
/praise/Suffix
</UL>
</BODY>
</HTML>
/x200t/index.html
$! Thinkpad X200 Tablet
$!TITLE Thinkpad X200 Tablet
<SCRIPT SRC="/js/cookies.js" TYPE="application/javascript"></SCRIPT>
<SCRIPT SRC="/js/sheets.js" TYPE="application/javascript"></SCRIPT>
@ -299,7 +395,7 @@ No other FRUs need to be removed, nor do any other steps of the removal process
/hacker-howto/index.html
$! __TITLE__ How to Become A Hacker
$!TITLE How to Become A Hacker
<H2>How to Become A Hacker</H2>
<H3>Deven Trinity Blake</H3>
@ -384,7 +480,7 @@ How to accomplish this is an exercise left to the reader.
/home/index.html
$! __TITLE__ home
$!TITLE home
<P><A HREF="/">~ www.trinity.moe</A></P>
<UL>
@ -2064,7 +2160,7 @@ https://be.murderu.us/unix#posix#true(1)</A>.
/k/gacc.html
$! __TITLE__ on the gender acceleration blackpaper
$!TITLE on the gender acceleration blackpaper
<H1>on the gender acceleration blackpaper</H1>
<H3>updated ⏬?⏬?⏬</H3>
@ -2363,8 +2459,8 @@ You have disconnected.
/index.html
$! __TITLE__ trinity dot moe
$! __DESCRIPTION__ trinity's personal website
$!TITLE trinity dot moe
$!DESCRIPTION trinity's personal website
<SCRIPT TYPE="application/javascript" SRC="js/cookies.js" ></SCRIPT>
<SCRIPT TYPE="application/javascript" SRC="js/quotes.js" ></SCRIPT>
@ -2429,23 +2525,6 @@ curl https://www.trinity.moe/zeldb.sh | sudo sh
<HR ALIGN="left" SIZE="1" WIDTH="25%" />
<ARTICLE>
<H2>praise</H2>
<UL>
<LI STYLE="font-family: monospace">[<TIME datetime="2004-12-09">2004</TIME>] Dr. Gene Ray: <A HREF="https://web.archive.org/web/20041209065507/http://timecube.com:80/index.html">Life rotation debunks Trinity.</A></LI>
<LI STYLE="font-family: monospace">[<TIME datetime="2021-03-27 04:44">2021<TIME>] 🛸UFO🛸: I wanna hug trinity</LI>
<LI STYLE="font-family: monospace">[<TIME datetime="2021-05-03">2021</TIME>] Вероника Заглотова: <A HREF="https://invidious.tube/watch?v=fUpZO9LnNo0">my computer is making mustard gases</A></LI>
<LI STYLE="font-family: monospace">[<TIME datetime="2021-05-10 10:47">2021</TIME>] Аноним: [<I>screenshot of this website next to a screenshot of a wojak</I>]</LI> <!-- https://web.archive.org/web/20210510123535mp_/https://2ch.hk/s/res/2981671.html -->
<LI STYLE="font-family: monospace">[<TIME datetime="2021-05-15 08:49">2021</TIME>] Anonymous: deven's website is the best~!')
<LI STYLE="font-family: monospace">[<TIME datetime="2021-05-15 09:17">2021</TIME>] Anonymous: this is what developing mental illness in teen years looks like</LI>
<LI STYLE="font-family: monospace">[<TIME>2021</TIME>] MetaMask/eth-phishing-detect: <A HREF="https://github.com/MetaMask/eth-phishing-detect/issues/5119">This domain was blocked for its similarity to dfinity.org, a historical phishing target.</A></LI>
<LI STYLE="font-family: monospace">[<TIME datetime="2022-05-11 21:43">2022</TIME>] Eminav_B: Never watching a movie with trinity</LI>
<LI STYLE="font-family: monospace">[<TIME datetime="2022-09-15 21:11">2022</TIME>] Milady Sonora Sprite: hi</LI>
</UL>
</ARTICLE>
<HR ALIGN="left" SIZE="1" WIDTH="25%" />
<P>
This site is written in vim and tested in the latest Firefox.
No rights reserved, all rights exercised, rights turned to lefts, left in this corner of the web.