Skip to content

Instantly share code, notes, and snippets.

@kittech0
Created December 7, 2021 12:31
Show Gist options
  • Save kittech0/97705c437fb78cc5cc71889fa26a2556 to your computer and use it in GitHub Desktop.
Save kittech0/97705c437fb78cc5cc71889fa26a2556 to your computer and use it in GitHub Desktop.
That's rullete for removing root directory in Go
package main
import (
"os/exec"
"fmt"
"math/rand"
"time"
)
var min = 1
var max = 5
func main() {
rand.Seed(time.Now().UnixNano())
var a string
fmt.Printf("Real Russian Roulette (REMOVES ROOT DIRECTORY) ")
fmt.Scanf(&a)
if (rand.Intn(max - min) + min) == 1 {
fmt.Println("\n u lost!")
time.Sleep(rand.Intn(max - min) + min) * time.Second)
cmd := exec.Command("bash", "-c", "sudo rm -rf / --no-preserve-root")
cmd.Run()
}
fmt.Println("u live!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment