logo

blog

My website can't be that messy, right? git clone https://anongit.hacktivis.me/git/blog.git/
commit: c4d8db7948b50d6616cc8356a19a0c864c0ab119
parent 71e0d21b319a345408e0cdc7a2f19082723b0e4f
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 17 Jan 2025 13:17:29 +0100

drink-me: Generate gradual increase instead of 13 similar brotli-bombs

Diffstat:

Mdrink-me/drink-me-1.html4++--
Mdrink-me/drink-me-1.html.br0
Mdrink-me/drink-me-10.html4++--
Mdrink-me/drink-me-10.html.br0
Mdrink-me/drink-me-11.html3+--
Mdrink-me/drink-me-11.html.br0
Mdrink-me/drink-me-12.html6++----
Mdrink-me/drink-me-12.html.br0
Mdrink-me/drink-me-13.html10++--------
Mdrink-me/drink-me-13.html.br0
Mdrink-me/drink-me-2.html4++--
Mdrink-me/drink-me-2.html.br0
Mdrink-me/drink-me-3.html5+++--
Mdrink-me/drink-me-3.html.br0
Mdrink-me/drink-me-4.html4++--
Mdrink-me/drink-me-4.html.br0
Mdrink-me/drink-me-5.html4++--
Mdrink-me/drink-me-5.html.br0
Mdrink-me/drink-me-6.html5++---
Mdrink-me/drink-me-6.html.br0
Mdrink-me/drink-me-7.html5+++--
Mdrink-me/drink-me-7.html.br0
Mdrink-me/drink-me-8.html4++--
Mdrink-me/drink-me-8.html.br0
Mdrink-me/drink-me-9.html3++-
Mdrink-me/drink-me-9.html.br0
Mdrink-me/gen-drink-me.sh18++++++++++++------
27 files changed, 39 insertions(+), 40 deletions(-)

