Okay, this is another fun, largely useless one.
About a million years ago, when I was an impressionable young man who did not give first recourse to cynicism and pelf, I went to college. Better yet, I actually graduated, albeit a few years after everyone else. Partly this hiccup in my educational schedule was due to cheap booze and retroactively unwise assignations, but largely it had something to do with UNIX, which is really far less glamorous.
It fascinated me. Clearly, it was an enormously flexible, powerful way of enabling an entire campus full of aspiring Communications and Philosophy undergrads to churn out endless reams of verbiage, but it was also refreshingly quirky. Some enterprising wag in the MIS department had written a variant of the so-called cookie virus, whereby you’d be pounding away on a paper and would be politely interrupted by a prompt on your screen asking you for a cookie. You’d type “cookie”, and the computer would thank you politely and restore you to whatever you were doing. It was enchanting to me that even with huge power and purity of purpose, that there was a capacity for whimsy. The computer system wasn’t just a faceless functionary, it was trying to be cute.
Here’s how to inject a little of that cuteness into your everyday experience – at least if you use the Terminal. More specifically, we’re going to replace the conventional /etc/motd with something more fun, using the venerable fortune UNIX program to pop up helpful and humorous nonsense to add a little levity to whatever chore you’ve opened the Terminal to work on. So, to work:
First, go and download Fortune – I got mine from here.
Once downloaded, follow the instructions in the disk image, which consist of jumping into the Terminal, changing to the directory of the disk image, then running:
This will copy fortune into /usr/local/var and add it to your path. Close the open Terminal window, open a new one and type in fortune. The results should be something like this:
Cool. But let’s go one better – by adding fortune to your .profile, you can make it pop up at the beginning of each session, which is much, much cooler. To do this, you can either use pico or nano to open edit up your .profile and manually add it to the end of the list, or you can jump into the Terminal and plug in:
Now, when you open a new session, you’ll see something like this: Much better. However, the quotes that come with fortune are… eclectic. If you dig into the fortunes directory, you’ll see something like this:
Each of those fortune files contains dozens – if not hundreds – of quotes, and some of them (particularly the food and ascii-art ones) are huge amounts of text. Personally, I like pithy one-liners, and I’m going to assume for the sake of argument that you do too. With that in mind, let’s make our own. Before we go any further, let’s lose all those text files – go to /usr/local/var/fortunes and trash them all. You’ll have to authenticate as su to do so, but that’s what you expect when you go digging around the roots of the operating system. That done, here’s how to roll your own fortunes file.
Step 1: Find some pithy quotes. I cannibalized the existing “wisdom” file and augmented it with my own dubious book-larnin’ and anything cool I could remember from movies. If you want to do the same, I’d suggest copying it from it’s default location to your Desktop – that way you can work on it without needing to constantly authenticate. You can use the command-line text editor of your choice, but I used the very excellent TextWrangler, because it’s free. And awesome.
Step 2: The format is simple – each quote is separated by a new line with a single “%” character, thus:
At the end of your life there'll be a good rest, and no further activities are scheduled. % Catharsis is something I associate with pornography and crossword puzzles. -- Howard Chaykin %
Step 3: Your new quote file needs a catchy name – I called mine “wisdom” because it was easy, and I’m very self-congratulatory. Now that your file is ready, you need to create the binary .dat file required to actually make the thing work. To do so, jump back into the Terminal and fire up strfile -c % wisdom wisdom.dat
Step 4: There is no Step 4. Okay, there is, but it’s pretty simple – just copy the wisdom and wisdom.dat files back into /usr/local/var/fortunes, and enjoy your home-spun screed, thus: