Working too much lately, time for a little fun. ;) Over the last few years, when time
permitted, I made some of my own fortune files. Some are short, only fifteen or so
entries. Others, like the quotations of Ralph Waldo Emerson, which has quite a few.
Fairly large fortune file. The file names are all pretty much self-explanatory as to
their content. If not, well, life's a mystery anyway, right? ;)
Incidentally, you can do other stuff with them besides put them in your ~/.profile
or ~/.kshrc file like so:
[ -x /usr/games/fortune ] && /usr/games/fortune /usr/share/games/fortune/grouchoI use mine on one OpenBSD box with mutt for a random signature. In my .muttrc file,
set signature=~/muttsig.sh|The muttsig.sh file which looks like this:
#!/bin/shComes out looking like this:
#
echo
fortune /usr/share/games/fortune/definitions && cat ~/fingerprint.txt
Be alert. The world needs more lerts.The fingerprint.txt is just a fingerprint from my gpg public key I plug into all my messages.
===============================================================
GnuPG key : 0x1644E79A | http://wwwkeys.nl.pgp.net
Fingerprint: D0A9 AD44 1F10 E09E 0E67 EC25 CB44 F2E5 1644 E79A
===============================================================
Table of Contents:
I mentioned this program in the site blog earlier when I introduced Girish Venkatachalam,
my friend in Tamil Nadu, who is now a co-author on the blog. Girish wrote the program
for me after I complained I was killing myself, trying to figure out how to start and stop
recording a radio program I like using mplayer from a cronjob. He appropriately named
the program killmyself.c in his own witty way. :-) I've put the code in here since it's open
source like all Girish's programs, along with an example of how to use it.
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/time.h>
extern char *__progname;
/* This program self destructs after a specified time */
int main(int argc, char **argv) {
int ret;
long minutes;
struct timeval t, t2;
pid_t child;
if (argc < 3) {
printf("Usage: %s <minutes> <mplayer arguments> \n",
__progname);
exit(128);
/* NOT REACHED */
}
if ( (child = fork()) != 0) {
/* I am the parent process */
minutes = strtol(argv[1], NULL, 10);
sleep(60 * minutes);
/* I am done! */
kill(child, SIGINT);
exit(0);
} else {
/* I am the child */
execv("/usr/local/bin/mplayer", argv + 1);
exit(0);
}
}
59 16 * * 6 $HOME/phc.sh > /dev/null 2>&1Putting ' > /dev/null 2>&1 ' on the end tells it not to notify you by email. If you want to
#!/bin/shThe 122 integer after the initial killmyself command is in minutes. I always tack an extra
#
~/killmyself 122 -dumpstream mms://radio.mpbonline.org/MPB_Live -dumpfile \
/data2/dennyboy/garrison/mp3/show/`date +"%Y%m%d"`phc.mp3
Had some fun with this one. I have quite a few BSD related wallpapers I've made, but I like
this one the best.
No affiliation between this site and the OpenBSD project exists or is implied.