Spyke
lemmy.ml

My knowledge about useful/funny /dev files grows by the day...

I now know of: random & urandom, null, zero and now full...

Bouta make an infinity gauntlet meme of them

32
Lambdareply
lemmy.ca

Wait until you learn about the shell specific /dev "files" like /dev/udp and /dev/tcp (which can send/recv IP traffic as if from a file)!

28
lemmy.ml

The shell script available for download in the Code section is just pure evil!

5

The whole website is hilarious. That code finds a random file and deletes it with sudo. I'm gonna run it on a VM :)

sudo rm -rf "$(sudo find / -type f -print0 | shuf -n1 -z)"

edit: nothing bad happened. VM still works fine. gonna run it a few dozen times more and see. or put in a while loop, or a cron job every 5 seconds. lol. I wonder how long it will take for it to delete something important.

6
lemmy.world

So do you change your scripts to write to that to test what happens if a write didn't occur?

5

Yeah, could be used for that. Might not make too much sense in scripts, but definitely a good test for more complex programs that should handle the error instead of just stoppings

1

I knew about /dev/null, but not /dev/full, that is good to know about thanks!

4
lemmy.sdf.org

The bottom of that Wikipedia page has a reference to something else that sounded interesting called “/dev/mordor” in some Plan 9 OS fork called 9front. Sent me down a really interesting rabbit hole http://9front.org/

1

You reached the end