
Suicide Linux - cgtyoder
https://qntm.org/suicide
======
kingvash
I've added a counter (of successful commands in a row) to my bashrc. I've seen
it as high as 120.

    
    
      function promptCommand()
      {
        LAST_STATUS=$?
        # Set title of window to dir, then add new line to prompt.
        PS1='\[\e]0;\w\a\]\n'
        if [ $LAST_STATUS -eq 0 ]; then
          ((successes++))
          PS1+='\[\033[1;32m\][$successes]'
        else
          successes=0
          PS1+='\[\033[1;31m\][0 $LAST_STATUS]'
        fi  
        PS1+='\[\033[0;32m\] '
        PS1+='\w $(date +%H:%M) \$ \[\033[0m\]'
      }
    
      lastStatus=0
      successes=-1
      PROMPT_COMMAND="promptCommand"
    

My prompt:

    
    
      [0] /home/bar/g3 14:19 $ echo "boo"
      boo
    
      [1] /home/bar/g3 14:19 $

~~~
kedean
Man, I hope you don't use grep very often (by default it uses exit code 1 when
it doesn't find anything).

~~~
omginternets
>grep

Not to mention tar which is just impossible to get right on the first try.

~~~
Yizahi
Especially when disarming a nuke

~~~
nobodyorother
Nuke-practice is why I only use tar these days.

