I don’t know what it is about simple characters in a terminal that keeps me so enthralled, but it always has. Just recently I was setting up several new machines and doing alot of administrative type duties, checking log files, testing cronjobs for remote backups, etc… One of my favorite thigns to do right away is change the default /etc/motd to reflect the hostname for each system I’m working on. It’s the kind of thing that is completely unnecessary and yet I do it every time.
Now I’m not going to manually edit each file on each machine to have some fancy individual ascii art hostname. I don’t have time and that’s not the point, especially when there’s plenty of utilities that will do it for me. These should all be available in your distros repositories as they’ve been around for some time.
Figlet:
The best one for this job is FIGlet, but then again, that depends on your preference. From the home page: “FIGlet is a program for making large letters out of ordinary text”. So a simple command like:
figlet -f smslant -S megatron | sudo tee -a /etc/motd
Will append this to your /etc/motd
__
__ _ ___ ___ ____ _/ /________ ___
/ ' \/ -_) _ `/ _ `/ __/ __/ _ \/ _ \
/_/_/_/\__/\_, /\_,_/\__/_/ \___/_//_/
/___/
Nice and easy. -f decides what font to use. Typically on most *nix-en these will be in /usr/share/figlet/, but the basics are: banner, big, block, bubble, digital, ivrit, lean, mini, mnemonic, script, shadow, slant, small, smscript, smshadow, smslant, standard and term but there are others. There are lots of other options for FIGlet, so read the man page.
Boxes:
Boxes is a utility designed to be called from within your editor and works really well to comment out blocks of code. It can also be used to generate some basic ascii banners suitable for use in your /etc/motd
webframp@megatron$ boxes -d nuke -a hcvc megatron ^D
_ ._ _ , _ ._
(_ ' ( ` )_ .__)
( ( ( ) `) ) _)
(__ (_ (_ . _) _) ,__)
`~~`\ ' . /`~~`
,::: ; ; :::,
':::::::::::::::'
_jgs______/_ __ \__________
| |
| megatron |
|___________________________|
Tada, a nice little mushroom cloud for your login message. ^D represents your EOL character, typically Control-D, but you knew that. Again see the man page for more options.
Cowsay/Cowthink:
Cowsay/cowthink is a configurable speaking/thinking cow. It can be used to make your message appear to come from a cow:
webframp@megatron$ cowsay megatron! ^D
___________
< megatron! >
-----------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
And the hillarity ensues. Cowthink will make it a thought bubble instead of a speech bubble. Cowsay can also be combined with boxes or figlet to make your cow say or think the output of those commands. More info is in the man page.
Do you use something else? Whats your preferred /etc/motd format?
Comments 1
Figlet is awesome, I can’t believe I didn’t know about it… time to spruce up my motds!
Posted 02 Oct 2009 at 9:43 pm ¶Post a Comment