about summary refs log tree commit diff
path: root/served/things/memoryleak/files/pull
diff options
context:
space:
mode:
authorgennyble <gen@nyble.dev>2024-04-14 02:41:40 -0500
committergennyble <gen@nyble.dev>2024-04-14 02:41:40 -0500
commit0ccf8f1cbcec01271334ec78208f0b7a17f263bd (patch)
treed93e360b3dffcf95e13ffef063c37c1542693c90 /served/things/memoryleak/files/pull
parent7a4d1700a2bb7a5ae69fdddf0d86ff17bd7d12e8 (diff)
download∞-0ccf8f1cbcec01271334ec78208f0b7a17f263bd.tar.gz
∞-0ccf8f1cbcec01271334ec78208f0b7a17f263bd.zip
Make a things page for memoryleak my beloved
Diffstat (limited to 'served/things/memoryleak/files/pull')
-rwxr-xr-xserved/things/memoryleak/files/pull33
1 files changed, 33 insertions, 0 deletions
diff --git a/served/things/memoryleak/files/pull b/served/things/memoryleak/files/pull
new file mode 100755
index 0000000..3268886
--- /dev/null
+++ b/served/things/memoryleak/files/pull
@@ -0,0 +1,33 @@
+#!/bin/ash
+
+#find /root -type f > /root/files
+#for dir in $(ls /); do
+#	# we ignore root because we use it to prime the file above
+#	if [[ "$dir" != "proc" ]] && \
+#		[[ "$dir" != "dev" ]] && \
+#		[[ "$dir" != "sys" ]] && \
+#		[[ "$dir" != "run" ]] && \
+#		[[ "$dir" != "tmp" ]] && \
+#		[[ "$dir" != "root" ]]; then
+#		find /$dir -type f >> /root/files
+#	fi
+#done
+#exit
+
+sleep 12
+
+find / -type f > /root/files
+
+sleep 3
+
+file=$(shuf -n 1 /root/files)
+
+echo "$(date) deleting $file" | tee -a /root/did
+
+curl -X POST -H "x-api-key: REDACTED" -H "Content-Type: application/json" \
+	"https://feeling.nyble.dev/amble.quest/memoryleak" \
+	-d "{\"status\": \"Deleting \`$file\`. Did I need that?\", \"visibility\": \"unlisted\", \"content_type\": \"text/markdown\"}"
+
+rm -rf $file
+sleep 5
+poweroff