MINI Toronto trip Computery Goodness
This Time
while $(/bin/true); do timestamp=`date +%y%m%d_%k%M` lat_long=`echo "p"|netcat -q 1 localhost 2947|sed 's/GPSD,P=//g'|sed 's/ /_/g'` filename=$timestamp"_"$lat_long".jpg" echo $filename gqcam -t JPEG -s -d /home/jlapenna/trip/photos/$filename -v /dev/video0 sleep 60 done
to snap a photo every minute and name it $timestamp$latitude$longitude.jpg in a directory of my choosing. I started gpsd using:
gpsd /dev/ttyUSB0
but that does not work on a consistent basis.
To get maps as appropriate, I created three waypoints corresponding to the prime locations we were going to be around in this short trip, chicago, IL; toronto, ON and lansing, MI. I then ran:
gpsfetchmap.pl -w WAYPOINT -sc "5000,15000,30000,50000,200000,500000,3000000" -a 5 --mapserver expedia -u miles -p
replacing WAYPOINT with home (chicago), toronto or lansing
Turns out something fishy happened with the lansing maps so they weren't accurate.
2 Comments:
There is a simpler (and more right) way to write:
while $(/bin/true); do
Here is it:
while :; do
Explanation: what is important for while is the return code, not the command output. Use of $(/bin/true) means "get the output of /bin/true".
':' is a shell builtin that just return 0 (true) and is equivalent to /bin/true (but different from $(/bin/true)), except it does not start a new process.
Thanks Oliver!
Post a Comment
Links to this post:
Create a Link
<< Home