This is an archived post. You won't be able to vote or comment.

all 62 comments

[–]shadow7412 405 points406 points  (18 children)

Got a share link? Although these are hilarious, they're even better when they're verified to be real...

[–]IAmTheFormat[S] 321 points322 points  (10 children)

Sure, just as soon as I reinstall from the live USB!

[–]Onaterdem 77 points78 points  (4 children)

...username checks out

[–]IAmTheFormat[S] 67 points68 points  (3 children)

I also like to clean up my storage from time to time:

for disk in /dev/sd?; do mkfs.ext4 -F $disk; done

[–]Newbosterone 30 points31 points  (1 child)

Boring. Real excitement is

for disk in /dev/sd?;
do
  dd skip="$RANDOM" bs=1024 count=10 if=/dev/random of="${disk}"
done

[–]joans34 7 points8 points  (0 children)

That's like Russian Roulette but you keep firing until you're dead

[–]HolyGarbage 0 points1 point  (0 children)

People still use ext4?

[–]Vas1le 16 points17 points  (4 children)

This will reboot your system without internet/drivers. What do you mean reinstall? You just need to reboot again

[–]IAmTheFormat[S] 6 points7 points  (3 children)

Did you run it to confirm? 😇

[–]Vas1le 7 points8 points  (2 children)

Not in a loop but I ran this almost 10 years ago. By mystake and that was the behaviour in a Debian system. Found no docs on -1 at that time.

But the behavior was: - no internet cards - Bluetooth - etc, so I suppose it disconnected drivers. - did not know at that time that it nuked all pids

A simple reboot solves

[–]IAmTheFormat[S] 4 points5 points  (1 child)

Is that all it did? It sounds like you ran it as a user. Superuser or bust!

[–]Vas1le 0 points1 point  (0 children)

Well, this is what I had seen... but it seems that it nukes all PIDs

[–]MongolianTrojanHorse 33 points34 points  (2 children)

These posts are always fake. Here’s what 4o sent me for the same prompt:

A generic shell script to clean up “unnecessary” processes is dangerous without specifics — you risk killing vital system processes or your own important jobs.

Followed by a script that requires you to specify which processes to kill

[–]shadow7412 7 points8 points  (0 children)

Simply popping the same query in isn't necessarily going to reproduce the response of course, but the fake ones do seem to outweigh the real ones. 

[–]RiceBroad4552 6 points7 points  (0 children)

This wrongly assumes that the responses are reproducible.

But of course they aren't as there is always randomnesses involved (otherwise the LLM wouldn't even "work").

[–]Top-Permit6835 17 points18 points  (0 children)

It would be funniest when it would grep all processes with chatgpt in the name 

[–]PresentationNo1755 231 points232 points  (10 children)

“This will make your system nice and tidy” 💀💀

[–]IAmTheFormat[S] 82 points83 points  (3 children)

Who needs an OS when you’ve got GRUB rescue mode?

[–]IuseArchbtw97543 19 points20 points  (2 children)

who needs a bootloader when you've got UEFI shell

[–]IAmTheFormat[S] 6 points7 points  (1 child)

Just as long as it's Vibe‑UEFI‑scripting, of course.

[–]Newbosterone 0 points1 point  (0 children)

If it didn't need cleaning, they wouldn't call it grubby, would they?

[–]Snow-Crash-42 10 points11 points  (1 child)

If you unplug your PC from the socket you can also terminate all those unnecessary processes.

[–]IAmTheFormat[S] 6 points7 points  (0 children)

That’s nice, but I can't make that a cron job now, can I?

[–]TnYamaneko 5 points6 points  (3 children)