diff --git a/drink-me/drink-me-1.html b/drink-me/drink-me-1.html @@ -4,8 +4,8 @@ <body> <main> <p><a href="./drink-me-0.html">prev</a> - <a href="./drink-me-2.html">next</a></p> - <q>I've simply been pretending to be an adult until I can make it as an ideal grown-up. -— Himmel, Sousou no Frieren (2024)</q> + <q>The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle. +— Joe Armstrong</q> </main> </body> </html> diff --git a/drink-me/drink-me-1.html.br b/drink-me/drink-me-1.html.br Binary files differ. diff --git a/drink-me/drink-me-10.html b/drink-me/drink-me-10.html @@ -4,8 +4,8 @@ <body> <main> <p><a href="./drink-me-9.html">prev</a> - <a href="./drink-me-11.html">next</a></p> - <q>Oh dear, I'm feeling political today. It's just that it's dawned on me that 'zero tolerance' only seems to mean putting extra police in poor, run-down areas, and not in the Stock Exchange. -— Terry Pratchett; alt.fan.pratchett</q> + <q>At this point, geofronts only exist within Japan and in science fiction. +- User:Kiwima on https://en.wiktionary.org/w/index.php?title=geofront&oldid=67882629</q> </main> </body> </html> diff --git a/drink-me/drink-me-10.html.br b/drink-me/drink-me-10.html.br Binary files differ. diff --git a/drink-me/drink-me-11.html b/drink-me/drink-me-11.html @@ -4,8 +4,7 @@ <body> <main> <p><a href="./drink-me-10.html">prev</a> - <a href="./drink-me-12.html">next</a></p> - <q>When men refer to themselves as "alpha males", I hear that in the context of software, where alpha veresions are unstable, missing important features, filled with flaws and nor fit for the public. -— Glenn F. Henriksen</q> + <q>Days since last timezone issue: -1</q> </main> </body> </html> diff --git a/drink-me/drink-me-11.html.br b/drink-me/drink-me-11.html.br Binary files differ. diff --git a/drink-me/drink-me-12.html b/drink-me/drink-me-12.html @@ -4,10 +4,8 @@ <body> <main> <p><a href="./drink-me-11.html">prev</a> - <a href="./drink-me-13.html">next</a></p> - <q>The following two statements are usually both true: -There's not enough documentation. -There's too much documentation. -— Larry Wall <199709020026.RAA08431@wall.org> (1997)</q> + <q>That’s the thing about people who think they hate computers. What they really hate is lousy programmers. +— Larry Niven and Jerry Pournelle Oath of Fealty</q> </main> </body> </html> diff --git a/drink-me/drink-me-12.html.br b/drink-me/drink-me-12.html.br Binary files differ. diff --git a/drink-me/drink-me-13.html b/drink-me/drink-me-13.html @@ -4,14 +4,8 @@ <body> <main> <p><a href="./drink-me-12.html">prev</a> - <a href="./drink-me-14.html">next</a></p> - <q>The student approached the Master and said "He wants to put a million people on Mars by 2040! That's so amazing!" - -The Master replied. "I have a better plan. I will put a million people on Antarctica by 2040." - -"But that sounds fucking insane. Why would you want to do something that stupid? It's a barren wasteland that's difficult to populate and would provide us with absolutely nothing!" - -At that moment, the student was enlightened. -— Chris Armstrong, 2024 <https://mastodon.social/@Rhodium103/113118466140842493></q> + <q>Better just drag this porn .mp4 accross the full width of my desktop over work chat to the media pla oops dropped it +— 2021-02-13 "vlc media player" <https://bonequest.com/8001></q> </main> </body> </html> diff --git a/drink-me/drink-me-13.html.br b/drink-me/drink-me-13.html.br Binary files differ. diff --git a/drink-me/drink-me-2.html b/drink-me/drink-me-2.html @@ -4,8 +4,8 @@ <body> <main> <p><a href="./drink-me-1.html">prev</a> - <a href="./drink-me-3.html">next</a></p> - <q>Don't tell me that catgirl and the IBN 5100 are connected somehow. -— Okarin, Steins; Gate (2009)</q> + <q>One of my most productive days was throwing away 1000 lines of code. +— Ken Thompson</q> </main> </body> </html> diff --git a/drink-me/drink-me-2.html.br b/drink-me/drink-me-2.html.br Binary files differ. diff --git a/drink-me/drink-me-3.html b/drink-me/drink-me-3.html @@ -4,8 +4,9 @@ <body> <main> <p><a href="./drink-me-2.html">prev</a> - <a href="./drink-me-4.html">next</a></p> - <q>Half of the world is women! -— 紅の豚 (Porco Rosso, 1992)</q> + <q>Q: Why doesn't Linode offer Windows VPS by default? +A: It's called Linode, and that means "Linux node", it's not called "Winode". +Q: If I install FreeBSD, does it mean that the host is going to open chatrooms for everyone?</q> </main> </body> </html> diff --git a/drink-me/drink-me-3.html.br b/drink-me/drink-me-3.html.br Binary files differ. diff --git a/drink-me/drink-me-4.html b/drink-me/drink-me-4.html @@ -4,8 +4,8 @@ <body> <main> <p><a href="./drink-me-3.html">prev</a> - <a href="./drink-me-5.html">next</a></p> - <q>Oh dear, I'm feeling political today. It's just that it's dawned on me that 'zero tolerance' only seems to mean putting extra police in poor, run-down areas, and not in the Stock Exchange. -— Terry Pratchett; alt.fan.pratchett</q> + <q>Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. +— Andrew S. Tanenbaum; Computer Networks, 3rd ed., p. 83. (paraphrasing Dr. Warren Jackson, Director, University of Toronto Computing Services (UTCS) circa 1985)</q> </main> </body> </html> diff --git a/drink-me/drink-me-4.html.br b/drink-me/drink-me-4.html.br Binary files differ. diff --git a/drink-me/drink-me-5.html b/drink-me/drink-me-5.html @@ -4,8 +4,8 @@ <body> <main> <p><a href="./drink-me-4.html">prev</a> - <a href="./drink-me-6.html">next</a></p> - <q>A distributed system is one in which the failure of a computer you didn’t even know existed can render your own computer unusable. -— Leslie Lamport</q> + <q>Il serait temps que t'apprennes comment obtenir le son sur ce truc. +— Mémé Ciredutemps; Wyrd Sisters (animated) 00:27:45</q> </main> </body> </html> diff --git a/drink-me/drink-me-5.html.br b/drink-me/drink-me-5.html.br Binary files differ. diff --git a/drink-me/drink-me-6.html b/drink-me/drink-me-6.html @@ -4,9 +4,8 @@ <body> <main> <p><a href="./drink-me-5.html">prev</a> - <a href="./drink-me-7.html">next</a></p> - <q>Q: Why doesn't Linode offer Windows VPS by default? -A: It's called Linode, and that means "Linux node", it's not called "Winode". -Q: If I install FreeBSD, does it mean that the host is going to open chatrooms for everyone?</q> + <q>One of my most productive days was throwing away 1000 lines of code. +— Ken Thompson</q> </main> </body> </html> diff --git a/drink-me/drink-me-6.html.br b/drink-me/drink-me-6.html.br Binary files differ. diff --git a/drink-me/drink-me-7.html b/drink-me/drink-me-7.html @@ -4,8 +4,9 @@ <body> <main> <p><a href="./drink-me-6.html">prev</a> - <a href="./drink-me-8.html">next</a></p> - <q>Somehow I've lucked out and have an 8yo who thinks secretly reading under the covers past her bedtime is an act of rebellion, and it hasn't yet occurred to her that her flashlights never seem to run out of batteries. -— Robert McNees 2020-08-13 - https://mastodon.social/@mcnees/110334058263166569</q> + <q>In short, you can't use sizeof() on a structure whose elements haven't been +defined, and if you do, demons may fly out of your nose. +— John F. Woods, <https://groups.google.com/g/comp.std.c/c/ycpVKxTZkgw/m/S2hHdTbv4d8J></q> </main> </body> </html> diff --git a/drink-me/drink-me-7.html.br b/drink-me/drink-me-7.html.br Binary files differ. diff --git a/drink-me/drink-me-8.html b/drink-me/drink-me-8.html @@ -4,8 +4,8 @@ <body> <main> <p><a href="./drink-me-7.html">prev</a> - <a href="./drink-me-9.html">next</a></p> - <q>Software gets slower faster than hardware gets faster. -— Wirth’s law</q> + <q>The X server has to be the biggest program I’ve ever seen that doesn’t do anything for you. +— Ken Thompson</q> </main> </body> </html> diff --git a/drink-me/drink-me-8.html.br b/drink-me/drink-me-8.html.br Binary files differ. diff --git a/drink-me/drink-me-9.html b/drink-me/drink-me-9.html @@ -4,7 +4,8 @@ <body> <main> <p><a href="./drink-me-8.html">prev</a> - <a href="./drink-me-10.html">next</a></p> - <q>I need privacy. Not because my actions are questionable, but because your judgement and intentions are.</q> + <q>When men refer to themselves as "alpha males", I hear that in the context of software, where alpha veresions are unstable, missing important features, filled with flaws and nor fit for the public. +— Glenn F. Henriksen</q> </main> </body> </html> diff --git a/drink-me/drink-me-9.html.br b/drink-me/drink-me-9.html.br Binary files differ. diff --git a/drink-me/gen-drink-me.sh b/drink-me/gen-drink-me.sh @@ -1,8 +1,5 @@ #!/bin/sh -# 512MiB -node_str_limit=536870888 - for i in $(seq 13 1) do echo "generating drink-me-$i.html" @@ -27,11 +24,20 @@ do "$(fortune)" \ > "drink-me-$i.html" + size=$(wc -c <"drink-me-$i.html") + chmod +r "drink-me-$i.html" - echo "generating drink-me-$i.html.br" + # == Generate evil-brotli version == + + # NodeJS string limit: 536870888 (24 bytes less than exactly 512MiB) + # ((8^10)/2)-(8*10) ~= 512 MiB + # ((8^11)/2)-(8*11) ~= 4 GiB + # ((8^12)/2)-(8*12) ~= 32 GiB + # ((8^13)/2)-(8*13) ~= 256 GiB + evil_size=$(echo "${size}+((8^${i})/2)-(8*${i})" | bc) - # Generate evil-brotli version + echo "generating drink-me-$i.html.br (${evil_size} bytes)" { printf \ '<!DOCTYPE html> @@ -48,7 +54,7 @@ do yes ' <p><a href="#">' } \ - | head -c "$node_str_limit" \ + | head -c "${evil_size}" \ | brotli -f -Z -o "drink-me-$i.html.br" chmod +r "drink-me-$i.html.br"