Skip to content

Instantly share code, notes, and snippets.

@dcai
Last active April 25, 2020 03:07
Show Gist options
  • Save dcai/8c480876b9da9dff2488f10537f7ffbc to your computer and use it in GitHub Desktop.
Save dcai/8c480876b9da9dff2488f10537f7ffbc to your computer and use it in GitHub Desktop.
motd: welcome.py
#!/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