Crossposted from https://lemmy.world/post/49163864

CommitStrip | website

Transcript7 panel comic

1: [2 guys, both in fur lined coats, one wearing a fur-lined hat, the other with crazy hair, sit in circular booth in a rundown bar. 2 empty shot glasses and a bottle are visible on the table.]

Hat: Stop it, you’re crazy! This isn’t you talking, it’s the vodka!

Hair: Leave it…

2: [The two men are sitting across from a third man in a similar fur-line coat and hat, but glasses and a beard. A laptop sits in front of the bearded man.]

Beard: It’s not a game for cowards…

3: [Hair pulls the laptop towards him. Hat looks worried]

Hair: Come on, gimme that and let’s get it over with!

4: [Hair has a crazy and excited look on his face]

Hair: Each one on his own prod server?

Beard: Each one on his own prod server.

5: [Close up of Hats finger clicking the touch pad]

6: [Close up of the sweat dripping down Hats face]

7: [A terminal is open on the laptop screen] Laptop reads: root@server:~# [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “Lucky boy”;

top 13 comments

sorted by: hot top controversial new old
[–] 30 points 4 months ago

There's a chance you'll end up with a more efficient system!

  • source
  • [–] 27 points 4 months ago (7 children)

    This is actually safe to run, as --no-preserve-root is missing

  • source
  • hideshow 7 child comments
  • [–] 7 points 4 months ago (5 children)

    Doubt deleting everything but root is safe on a production server.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 14 points 4 months ago (3 children)

    It won't delete anything at all

  • source
  • parent
  • hideshow 3 child comments
  • [–] 4 points 4 months ago (2 children)

    Oh, checked the manual. Cool, did not know that.

    I guess then it should be rm -rf /srv/

  • source
  • parent
  • hideshow 2 child comments
  • [–] 15 points 4 months ago* (last edited 4 months ago)

    That'd probably rattle some managers' cages, yes.

    Alternatively, a combination of find /, rand, xarg, and rm could also be fun; delete something random, and pray it was just a readme file

  • source
  • parent
  • [–] 24 points 4 months ago

    More accurate nowadays:

    "Hey Claude my prod server is slow. Here are the credentials. Fix pls /yolo"

  • source
  • [–] 8 points 4 months ago

    As $RANDOM returns 0 to 32767, chance of the command running is not 1 to 5, but 1 to 5.00018311665.

  • source
  • [–] 4 points 4 months ago

    This isn't funny but it did make me add a line to my .bash_aliases

  • source
  • [–] 4 points 4 months ago

    When you get laid off, celebrate playing this game. Ensure to practice a few hundred times in order to make sure you win.

  • source
  • 27 comments in c/comicstrips@lemmy.world view that post
    [–] 102 points 4 months ago* (10 children)
  • [–] 117 points 4 months ago (6 children)

    And also a short delay before printing 'lucky boy' so you can't tell if it's deleting everything or if it's the built in delay.

  • source
  • parent
  • hideshow 6 child comments
  • [–] 14 points 4 months ago (4 children)

    Oh I do remember that sickening feeling when an rm doesn't come back immediately –_—

  • source
  • parent
  • hideshow 4 child comments
  • [–] 7 points 4 months ago* (3 children)

    I still remember when I managed to rm -rf / foo (I accidentally typed a space between / and foo) on my very early linux box on the 90s. 80486, 16 mb

    I pressed enter. Saw what I did. Remembered that sync ran at every 30s* Pressed the power button.

    *= those were simple times, but not better times

    So I rm -rf ed my root fs and my box survived it due to the quick power off.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 4 months ago (2 children)

    What's sync? I got into linux quite a bit later. So you mean like an incremental rsync backup? Whatever it was, it sounds like it saved you.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 4 months ago* (1 child)

    it was an old mechanism in Unix & Linux that flushed "disk writes" to disk. Writes would normally go to the buffer cache in ram and a process called "sync" every 30s to flush out writes to disk. (writing out EVERY change would result in a lot of redundant writes and be very slow, so this was a very simple kind of collecting work until it makes sense to really do it)

    We still write async writes to ram first and then write them to disk later, the mechanism is much more advanced nowadays - and also quicker to start writing.

    Still, on the shell there's a command called sync which invokes the system call, asking the kernel to flush out all asynchronous writtes.

    (And yes, there's more than async writes, used by databases for example, but that would require a lot more of explanations)

  • source
  • parent
  • hideshow 1 child comment
  • [–] 9 points 4 months ago* (last edited 4 months ago) (2 children)

    On modern Linux system yes but old Unix servers (or even recent?) would run it no problem

    Edit: It was initally introduced by sun microsystems in 2005 and was later adopted by GNU

    Sun Microsystem didn't introduce it in 2005, rather it simply disallowed rm -rf / altogether

    Later GNU introduced --preserve-root and after that made --preserve-root the default and added --no-preserve-root https://en.wikipedia.org/wiki/Rm_(Unix)

  • source
  • parent
  • hideshow 2 child comments
  • [–] 53 points 4 months ago (6 children)

    Can someone help and explain this to little old me?

  • source
  • hideshow 6 child comments
  • [–] 51 points 4 months ago (2 children)

    It's a bash command that generates a random number. If that number divides by six with no remainder then it deletes everything on the server, if not it prints "lucky boy". "Prod" servers are production servers, the ones the actual business runs on, as opposed to test or dev servers which are often deleted and rebuilt as developers to see if things work or not.

    This is Russian roulette for IT people to see if they destroy the running server or not

  • source
  • parent
  • hideshow 2 child comments
  • [–] 26 points 4 months ago* (last edited 4 months ago)

    generates a random number. If that number divides by six with no remainder

    Meaning a 1 in 6 chance, just like playing traditional Russian roulette with a revolver

    EDIT: For fun, here is a Russian roulette bash script that doesn't actually do anything other than simply print pass or fail with a 1 in 6 chance:

    [ $[ $RANDOM % 6 ] == 0 ] && echo fail || echo pass;
    
  • source
  • parent
  • [–] 10 points 4 months ago (2 children)

    They're basically playing Russian Roulette with their servers. They condition a remove all command on a random numbers generator and pray. If it does not wipe the server, it spits out "Lucky Boy"

  • source
  • parent
  • hideshow 2 child comments
  • [–] 30 points 4 months ago

    The modulo devisor should reduce by one every time it’s run

  • source
  • [–] 28 points 4 months ago (3 children)
    1. I'd hope that one's production server is backed up.

    2. $ alias rm="echo Lucky boy"; clear

      "Okay, ready to play."

  • source
  • hideshow 3 child comments
  • [–] 4 points 4 months ago
    [–] 5 points 4 months ago

    lol I disable this and root access first thing

  • source
  • [–] 2 points 4 months ago (1 child)