Monday, January 28, 2008

Make fortune files from the whatis database in FreeBSD

Fortune is a neat way to help learn bits of information so why not turn the whatis database into a fortune file to help discover some of the less used FreeBSD commands (or any other section of the man pages)?

If the whatis database does not exist run "makewhatis" as root, or if you don't have root access run "makewhatis -o whatis" to make your own personal copy. You also need the games distribution files installed.

Ok let's make fortunes...

To make the whole whatis database into a fortune file:

$ cat /usr/share/man/whatis | sed 's/$/\
\%/g' > whatis-fortune

$ /usr/games/strfile whatis-fortune whatis-fortune.dat


[Note that the sed command is split over two lines, type it exactly as shown.]

To make just one man section into a fortune file, section 1 in this example:

$ cat /usr/share/man/whatis | egrep "^.+\(1\) +- " | sed 's/$/\
\%/g' > whatis1-fortune

$ /usr/games/strfile whatis1-fortune whatis1-fortune.dat


Naturally substitute 1 with any man section number to make a different fortune file.

Test it with "fortune whatis1-fortune".

If everything is happy you can put it in your .profile (under the freebsd-tips fortune line of course) with the full path to the fortune files if you didn't put them in /usr/share/games/fortune.

Sunday, January 27, 2008

Why mead is an excellent choice for the casual brewer

Ok, I'll tell you how to brew some mead.

Throw one part honey, three parts water into a large vessel you can heat up. Pasteurise the mixture for about 15 minutes, cool it, throw in some yeast, then tip it into a carboy, whack on a bung with an airlock and leave it for a few months, racking once or twice if you wish.

That's the gist of it.

I won't go into details, but there is much more you can do with making mead. I just wanted to point out that it's one of the easiest things to brew from original ingredients.

I guess I just like simple and elegant.