EDIT: 2017-01-08

Igor Rzegocki has a project that uses the same technique outlined here to make some incredible ready-made Street FIghter MotDs – it is really cool, and if you are interested in abusing ansi escape sequences to make MotDs you should check it out :)

Zangief MOtD
Zangief MOtD

Everyone universally agrees that most Message of the Days (MOTDs) are stupid and suck. By the end of reading this post, your mind grapes should be swollen with the knowledge of how to make an MOTD that isn’t stupid and, some would say, doesn’t suck.

Prerequisites

  • Imagemagick
  • OpenJDK
  • coreutils
  • perl
  • git

This should have you covered:

$ sudo apt-get install imagemagick openjdk-6-jdk coreutils perl git

Creating the Util-say file

I use Util-Say to create motd messages. I started out using img2xterm, but I’ve found I get better results with Util-Say.

$ 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
Mammoth Motd

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

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

On Ubuntu Boxes (since they use update-motd(1)), I do pretty much the same thing except I just make a bash script in /etc/update-motd.d/25-baller-motd

1
2
3
4
5
#!/usr/bin/env bash
cat yourimg.txt
figlet "$(hostname)"
printf "Public IP: $(dig +short myip.opendns.com @resolver1.opendns.com)\n"
command -v fortune &> /dev/null && fortune

There are likely better articles on creating a useful MOTD, (here’s one that looks kinda cool) but there are exactly none-better articles on creating MOTDs that are so flossy!