9 ms·
Suicide Linux
- Bromskloss 9y ago> 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 9y agoThere'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-Builtin.html https://www.gnu.org/software/bash/manual/html_node/The-Shopt...)
- dfc 9y agoThat's for `cd smoedir` I am not aware of what would do `./smoeexec`
- bobbyi_settv 9y agoIt's an interesting idea, but is made mostly irrelevant by tab completion.
- ihaveajob 9y agoI 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 9y agoI'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.
- Jedd 9y ago> What? No, what's that about? From TFA: "Update 2015-04-18 -- I suppose I should finally clear this up: The autocorrect functionality I originally described here was a feature of the first Linux systems I ever used, so I assumed it was how every Linux system worked by default. Since then I've come to understand that it's a completely optional extra doodad."
- pierrec 9y agoYeah, I'm not aware of any distro that has this setting enabled by default. It's neat that it exists, though.
- nitrogen 9y agoDistros in the late 90s were a lot more adventurous in their defaults as I recall.
- z3t4 9y agoGood to have snapshots (zfs) that you can go back to after a screw-up.
- marcosdumay 9y agoJust pray that the snapshot restoring program wasn't gone.
- sova 9y agoComputers 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.
- siegelzero 9y agoReminds me of bash roulette. http://www.bash.org/?96164 http://www.bash.org/?96164
- Ajedi32 9y agoAlso in comic strip form: http://www.commitstrip.com/en/2014/05/16/russian-roulette/ http://www.commitstrip.com/en/2014/05/16/russian-roulette/
- Retr0spectrum 9y agoThat also reminds me of something similar, where a random offset in /dev/mem is clobbered. What potentially makes it more amusing is that it would probably just crash your machine, rather than completely destroy it.
- SAI_Peregrinus 9y agoHe seems to have forgotten the --no-preserve-root flag.
- diamondo25 9y agoThis was made before they added that flag :)
- b3lvedere 9y agoA bit too unforgiving for my taste :) To err is .. destruction!
- tekstar 9y agoa less destructive version of this is to install `sl` on your linux or mac.
- KGIII 9y agoThat gets installed right after cowsay. I have my priorities.
- isostatic 9y agoI never type sl, but often type "gerp". I have an alias though.
- noir_lord 9y agofor me it's "date" and "data" since I type both of those quite a lot (I don't have a clock on my desktop, I just use date when I need to know the time, I find a clock distracting because I get that "well it's 27 minutes til that meeting, never getting in the the zone in that time, better check HN" thing).
- vacri 9y agoI frequently try to "isntall" things...
- moses-palmer 9y agoA 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`...
- sp332 9y agoThis reminds me of Vigil, "the eternal morally vigilant programming language" https://github.com/munificent/vigil https://github.com/munificent/vigil
- warent 9y agoFirst I've heard of this. Finally a keyword to beseech my needs!
- hyperpallium 9y agoShouldn't the programmer also be punished? I find flagellation by static type errors unsatisfying.
- kakarot 9y agoWhat a great read. Thank you.
- omginternets 9y agoDeus vult!
- kingvash 9y agoI'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 9y agoMan, I hope you don't use grep very often (by default it uses exit code 1 when it doesn't find anything).
- mortehu 9y agoJust pipe the output through cat. By default, the "pipefail" option is not set, so echo foo | grep bar | cat is successful. Of course, this works for any command.
- function_seven 9y agoIf it didn't exist in the first place, then you had no business searching for it. You should have just known not to look. :)
- 9y ago
- anfractuosity 9y agoHaha, 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)
- rocqua 9y agoAs far as I know, it can recurse down and get to more files than you want. The alternative is that the last time I ran that command, it was actually on an account with write rights to the root dir.
- sp332 9y agoIn 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.
- abtinf 9y agoPerhaps a better name would be Roguelike Linux.
- gumby 9y agobash 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)?
- agumonkey 9y agonot enough, I want a 5 seconds timer on every new attempted input line. You either type something or you don't.
- rcthompson 9y agoIs this the digital equivalent of corporal punishment?
- Bromskloss 9y agoAh, 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
- ryanpcmcquen 9y agoWhat a fun OS!
- lloeki 9y ago> 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")
- inamberclad 9y agoDoes that last one come from here? http://www.toodarkpark.org/computers/humor/shoot-self-in-foot.html http://www.toodarkpark.org/computers/humor/shoot-self-in-foo...
- lloeki 9y agoNope, real life occurrence. A variant includes mashing Enter on a valid rm line but on AZERTY keyboards that may mean fat fingering the nearby asterisk key.
- legohead 9y agoA friend and I were working on a codebase and he did a similar typo: rm *>o <-- kept shift held down while he pressed period Been using "make clean" ever since.
- FeepingCreature 9y agogit clean -fixd
- peckrob 9y agoA 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/
- deleted 9y ago[deleted]
- johnvonneumann 9y agoMy team is considering running this in Production. Do you offer support contracts?
- RoutinePlayer 9y agoI just wasted 2 minutes of my life reading this.
- aquamo 9y ago1) 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? :-)
- PascLeRasc 9y agoShouldn't this be more accurately called Seppuku Linux?
- bmiller2 9y agoIn 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.
- kbenson 9y agoJust 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 9y agoDon'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 9y agoVisiting that page on mobile asked for permission to record audio and take photos...
- kbenson 9y agoI 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.
- andrewflnr 9y agoThat's probably just a bad ad. That has never happened to me there. Sorry, though.
- cryptonector 9y agoOn 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 9y agoThat'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 9y agoProtecting 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 9y agoIndeed 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.
- Tepix 9y agoIf you work interactively you can use tab completion which takes care of most typos. That's something you don't have in scripts.
- earenndil 9y agorm -rf /* ?
- stevefan1999 9y agoWe should call it Russian Linux: just like how you would like to play a Russian Roulette.
- Viper007Bond 9y agoA 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
- odammit 9y agoThis 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
- htfy96 9y agoIt 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 9y agoSo it just always writes a program that does `system(rm -rf /)`?
- blackflame7000 9y agoSome like to learn by the stick, while others by carrot. And some like to learn with a grenade.
- deleted 9y ago[deleted]
- ocschwar 9y agoTHis is not nearly as hard corre as it would have been in the days before Xen.
- waterhouse 9y agoIn 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.
- red75prime 9y agoDocker image? It completely defeats the thrill.
- mar77i 9y agoOne 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.
- hsnewman 9y agoIs this a package or a true operating system distro?
- Sam_Harris 9y ago"You know how sometimes if you mistype a filename in Bash, it corrects your spelling and runs the command anyway?". No, never, on any system ever.