Start
   Blogaria
   Bored
   bsgen
   cconf
   Cookies
   CopyForward
   CyclicLog
   Dialwhatever
   DNSBalancer
   fch
   HammerServer
   jpeginfo
   kalk
   Lectures
   Microproxy
   msc
   Nasapics
   PGPkey
   SafeEdit
   Simple listserv
   Wallpapers
Karel as an adult

A little movie
An animation can't be properly rendered. You have probably a too old version of Flash player.






Cookies!


I've been dragging around my cookies collection with me for ages. Just to show a witty remark during logins on my Unix boxes, but also to have an ever-changing signature below my e-mails.

Strange thing is, that I've noticed that people often read my mails, while they skip other's. The reason can't be that I would write more interesting stuff. The only explanation that I can think of, is that people open my mails to see the next nerdish remark at the bottom.. And of course.. if you have a nice collection that would fit into this, let me know!

If you're interested..

A Unix cookie program

  • cookie.tar.gz is an archive of the cookie collection and of a program to display a random cookie. (Yes, that's what you're seeing at the bottom of the page.)

  • In the archive is cookie.jar, a text file with cookies. The file simply contains witty quotes separated by a blank line. (No! This is not a Java archive. Just a real virtual cookie jar.)

  • If you want to build the cookie program: get the above archive, extract, then say export PREFIX=/usr/local, then run make install. You'll get the program in /usr/local/bin and the jar in /usr/local/etc.

  • Once you have the program, simply type cookie to get a serving. Or type cookie -h to see what options are supported.

  • If you want to modify the cookie jar, simply edit /usr/local/etc/cookie.jar. The next invocation of cookie will use the updated collection.

A cookie at login

To liven up your login on Unix boxes, edit your profile, which is something like ~/.profile, or a system-wide profile in /etc. Add the following line:

test -t 0 && /usr/local/bin/cookie

The test looks whether stdin is attached to a tty. If so, /usr/local/bin/cookie is run. Tests to see whether a login is a true interactive session differ by the shell you use, see your man pages for more information.

A cookie as part of your mail signature

If you want to have a cookie as a part of your mail signature, then first of all, start with a small script ~/bin/echosig. The purpose of that script is to echo your mail signature. The script might look as follows:

#!/bin/sh
echo '--'
echo 'Your Name <your.name@your.domain>
/usr/local/bin/cookie -S3

Now the next steps will depend on what mail agent you're using:

  • If your mail agent understands that ~/.signature is your mail signature, you can set up a cronjob to run ~/bin/echosig each say 5 minutes (whilst redirecting the output to ~/.signature).

  • If your mail agent is e.g. KDE Mail (KMail), then you can specify a signature, and check the box that says that it's actually a program. The program name would then of course be ~/bin/echosig.

  • If you're on MacOSX Mail (as I am), then the procedure is quite harder. It involves patching up Mail so that signature handling is scriptable, and it involves creating a small Applescript to have Mail refresh its signature(s) using ~/bin/echosig.

    If you're interested in how to do this, drop me a note -- I'll send you some info, or I'll include a description on this page.