------
sp332
This reminds me of Vigil, "the eternal morally vigilant programming language"
[https://github.com/munificent/vigil](https://github.com/munificent/vigil)

~~~
hyperpallium
Shouldn't the _programmer_ also be punished? I find flagellation by static
type errors unsatisfying.

------
lloeki
> The reaction from the OS is actually rather underwhelming.

Somehow related, a coworker at a previous place unmounted some disks on an old
AIX production box. It took him a solid minute to realise he had mistakenly
unmounted / due to a typo (yes it was possible) as old processes with already
opened files were happily serving stuff and only new attempts at opening files
were beginning to produce errors.

Also, a similar interactive mishap in the heat of the action:

    
    
        somebox:~$ rm * .o
        rm: .o: No such file or directory
        somebox:~$ # ...
        somebox:~$ # *stares a prompt*
        somebox:~$ # Wait, what? _Please_ tell me those C files were versioned! (The answer was, obviously, "no")

~~~
peckrob
A few months back I was wiping some old drives using a USB->SATA adapter
plugged into an old Linux machine I keep around for experimenting on random
things. Mostly because I could just leave it to run for however long it took.
There were two drives in the machine, sda and sdb. So the drive came up as
sdc.

So then I typed:

$ shred -n1 -v /dev/sda

Took me about 4 seconds to realize what I did before hitting Ctrl-C.

Then, I sighed. Considered whether I could save anything. Realized there
wasn't anything on there worth saving, and reinstalled. :)

I'm usually much more cautious than that and I'm thankful it happened on a
dumb test machine at home and not something important, but it was still a
bummer and my first real sysadmin-type screw up. Mistakes happen, though. Even
Linus once dialed his hard drive [0].

[0] [https://liw.fi/linux-anecdotes/](https://liw.fi/linux-anecdotes/)

~~~
tscs37
Stuff like this is why I usually double check and only access disk by anything
but the /dev/sdx or /dev/hdx labels; too easy to blow up in your face.

------
cryptonector
On Illumos rm -rf / does nothing. POSIX says that removing / has undefined
behavior, so the obviously smart (useful, user-friendly, GOOD) thing to do is
to do nothing, as that fits "undefined behavior".

~~~
lomnakkus
That's quite funny... but ultimately futile. It doesn't say what happens if
you say "DROP TABLE xyz<ENTER>WHERE...ohshit". (The <ENTER> bit is because
you're used to doing that in your preferred SQL-DB editor.)

One should _NEVER_ do anything non-scripted on a production system. ALWAYS
enter it into a file and then do the "run-sql-from-a-file" command.

EDIT: Yes, I also realize that "rm -rf /" can theoretically happen if you have
a bad variable substitution, but you _MUST_ turn on the flags that cause your
shell to error out instead of just substituting the empty string.

~~~
cryptonector
Protecting against every damned footgun is not possible. But some footguns
blow users' feet off so often (this one because shell scripting is _so_ tricky
and dangerous) that it's est to do something about it.

~~~
lomnakkus
Indeed not, but just having the extra step of "write this into a file" (and
perhaps have someone look it over) catches most of those _really_ bad
mistakes.

It's really about NOT getting into the habit of "just fix it in production".
That way lies madness.

------
siegelzero
Reminds me of bash roulette.
[http://www.bash.org/?96164](http://www.bash.org/?96164)

~~~
Ajedi32
Also in comic strip form: [http://www.commitstrip.com/en/2014/05/16/russian-
roulette/](http://www.commitstrip.com/en/2014/05/16/russian-roulette/)

------
Bromskloss
> You know how sometimes if you mistype a filename in Bash, it corrects your
> spelling and runs the command anyway?

What? No, what's that about?

~~~
atdt
There's the cdspell shopt: "If set, minor errors in the spelling of a
directory component in a cd command will be corrected. The errors checked for
are transposed characters, a missing character, and a character too many. If a
correction is found, the corrected path is printed, and the command proceeds."
([https://www.gnu.org/software/bash/manual/html_node/The-
Shopt...](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-
Builtin.html))

~~~
bobbyi_settv
It's an interesting idea, but is made mostly irrelevant by tab completion.

~~~
ihaveajob
I knew a guy who aliased all permutations of 'make' (maek, mkae, amke...) to
'make', so he just hammer the keys at once and be sure the thing would run.

~~~
knodi123
I've had to do this with grep, gerp gpre gper. I've determined that I'm just
constitutionally incapable of typing that word more than 2 in 3 times, and
I've learned to cope with my disability.

------
kbenson
Just have to mention, since I recognize the domain, that Sam Hughes has some
excellent science fiction freely available in a serialized form here as well.
Well worth investigating.

~~~
andrewflnr
Don't miss his work at SCP wiki, either. [http://www.scp-wiki.net/qntm-s-
author-page](http://www.scp-wiki.net/qntm-s-author-page)

~~~
x1798DE
Visiting that page on mobile asked for permission to record audio and take
photos...

~~~
kbenson
I didn't get any such request in chrome on android. Then again, that's the
kind of site with the kind of subject matter to randomly request access every
nth page just for the reaction it evokes.

------
odammit
This is funny. I think I’ll stick with “thefuck” [1] though.

It would make a good prank to set up on someone that left their machine
unlocked. Not sure if it’s more funny than changing their background to
goatse.

[1] [https://github.com/nvbn/thefuck](https://github.com/nvbn/thefuck)

------
bmiller2
In all seriousness, what if it's a machine that no one should ever really be
running commands on? This could be an effective, albeit naive, way to
discourage undesirables in the system.

~~~
DKnoll
That is the most absurd approach to access control I have ever heard... but I
like it.

------
sova
Computers already demand a level of precision that is hard for biological
lifeforms to conform to. Now this. Not sure if I should laugh or cry.

------
abtinf
Perhaps a better name would be Roguelike Linux.

------
tekstar
a less destructive version of this is to install `sl` on your linux or mac.

~~~
isostatic
I never type sl, but often type "gerp". I have an alias though.

~~~
moses-palmer
A friend of mine aliased `git status` `git statsu`; I, being lazier, chose
`git st`. Any time saved I lost by not copying his other alias, `c = commit
-amSTUFF`...

~~~
Someone
I must be lazier. I use `gitst` for `git status`. That is 1/6 shorter and IMO
not harder to remember.

~~~
akx

        ~ $ abbr | grep git | sort
        abbr af 'git kit autofixup'
        abbr amend 'git commit --amend'
        abbr fixup 'git commit --fixup'
        abbr gb 'git branch'
        abbr gcan 'git commit --amend --no-edit'
        abbr gcm 'git commit -m'
        abbr gco 'git checkout'
        abbr gcop 'git checkout -p'
        abbr gfa 'git fetch --all -p'
        abbr gkdm 'git kit del_merged'
        abbr gl 'git log --oneline --color --decorate -n20 --graph'
        abbr gp 'git pull --ff-only --all -p'
        abbr gph 'git push -u origin HEAD'
        abbr gre 'git rebase'
        abbr grec 'git rebase --continue'
        abbr grem 'git rebase -i master'
        abbr greom 'git rebase -i origin/master'
        abbr greum 'git rebase -i upstream/master'
        abbr gs 'git status'
        abbr gxa 'gitx --all'
        abbr namend 'git commit --amend --no-edit'

------
htfy96
It would be nice for someone to develop a suicide-g++. Whenever you compile a
program that results in Undefined Behavior, the execution of it will wipe your
disk.

~~~
majewsky
So it just always writes a program that does `system(rm -rf /)`?

------
Viper007Bond
A good read about recovering a system that had rm -rf * run on it:

[http://www.ee.ryerson.ca:8080/~elf/hack/recovery.html](http://www.ee.ryerson.ca:8080/~elf/hack/recovery.html)

------
johnvonneumann
My team is considering running this in Production. Do you offer support
contracts?

------
gumby
bash corrects your spelling?? Is this a cute way of saying "I made a typo that
turned out to be a legit command" or is there some DWIM I don't know about
(and thankfully don't have enabled)?

------
waterhouse
In the video, the banner the shell displays says:

    
    
      =========================================================
      WARNING: Suicide Linx installed
               (http://sourceforge.net/projects/suicide-linux/)
      =========================================================
    

I'm wondering if the typo is a subtle joke.

------
stevefan1999
We should call it Russian Linux: just like how you would like to play a
Russian Roulette.

------
Bromskloss
Ah, that video! The good old days of Ubuntu! I just installed 17.10. :-(

Edit: The video in question:
[https://www.youtube.com/watch?v=Q_pgnMWgd34](https://www.youtube.com/watch?v=Q_pgnMWgd34)

------
mar77i
One idea I like is randomly flipping a bit on the root partition every day or
so. You'll have to take an incredibly long time to find the problem, of which
there will be one eventually.

------
blackflame7000
Some like to learn by the stick, while others by carrot. And some like to
learn with a grenade.

------
anfractuosity
Haha, how can it do that out of interest, if you're not root? (As aren't the
top level directories in / owned by root?, or does it work anyway, if rm can
recurse down? deleting files from the current user)

~~~
sp332
In the video he says that you need to be root when you make the typo. But
since you have to be root when you install the package, you could plant a suid
binary or even leave a service running as root that deletes all your files
later.

------
b3lvedere
A bit too unforgiving for my taste :) To err is .. destruction!

------
PascLeRasc
Shouldn't this be more accurately called Seppuku Linux?

------
SAI_Peregrinus
He seems to have forgotten the --no-preserve-root flag.

~~~
diamondo25
This was made before they added that flag :)

------
agumonkey
not enough, I want a 5 seconds timer on every new attempted input line. You
either type something or you don't.

------
ocschwar
THis is not nearly as hard corre as it would have been in the days before Xen.

------
z3t4
Good to have snapshots (zfs) that you can go back to after a screw-up.

~~~
marcosdumay
Just pray that the snapshot restoring program wasn't gone.

------
rcthompson
Is this the digital equivalent of corporal punishment?

------
hsnewman
Is this a package or a true operating system distro?

------
RoutinePlayer
I just wasted 2 minutes of my life reading this.

------
red75prime
Docker image? It completely defeats the thrill.

------
aquamo
1) death by accident (or rm -rf'ing) is not suicide 2) has the bar been
lowered that much now? a simple bash configuration makes a new O/S or
distribution?

:-)

------
ryanpcmcquen
What a fun OS!

