Last active
April 25, 2020 03:07
-
-
Save dcai/8c480876b9da9dff2488f10537f7ffbc to your computer and use it in GitHub Desktop.
motd: welcome.py
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
#!/usr/bin/env python | |
import random, subprocess, socket | |
hostname = socket.gethostname() | |
animals = ( | |
"beavis.zen", | |
"bong", | |
"bud-frogs", | |
"bunny", | |
"cheese", | |
"daemon", | |
"default", | |
"dragon", | |
"dragon-and-cow", | |
"elephant", | |
"eyes", | |
"flaming-sheep", | |
"ghostbusters", | |
"kitty", | |
"koala", | |
"luke-koala", | |
"meow", | |
"milk", | |
"moofasa", | |
"moose", | |
"mutilated", | |
"ren", | |
"sheep", | |
"skeleton", | |
"stegosaurus", | |
"stimpy", | |
"three-eyes", | |
"turkey", | |
"turtle", | |
"tux", | |
"vader", | |
"vader-koala", | |
"www") | |
animal = random.choice(animals) | |
subprocess.call(["/usr/games/cowsay", "-f", animal, "Welcome, you are on host %s" % hostname]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment