Security: Simultaneously Weak and Amusing

At the urgings of a friend, I recently set up a script that takes a picture (with iSight) every time the lid of his MacBook is opened. To be fair, the sense in which I actually did any work is quite marginal, as two tools — ImageSnap and Sleepwatcher — handle any aspect of the setup that might reasonably be considered complex.

As you might guess, ImageSnap is a command line tool for taking pictures with iSight. Likewise, Sleepwatcher is a system process that can be setup to watch for various events (e.g. startup, sleep, wake, ect.) and execute  specified external scripts when such events occur. Effectively, all I needed to do was compose these two helpful utilities to get the ‘security system’ up and running. Here is the bash script that Sleepwatcher executes on wakeup:

tre=`date "+%Y-%m-%d--%H-%M-%S.jpg"`

~/Programming/ImageSnap-v0.2.4/imagesnap
mv snapshot.jpg ~/Pictures/security/${tre}

To get Sleepwatcher up in the first place, setup launchd to run something like the following:

/usr/local/sbin/sleepwatcher --verbose --wakeup ./take_pic.sh

Of course, much more complex variations can be managed. For instance, if you think a mugging might be in the cards, then you can have the pictures sent to an externally accessible server (perhaps along with intermittent system screenshots). In any case, I recommend checking these tools out.

This entry was posted in Apple, Security and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>