Created
December 7, 2021 12:31
-
-
Save kittech0/97705c437fb78cc5cc71889fa26a2556 to your computer and use it in GitHub Desktop.
That's rullete for removing root directory in Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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