Tips and Tricks For Hardworking Admins - Page 2

By Carla Schroder | Sep 27, 2005
Page 2 of 2   |  Back to Page 1
Print ArticleEmail Article
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn

Another way to deliver new MOTDs is to use the fortune program. Fortune has been around forever, and a bit of searching will find all sorts of different fortune databases, like BOFH excuses, fortune cookies, Top 100 things you don't want the sysadmin to say, Quotes from Murphy's laws, riddles, offensive fortunes, and literary quotations. Here is an example Debian installation and setup:

# apt-get install fortunes fortune-mod fortunes-bofh-excuses

Then start having fun. To see a list of all your installed fortune databases:

# /usr/games/fortune -f
100.00% /usr/share/games/fortunes
3.01% art
1.32% law
0.07% ascii-art
1.30% food
0.98% kids
0.98% love
2.19% linux
6.74% computers
1.49% startrek
2.75% wisdom
2.97% bofh-excuses
...

Let's try a couple of these:

$ /usr/games/fortune linux
Let's call it an accidental feature.
--Larry Wall

$ /usr/games/fortune startrek
"Can you imagine how life could be improved if we could do away with jealousy, greed, hate ..."

"It can also be improved by eliminating love, tenderness, sentiment -- the other side of the coin"
-- Dr. Roger Corby and Kirk, "What are Little Girls Made Of?", stardate 2712.4

To see a new, randomly-selected fortune every time you login or open a new shell, simply make an entry in ~/.bashrc, or in /etc/bash.bashrc to run it system wide, like this:

#run a new fortune randomly
/usr/games/fortune

You can easily create a custom fortune database. Create a plain text file with each fortune separated by a percent sign, like this homegrown admin-policies file:

Remember, today is the annual change-your-login password day! Make it eight to twelve characters long. Do not use dictionary words, names of animals or people, company or product name. Use a mix of letters, numbers, and punctuation marks. Write it down and keep it in a safe place! You know, like hidden!
-- Thank you, your faithful sysadmin deity

%
Today is Sysadmin Appreciation Day. Please deliver offerings of cookies, cake, and good strong coffee to my office.
-- Thank you, your faithful sysadmin deity

%
Remember to shut your workstations down at the end of the day! Don't be a watt-waster!
-- Thank you, your faithful sysadmin deity

Store this file in /usr/share/games/fortunes, and make it world-readable. Fortune does not read the file, but its associated .dat file. Create it with the strfile command:

# strfile admin-policies admin-policies.dat
"admin-policies.dat" created
There were 201 strings
Longest string: 1690 bytes
Shortest string: 43 bytes

To display fortunes from this file, simply run /usr/games/fortune admin-policies.

You may edit any existing fortune database, just remember to run the strfile command every time you make a change.

Come back next week for more excellent Tips and Tricks For Hardworking Admins.

Resources

Comment and Contribute
(Maximum characters: 1200). You have
characters left.
Get the Latest Scoop with Enterprise Networking Planet Newsletter
Helpful Links
  • Yankee Group Mobile WAN Optimization Report

    Mobile work continues to evolve. Your organization must keep up with the demands of its mobile workforce. This report introduces the concept of mobile WAN optimization and provides three case studies including RCM, PRTM and Einstein that highlight how this emerging technology can help IT departments achieve what previously appeared to be conflicting goals. Read >

  • Network Security Resources

    More threats than ever before pose a danger to today's enterprise network. Get the latest tips and intel on the newest risks in our guide to network security resources. Read >

  • Extreme Savings: Cutting Costs with WAN Optimization

    Did you know it's possible to cut IT costs without impacting day-to-day IT operations? In fact, when you download this whitepaper from Riverbed on cost-savings through WAN optimization, you'll discover how businesses of all different sizes have realized a return on investment in just a few months through significant hard cost savings in areas such as bandwidth reduction and IT consolidation. It's called Extreme Savings and its only from Riverbed. Read >