commit c4e57b3b9458df8a105ce8691786928a538b7c18 Author: dogeystamp Date: Mon Jan 29 16:35:02 2024 -0500 initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..ec29647 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# garbage-monorepo + +a dump of all the actually useless scripts, code, and other toys, put into one repo diff --git a/loader/README.md b/loader/README.md new file mode 100644 index 0000000..0466796 --- /dev/null +++ b/loader/README.md @@ -0,0 +1,4 @@ +# loader + +whiptail toy. +loading bar that does weird things diff --git a/loader/loader.sh b/loader/loader.sh new file mode 100755 index 0000000..a4da584 --- /dev/null +++ b/loader/loader.sh @@ -0,0 +1 @@ +echo "ZXhwb3J0IFRFUk09YW5zaQp7Cglmb3IgaSBpbiAkKHNlcSAxIDUgMTAwKTsgZG8KCQlmb3IgaiBpbiAkKHNlcSAkKCgyMCAmICRpKSkpOyBkbwoJCQllY2hvICQoKCAkaSArICRqICkpCgkJCWZvciBrIGluICQoc2VxICRqKTsgZG8KCQkJCXNsZWVwIDAuMDEKCQkJZG9uZQoJCWRvbmUKCQlmb3IgaiBpbiAkKHNlcSAkKCgyMCAmICRpKSkpOyBkbwoJCQlzbGVlcCAwLjIKCQlkb25lCglkb25lCn0gfCB3aGlwdGFpbCAtLWdhdWdlICJsb2FkaW5nIiA2IDUwIDAKCndoaXB0YWlsIC0tbXNnYm94ICIkKGNhdCA8PCAnRU9GJwogICAgICAgICAgXyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXyAgICAgXyAgIF8gICAgICAgICAgCl9fICAgICAgX3wgfF9fICAgX19fIF8gX18gICAgXyAgIF8gIF9fXyAgXyAgIF8gICAgX18gX3wgfF8gIHwgfF98IHxfXyAgIF9fXyAKXCBcIC9cIC8gLyAnXyBcIC8gXyBcICdfIFwgIHwgfCB8IHwvIF8gXHwgfCB8IHwgIC8gX2AgfCBfX3wgfCBfX3wgJ18gXCAvIF8gXAogXCBWICBWIC98IHwgfCB8ICBfXy8gfCB8IHwgfCB8X3wgfCAoXykgfCB8X3wgfCB8IChffCB8IHxfICB8IHxffCB8IHwgfCAgX18vCiAgXF8vXF8vIHxffCB8X3xcX19ffF98IHxffCAgXF9fLCB8XF9fXy8gXF9fLF98ICBcX18sX3xcX198ICBcX198X3wgfF98XF9fX3wKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8X19fLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgXyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCl9fICAgICAgX3wgfF9fICAgX19fIF8gX18gICAgXyAgIF8gIF9fXyAgXyAgIF8gICBfICAgXyAgX19fICBfICAgXyAKXCBcIC9cIC8gLyAnXyBcIC8gXyBcICdfIFwgIHwgfCB8IHwvIF8gXHwgfCB8IHwgfCB8IHwgfC8gXyBcfCB8IHwgfAogXCBWICBWIC98IHwgfCB8ICBfXy8gfCB8IHwgfCB8X3wgfCAoXykgfCB8X3wgfCB8IHxffCB8IChfKSB8IHxffCB8CiAgXF8vXF8vIHxffCB8X3xcX19ffF98IHxffCAgXF9fLCB8XF9fXy8gXF9fLF98ICBcX18sIHxcX19fLyBcX18sX3wKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8X19fLyAgICAgICAgICAgICAgIHxfX18vICAgICAgICAgICAgIApFT0YKKSIgNDAgODAK" | base64 -d | sh diff --git a/make-linux-fast/README.md b/make-linux-fast/README.md new file mode 100644 index 0000000..c7b708e --- /dev/null +++ b/make-linux-fast/README.md @@ -0,0 +1,5 @@ +# make-linux-fast + +a shell script webserver inspired by [this](https://news.ycombinator.com/item?id=22830330). +the premise is that if you automatically curl'ed this into your grub config (with grub-mkconfig), +it might set your init to reboot and bootloop your system diff --git a/make-linux-fast/make-linux-fast.sh b/make-linux-fast/make-linux-fast.sh new file mode 100755 index 0000000..cd85b26 --- /dev/null +++ b/make-linux-fast/make-linux-fast.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +while true +do + RAND="$(seq 5 | shuf | head -n 1)" + RET="" + + if [ "$RAND" = "1" ] + then + RET='init=/usr/sbin/reboot' + else + RET='noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off' + fi + + LEN=$(printf "$RET" | wc -c) + + HEADERS="HTTP/1.0 200 OK\r\nContent-Length: $LEN\r\n\r\n" + + RESP="$HEADERS$RET\r\n" + + printf "$RESP" \ + | nc -l -p 8080 +done diff --git a/pongwars/README.md b/pongwars/README.md new file mode 100644 index 0000000..ef66c55 --- /dev/null +++ b/pongwars/README.md @@ -0,0 +1,9 @@ +# pongwars + +code taken from https://codyebberson.github.io/pong-wars/ + +includes more colors, and the ability for a color to win. +optionally (look in the code for the commented line), enable sudden death mode after a few minutes. +also, pressing the number keys will control the individual balls. + +relevant hacker news thread (original): https://news.ycombinator.com/item?id=39159418 diff --git a/pongwars/index.html b/pongwars/index.html new file mode 100644 index 0000000..b183de6 --- /dev/null +++ b/pongwars/index.html @@ -0,0 +1,341 @@ + + + + Pong wars | Koen van Gilst + + + + + +
+ +
+

+ made by Koen van Gilst | source on + github +

+
+ + + + diff --git a/square_validator/README.md b/square_validator/README.md new file mode 100644 index 0000000..e2607d0 --- /dev/null +++ b/square_validator/README.md @@ -0,0 +1,3 @@ +# square validator + +find examples for an erroneous method for doing square/cube/... roots of numbers diff --git a/square_validator/square_validator.py b/square_validator/square_validator.py new file mode 100644 index 0000000..37cb35f --- /dev/null +++ b/square_validator/square_validator.py @@ -0,0 +1,13 @@ +# self-explanatory by looking at the output + +def digs(x: int) -> list[int]: + return [int(i) for i in str(x)] + +def outp(x: int, exp: int) -> None: + pw: int = x**exp + print(f"{exp}√{pw}: {' + '.join(str(pw))} = {(s := sum(digs(pw)))}\n\t{s} - {exp} = {x} ✓\n") + +for exp in range(1, 10): + gen = (i for i in range(10000) if sum(digs(i**exp)) - exp == i) + for x in gen: + outp(x, exp)