diff options
author | root <root@krebs> | 2011-05-17 23:03:36 +0200 |
---|---|---|
committer | root <root@krebs> | 2011-05-17 23:03:36 +0200 |
commit | d4678ed9d0ca86c4e5e4ba43cdc5f5ff0fc2d004 (patch) | |
tree | 6359b91b77c8d672a1d89232371cafa7852f90f5 /modules/bigeye/bigeyed | |
parent | 3bd34661f206de3724eed61030b3c9767140ec77 (diff) |
bigeyed: initial commit
Diffstat (limited to 'modules/bigeye/bigeyed')
-rwxr-xr-x | modules/bigeye/bigeyed | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/modules/bigeye/bigeyed b/modules/bigeye/bigeyed new file mode 100755 index 00000000..a1d558eb --- /dev/null +++ b/modules/bigeye/bigeyed @@ -0,0 +1,68 @@ +#! /bin/sh +# +# usage: bigeyed +# + +set -euf + +mkdir -vp /tmp/bigeye +cd /tmp/bigeye + +cleanup() { + test -n "$spid" && kill -9 $spid && spid= +} + +#python -m http.server 3 & server=$! +python -m SimpleHTTPServer 3 & spid=$? +trap cleanup EXIT HUP INT QUIT TERM + +base64 -d>favicon.ico<<EOF +AAABAAEAICAQAAEABADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAVQAAAKoAAABVVQAAVVVVAP9VVQCqqgAAqqqqAP+qqgD//6oAVf//AKr//wD///8A +AAAAAAAAAAAAAAAAnHzMd3REQAAAAABERERHm8nMx3REQAAAAAAAAERERHmXx3dEAAAAAAAAAAAA +R0REzMREQAAAAzNLu0BAAAR0RMxEQAAAMzMURES7REAARHfEQAADMzNERERERLtEAAR3RAAAMzBE +R3dwRABEtEAER0AAMzgER3d3e0REAEtEAEQAAzGwRHMzAAAHREADtEAEAAMbBEcwAAAAAHdEADtE +AAAxS0RzAAEAAAALdEAztEADNERHMAAQAAAAALdDA7tAE0S0swAAABEAAAAHdDS7RBNLRLMAAAEA +ERAQC3M0N4QzS0tzABAQAAAAAQB0AEeHNEtLcBARABAAEAAAdDBHhBRLR3ABF1VVEREAAXRESIRE +S0dwF3FQUVUREAF0REiEd3d3wQVZQVVBQUEIh3iZhIfMzMwFlRRVVBQUC3x4iYQHd8fMAJFRQUFB +QAt6R0uEB8d0vIAJFBQUFAC3x0S7hAd4dEzIAVVBQUALd6REukcAd3hEzMgVFBQAt3dES6RAcAe4 +hEd8yIiIjLd4SEtEAGcHe8xEd3fMjHd3hEzEQABmcES4hERHd3fHdETLRAAMJmYERIiIRERERESZ +tEAAzBEWYARMnIiIiIiIm0QADMchEXYAREnJycnMy0RADMybARISYABEREREtEREAMzJexAhIWEA +AERERERAAAzMebsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== +EOF + +device="/dev/`cd /sys/class/video4linux && ls | head -n 1`" + +hostname="`hostname -f`" +blink() { + date="`date --rfc-3339=s`" + echo $date + mplayer -frames 1 -quiet \ + -vo jpeg \ + -tv driver=v4l2:device=$device:width=640:height=480 \ + tv:// 1>/dev/null 2>/dev/null + #convert -brightness-contrast 20x10 00000001.jpg 00000002.jpg + mv 00000001.jpg index.jpg + cat>00000001.html<<EOF + <!doctyle html> + <META HTTP-EQUIV="REFRESH" CONTENT="2"> + <style type="text/css"> + body { + background-color: black; + color: white; + font-family: monospace; + } + </style> + <title>$hostname's bigeye</title> + <p>$date</p> + <p><img src="index.jpg" alt="ZOMBIECANCER" /></p> +EOF + mv 00000001.html index.html +} + +while blink; do + sleep 1 +done + |