Stonelinks


Home | Posts | Projects | About

SSH Periodic Screenshot

10/08/2014

I came up with this fairly scary bash one liner that will periodically ssh into a machine that you have access to, take a screenshot and copy it back to your machine. Just fill in the USER and HOST variables.

USER=www-data; HOST=dev0; bash -c "while [ 0 ]; do ssh $USER@$HOST DISPLAY=:1.0 import -window root /tmp/a.png; date +%s | xargs -I {} scp $USER@$HOST:/tmp/a.png $USER@$HOST-{}.png; sleep 2; done"
Tags: Hacks

Read this next:

Leaflet Google Maps

Ever wanted to use google imagery inside of a leaflet map? This is just a small example of a google maps imagery / base layers hosted inside of a leaflet map. Check out where the magic happens on github: here.


Lucas DoyleWritten by Lucas Doyle, a robotics engineer who does a lot of web development in San Francisco.