summaryrefslogtreecommitdiff
path: root/content/fortunes/fortune-cookies-HOWTO.html
diff options
context:
space:
mode:
Diffstat (limited to 'content/fortunes/fortune-cookies-HOWTO.html')
-rw-r--r--content/fortunes/fortune-cookies-HOWTO.html143
1 files changed, 143 insertions, 0 deletions
diff --git a/content/fortunes/fortune-cookies-HOWTO.html b/content/fortunes/fortune-cookies-HOWTO.html
new file mode 100644
index 0000000..d74a89e
--- /dev/null
+++ b/content/fortunes/fortune-cookies-HOWTO.html
@@ -0,0 +1,143 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
+ <TITLE>Fortune Mini-HOWTO (english)</TITLE>
+</HEAD>
+<BODY>
+<H1>Fortune Mini-HOWTO (english)</H1>
+
+<H2>Walter Harms </H2>Version 0.01, 19.05.2004
+<HR>
+<EM>How to use use fortune to generate cookies. </EM>
+<HR>
+<H2><A NAME="s1">1. Introduction</A></H2>
+
+<P>When a user logs into a system normally the /etc/motd is displayed. ( You can
+disable this by creating the file ~/.hushlogin.) You will be greeted
+by something like ''welcome to 127.0.0.1''. That is boring.</P>
+<P>Here comes ''fortune'' to the rescue. The package comes with 3 programs:
+fortune,strfile and unstr. </P>
+
+<H2><A NAME="s2">2. Usage of fortune, strfile and unstr</A></H2>
+
+<P>The programs have clear distinguished jobs: presentation, assembly and
+disassembly of the fortune databases. </P>
+
+<H2><A NAME="ss2.1">2.1 Fortune</A>
+</H2>
+
+<P>fortune is the presenter program. A simple application is to call the
+program in the crontab and modify the /etc/motd. e.g.:
+<HR>
+<PRE>
+ */10 * * * * /usr/bin/fortune >/etc/motd
+
+To select a given database with quotes simply add the database as argument.
+
+ */10 * * * * /usr/bin/fortune myquotes >/etc/motd
+</PRE>
+<HR>
+
+You can also specify more than one database file. Then fortune will consider
+both files equally often.
+<HR>
+<PRE>
+
+> fortune myquotes startrek
+</PRE>
+<HR>
+
+Some people like some quotes more than others. So your can manipulate the
+equilibrium by adding probabilities.
+<HR>
+<PRE>
+
+> fortune 90% myquotes 10% startrek
+</PRE>
+<HR>
+
+fortune has some additional command line switches but its beyond the
+scope of this document to explain them. check the man page instead.</P>
+
+<H2><A NAME="ss2.2">2.2 generating a fortune database</A>
+</H2>
+
+<P>Now we come to terms. Pick a list of quotes. There are several sources.
+Of cause the Internet will provide you with a long list. Choose quotes
+you like they will appear regularly now. Collect the quotes in one file.
+Every quote separated with a line containing a single % e.g.:
+<HR>
+<PRE>
+quote 1
+%
+quote 2
+%
+quote 3
+%
+quote 5
+</PRE>
+<HR>
+
+This is not a very effective way. Therefor is the strfile program.It will
+process the ASCII-file and add a binary helper. The &lt;myquotes&gt; will
+accompanied by &lt;myquotes&gt;.dat .
+<HR>
+<PRE>
+
+> strfile myquotes
+</PRE>
+<HR>
+
+The &lt;myquotes&gt;.dat will by copied into the directory where the datafiles are stored.
+This is usually <CODE>/usr/share/fortune</CODE>. Check the installation with:
+<HR>
+<PRE>
+>fortune myquotes
+</PRE>
+<HR>
+</P>
+
+<H2><A NAME="ss2.3">2.3 unstr</A>
+</H2>
+
+<P>This is what the man-page says:
+<HR>
+<PRE>
+The purpose of unstr is to undo the work of strfile. It prints out the
+strings contained in the file source_file in the order that they are
+listed in the header file source_file.dat to standard output. It is
+possible to create sorted versions of input files by using -o when strfile
+is run and then using unstr to dump them out in the table order.
+</PRE>
+<HR>
+</P>
+
+<H2><A NAME="s3">3. other files to have fun with</A></H2>
+
+<P>An other possible target is <CODE>.signature</CODE>.
+Any selfrespecting mailprogram will add that to an outgoing mail.</P>
+
+<H2><A NAME="s4">4. remarks</A></H2>
+
+<P>The patchnames mentioned here are based on the actual fortune package.
+Distribution may change the place to somewhere.</P>
+<P>Beside fortune there are several other programs that select random
+quotes from a database. </P>
+<P>Be carefull when choosing quotes. There are people who take them serious like:
+<HR>
+<PRE>
+====### legal notice ###====-------------------------------------------
+Microsoft Network is prohibited from redistributing this work in any form, in
+whole or in part. License to distribute this post is available to Microsoft
+for $499. Posting without permission constitutes an agreement to these terms.
+walter@linux:~/bericht/fortune> fortune myquotes
+"You have the right to remain silent, but I wouldn't encourage you to do
+ so. Anything you say will be taken down, altered to my satisfaction and
+ used in a court of law to send you down for a good many years!"
+</PRE>
+<HR>
+</P>
+
+</BODY>
+</HTML>