[Xastir] Saving serial snapshots
Gerry Creager
gerry.creager at tamu.edu
Wed Apr 15 22:13:40 EDT 2009
Carl Makin wrote:
>
>
> On Wed, 15 Apr 2009, Gerry Creager wrote:
>
>> Personally, I think you ought to use the MD5 of the image as a seed
>> for a RAND, and use that as the filename. A similar approach could be
>> used for the extension.
>
> Ahhh, a challenge. Well, a bit of one. <grin>
>
> while [ 1 ]; do
> kill -SIGUSR1 `cat ~/.xastir/xastir.pid`
> if [ -f ~/.xastir/tmp/snapshot.png ]; then
> md5sum ~/.xastir/tmp/snapshot.png > /tmp/gerrysseed
> NEWFILENAME=`openssl rand -rand /tmp/gerrysseed -base64 30`
> NEWEXT=`cat /proc/sys/kernel/random/uuid`
> mv ~/.xastir/tmp/snapshot.png archive/$NEWFILENAME.$NEWEXT
> rm /tmp/gerrysseed
> fi
> sleep 300
> done
That'll certainly work and will at least keep the honest ones guessing
as to the origins of the file. I'll have to see if we can make
ImageMagick still detect the correct image type without an extension, or
if that'll take code.
I just knew that, if given a challenge, the interested student could
find a solution.
> Um, the uuid thing only works on linux with /proc enabled.
Correct.
> It's obviously a slow day at work today...
Mine was meetings, teleconferences and debugging Fortran code (someone
else's). I'm pretty fried right now!
gerry
--
Gerry Creager -- gerry.creager at tamu.edu
Texas Mesonet -- AATLT, Texas A&M University
Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.862.3983
Office: 1700 Research Parkway Ste 160, TAMU, College Station, TX 77843
More information about the Xastir
mailing list