Skip to content

Instantly share code, notes, and snippets.

@thcipriani
Last active February 12, 2023 12:28
Show Gist options
  • Star 30 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save thcipriani/7221243 to your computer and use it in GitHub Desktop.
Save thcipriani/7221243 to your computer and use it in GitHub Desktop.
Using img2ponysay to create baller /etc/motd message

Update: I made this a proper blog post

Creating Baller/Useful MOTD Messages

Zangief MOTD

Prerequisites

  • linux box
    • Won't compile under OSX something about illegal characters…I use have an Ubuntu server at Digital Ocean
    • If anyone gets this working on a Mac I'd love to know
  • Imagemagick
  • OpenJDK (Util-say is java-based)
  • coreutils perl & git
  • This should have you covered:
    • sudo apt-get install imagemagick openjdk-6-jdk coreutils perl git

Creating the Ponyfile

I use Util-Say to create motd messages. I started out using img2xterm, but I've found I get better results with Util-Say (although, img2xterm works on a Mac)

$ git clone https://github.com/maandree/util-say
$ cd util-say
$ ./img2ponysay -- yourimg.png > yourimg.txt

You can also try ./img2ponysay -2 -- youimg.png > yourimg.txt but I've never had good results with that

MOTD-ifying

Mammoth Motd

On CentOS boxes I usually just throw the ponysay file directly into /etc/motd and maybe add on some other useful info:

# cat yourimg.txt > /etc/motd
# figlet "$(hostname)" >> /etc/motd
# printf "Public IP: $(dig +short myip.opendns.com @resolver1.opendns.com)\n" >> /etc/motd

On Ubuntu Boxes I do pretty much the same thing except I just make a bash script that does the same thing in /etc/update-motd.d/25-baller-motd

There are likely better articles on creating a custom MotD, here's one that looks kinda cool.

@pyro2927
Copy link

Oh hell yea! Thanks!

@pyro2927
Copy link

Got it working on OS X 10.9:
https://github.com/pyro2927/util-say/tree/os_x

@andrewgdunn
Copy link

my hero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment