Moles are dynamic content scripts run by a Gopher server This last week I have been experimenting with them a little bit.
My first mole
This first one was a little naive, just to get the gist of how moles work:
#!/bin/sh
/usr/pkg/bin/cal
You can imagine the output of this script...
My second mole
This is the original code of the script. I had to strip it down a bit for it to properly work. But I'm including here this version as a starting point for a future revision and improvement. (You're warned. This mole has flaws!!!)
#!/bin/sh
#This mole creates a digest of the main text content of my gopher site.
cd ~/gopher
if test -d ~/gopher/digest; then
cd ~/gopher/digest
else
mkdir ~/gopher/digest
cd ~/gopher/digest
fi
echo "This is a digest of the most important text content of the gopher
version of chalsattack. It is automatically created by a script for
the very lazy people, too lazy even to navigate the site. Enjoy." > at_a_glance.txt
#TODO:Add suffix .txt to files to be able to use *.txt and skip silly steps -->
cp ~/gopher/presentation ~/gopher/digest
cp ~/gopher/chalsattack/about ~/gopher/digest
cp ~/gopher/chalsattack/history ~/gopher/digest
FILES="presentation
about
history"
for i in $FILES
do
cat $i >> at_a_glance.txt
done
cat at_a_glance.txt
#Notify me if the script is run
MAD=mail@address.com #MAD short for Mail ADdress
echo "Mole out of the hole!!!" > ~/gopher/digest/mole.txt
echo $(date) >> ~/gopher/digest/mole.txt
cat ~/gopher/digest/mole.txt | mutt -s "Automatically sent report" $MAD
#Please turn off the lights and take the garbage out!!!
#rm -r ~/gopher/digest > /dev/null 2>&1
21 August 2011
YAPP (Yet Another Penguin/Present)
This is a present I got from my elder nephew. He knows how keen on penguins I am. And he likes them quite a lot as well, especially the "Penguins of Madagascar". Do you fancy guessing which one this is...We haven't been able to figure it out as of now.
Thank you. love.
Thank you. love.
Crystal clear
This is a very original present I got from some really dear friends of mine some weeks ago. I have the picture already stored on my hard drive now so it is time to publish it as I promised.
Thank you very much from the bottom of my heart. love you.
Thank you very much from the bottom of my heart. love you.
Subscribe to:
Posts (Atom)