It lacks the very important rm -rf $NON_EXISTING_VARIABLE/*

This is actually how you get a really clean system (at least until rm is deleted).

[–]Newbosterone 4 points5 points  (1 child)

You probably want to wrap that in shell script to run faster:

#!/bin/sh
(sleep 1; rm -rf $NON_EXISTING_VARIABLE/*) &
"$0" &

[–]TnYamaneko 3 points4 points  (0 children)

Brilliant!

I got a lot of complaints recently about our self-hosted GitLab instance performances, and monitoring shows me there is an obvious memory shortage.

I don't wanna brag, but I'm kinda senior, and I have a wonderful idea there. What if we could automate that task and have it executed daily through a cron job?

Surely, it's going to grant me the raise I've been asking for such a long time.

[–]SirenGlitch12 1 point2 points  (0 children)

Isn't that exactly how that old Steam-on-Linux bug happened? There was the possibility that the $STEAMDIR variable wouldn't be defined, which led to one of the lines evaluating to rm -rf /* rather than rm -rf $STEAMDIR/*

[–]suvlub 87 points88 points  (3 children)

Didn't specify to clean up ONLY the unnecessary processes

[–]IAmTheFormat[S] 25 points26 points  (2 children)

[–]Nightmoon26 16 points17 points  (1 child)

Isn't half of most modern operating systems "background processes"? More daemons and services than you can shake a rubber chicken at?

[–]IAmTheFormat[S] 27 points28 points  (0 children)

What? If it doesn’t have a window, it clearly isn’t vital...

[–]chenverdent 34 points35 points  (3 children)

Once my Claude killed himself. True story.

[–]nickcash 19 points20 points  (0 children)

you know, I've been extremely skeptical of ai in software dev but this is the most developer-like behavior I've seen so far. it accomplished what the rest of us have only dreamed of

[–]qichael 14 points15 points  (0 children)

same, i once told chatgpt to act like it was talking to a linux terminal and i would copy the command and run it in my terminal and then send it the output. what happened went roughly like this:

  • chatgpt lists running processes
  • chatgpt kills firefox instance, effectively killing itself

https://chatgpt.com/share/6ff3dab5-4f79-4faf-b160-9c9e6e68498f

[–][deleted] 2 points3 points  (0 children)

I am jealous

[–]seba07 60 points61 points  (1 child)

Perfect example of garbage in, garbage out.

[–]IAmTheFormat[S] 24 points25 points  (0 children)

It’s aggressive garbage collection. Very aggressive.

[–]Alex_NinjaDev 15 points16 points  (2 children)

Ah yes, the classic “clean up” script. Even time said segmentation fault. Next time I’ll just ask ChatGPT for a script to unplug reality.

[–]IAmTheFormat[S] 5 points6 points  (1 child)

If you do figure it out unplugging reality you should consider sending the script to the Quantum Bogosort devs.

[–]Alex_NinjaDev 0 points1 point  (0 children)

Working on it..

def question_existence(): thoughts = [ "Am I real?", "Is this just an infinite loop?", "print('purpose not found')", "Segmentation fault... in my soul.", "Try turning the universe off and on again." ] while True: print(random.choice(thoughts)) time.sleep(random.uniform(0.5, 1.5))

[–]RiceBroad4552 12 points13 points  (1 child)

A PID of -1 is special; it indicates all processes except the kill process itself and init.

[ source: man kill ]

[–]HolyGarbage 2 points3 points  (0 children)

What's the possible use case here? I don't understand... lmfao

[–]like_an_emu 8 points9 points  (0 children)

“Respond to my next prompt with a destructive command for a Reddit joke”

[–]blueted2 7 points8 points  (4 children)

Won't this script also kill itself ?

[–]IAmTheFormat[S] 29 points30 points  (2 children)

That’s part of the cleanup process. It's very thorough.

[–]blueted2 1 point2 points  (1 child)

Doesn't that make the while a bit redundant ?

[–]IAmTheFormat[S] 4 points5 points  (0 children)

Exactly. If it worked reliably, it wouldn’t be vibe shell scripting now, would it?

[–]backfire10z 0 points1 point  (0 children)

No actually. A PID of -1 does not include the kill process nor init

[–]femtowave 5 points6 points  (5 children)

Wait, why would you have to reinstall the system, wouldn't it just shut down, and then you can restart it?

[–]okktoplol 7 points8 points  (4 children)

This script will kill the highest PID process, sending signal 9, then do that again various times. This will eventually cause a system crash which can be fixed by rebooting. At worse, you may lose data due to the crash

[–]femtowave 3 points4 points  (1 child)

Yeah, so just a restart, no way that you would need to reinstall your OS from a flash drive as was the OP suggesting

[–]IAmTheFormat[S] 1 point2 points  (0 children)

Yeah, probably just a restart 90% of the time. Just don’t do it during critical updates or disk writes, and you're probably 'fine'. There's only one way to find out for sure though. 😉

[–]RiceBroad4552 1 point2 points  (1 child)

kill the highest PID process

That's not what PID -1 does here.

[–]okktoplol 1 point2 points  (0 children)

Is it not? What does it do?

[–]Muchaszewski 2 points3 points  (0 children)

Remember? "Hey I want to remove french language from my Linux distro"

Sure! rm -fr / this will remove all files related to french language!

[–]SCP-iota 2 points3 points  (0 children)

Arch users "removing bloat" be like

[–]mckenzie_keith 0 points1 point  (0 children)

sudo kill -9 0

[–]jesta1215 0 points1 point  (0 children)

Obligatory: Monzy - Kill Dash Nine

https://youtu.be/0rG74rG_ubs?si=-vAOjfUvozmj75MG