[olug] Linux Counter

Steve Busby Steve at Busby.com
Tue Oct 14 21:45:05 UTC 2003


On Tuesday 14 October 2003 04:31 pm, Ryan O'Rourke wrote:
> On Tue, 2003-10-14 at 16:21, Steve Busby wrote:
> > On Tuesday 14 October 2003 08:34 am, Craig Wolf wrote:
> > > Anyone else felt the need to register themselves?
> > > http://counter.li.org/
> >
> > [snip...]
> > Done and Done!
> >
> > Check the sig.
>
> [snip..]
> Whoa! That's one heck of a sig.
> How do make the "Current System Stats" show up?
>SNIP<

It's a tweaked script and cron job I read in Lockernome's Penguin Shell a year 
or so ago.

Here's the my script:

</home/buzb/bin/signature.sh>

#!/bin/bash

# copy the signature header to the /home/buzb/.nsig file
cp /home/buzb/sig-stuff/header /home/buzb/.nsig

# execute the uptime command and append
# the /home/buzb/.nsig file with the results.
uname -mrsv >> /home/buzb/.nsig
uptime >> /home/buzb/.nsig

# copy the signature footer to the /home/buzb/footer file
cp /home/buzb/sig-stuff/footer /home/buzb/footer

# execute the Seti at Home current user stats and append
# the /home/buzb/footer file with the results
/home/buzb/bin/setiscript.sh status >> /home/buzb/footer

# read the /home/buzb/footer file and append
# the results to the /home/buzb/.nsig file
cat /home/buzb/footer >> /home/buzb/.nsig

# clean things up a bit
rm -f /home/buzb/footer

# you're outta here
exit

Here's the header and footer (pay attention to the empty lines, they help keep 
it from all running together):

</home/buzb/sig-stuff/header>

BuzB

Registered Linux User 216668 on
Registered Machine 189657 at
http://counter.li.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Current System Stats:

</home/buzb/sig-stuff/footer>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Then I simply run a cron job every minute:

$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.28964 installed on Tue Oct 14 06:47:30 2003)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
#minute (0-59),
#| hour (0-23),
#| | day of the month (1-31),
#| | | month of the year (1-12),
#| | | | day of the week (0-6 with 0=Sunday).
#| | | | | commands
 * * * * * ~/bin/signature.sh
 9 2 * * * sh ~/bin/rsync.script

Which generates the .nsig file every minute of every hour of every day...well 
you get the idea.

Last piece is telling your email client to use the ~/.nsig file for your 
signature on all outgoing mail.

-- 
BuzB

Registered Linux User 216668 on
Registered Machine 189657 at
http://counter.li.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Current System Stats:
Linux 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 i686
 16:34:00 up 18:20,  4 users,  load average: 1.45, 1.78, 1.60
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Seti work units completed: 14219
Seti client running: 17:18:20
Percentage complete: 15.2274
Last result returned: (Tue Oct 14 20:29:17 2003)




More information about the OLUG mailing list