[Gslug-general] Re: Nocturnal LFNW attendee requests wake-up call

Paul Bartell paul-bartell at ubuntu.com
Sat May 3 12:25:54 PDT 2008


This is all assumeing you have a computer on all the time that you can
hear... Mines a floor below, so i wouldent be able to hear it without
having speakers in my room connected to it, so it would simply make
more sense to just use a phone... and possibly asterisk.

On Sat, May 3, 2008 at 12:04 PM, Duncan Smith <chronomex at gmail.com> wrote:
> On Thu, Apr 24, 2008 at 10:42:33AM -0700, Glenn Stone wrote:
>> lessee... and some variant of
>>
>> while ! (who | grep $USER)
>> do
>>   echo "Time to go to LFNW!" | mail -s "Wake up!" $CELLPHONEMAIL
>>   sleep 300
>> done
>>
>> (This of course presumes you log off the machine in question before
>> going to bed, but leave it running; how to deal with other
>> variations is left as an excercise :)
>>
>> (Most cellphones have an "alarm" function, too, but this is more
>> fun. :)
>>
>> -- at this point Glenn, amused
>
> That would work for me, but I don't have a cellphone.  Also it's not
> unixy enough.  It doesn't have multiple processes, it doesn't use
> lockfiles, and most importantly you don't need an alarm daemon when
> you have cron!
>
>
> $ cat ~/bin/wakeup
> #!/bin/sh
>
> touch /var/lock/wakeup-alarm-going
> ~/bin/sounds.sh alarm &
> xmessage -display :0 -center -geometry 400x300 "Dismiss this window to stop alarm."
> rm -f /var/lock/wakeup-alarm-going
>
>
> $ cat ~/bin/sounds.sh
> #! /bin/bash
> # script to play sounds.  Centralized for easy maintenance.
>
> play=aplay
>
> case "$1" in
>
> [ ... ]
>
>    alarm)
>        while [ -f /var/lock/wakeup-alarm-going ]; do
>            $play -q ~/.sounds/alarm.wav
>        done ;;
>
> [ ... ]
>
> esac
>
>
> $ crontab -l
> # m h  dom mon dow   command
> 30 7 * * mon,wed,fri ~/bin/wakeup
> 50 5 * * tue ~/bin/wakeup
> 00 7 * * sun ~/bin/wakeup
> [ ... ]
>
>
> It's a bit idiotic to use a lockfile like that, but it works decently.
> Doesn't kill the alarm immediately, though -- it stops it from
> repeating.
>
> --
> Duncan Smith  --------\    http://students.washington.edu/f/    /---
>  ()  ascii ribbon     \--- Signed/encrypted mail preferred ---/
>  /\    campaign    [ against html mail ]  [ support open formats ]
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD4DBQFIHLdSQGADY1yMpg0RAtKcAKCjnUXd9JSOGfZ9wL73wk6vNG1JhwCVFz47
> 3VYfzyL7PADc3RyI2E4YTA==
> =KX/f
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Gslug-general mailing list
> Gslug-general at gslug.org
> http://lists.gslug.org/mailman/listinfo/gslug-general
>



-- 
"He who controls the past controls the future. He who controls the
present controls the past." - 1984

Random quote of the week/month/whenever i get to updating it: "Don't
worry about people stealing an idea. If it's original, you will have
to ram it down their throats."
 - Howard Aiken


More information about the Gslug-general mailing list