summaryrefslogtreecommitdiffstats
path: root/Cancer
diff options
context:
space:
mode:
Diffstat (limited to 'Cancer')
-rwxr-xr-xCancer/bigeye/bigeyed70
-rwxr-xr-xCancer/git/git-clone-into48
-rwxr-xr-xCancer/git/git-eternal-move (renamed from Cancer/crypto/git/git-eternal-move)0
3 files changed, 118 insertions, 0 deletions
diff --git a/Cancer/bigeye/bigeyed b/Cancer/bigeye/bigeyed
new file mode 100755
index 00000000..5aa36210
--- /dev/null
+++ b/Cancer/bigeye/bigeyed
@@ -0,0 +1,70 @@
+#! /bin/sh
+#
+# usage: bigeyed
+#
+
+set -euf
+
+mkdir -vp /tmp/bigeye
+cd /tmp/bigeye
+
+cleanup() {
+ test -n "$spid" && kill -9 $spid && spid=
+}
+
+port=`touch /dev/bigeye 2>/dev/null && rm /dev/bigeye && echo 3 || echo 3333`
+
+#python -m http.server $port & server=$!
+python -m SimpleHTTPServer $port & 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
+
+hostname="`hostname`"
+blink() {
+ date="`date --rfc-3339=s`"
+ echo $date
+ # nobody will ever need more than 3 frames to initialize!
+ frame=4
+ device="/dev/`cd /sys/class/video4linux && ls | head -n 1`"
+ mplayer -frames $frame -quiet \
+ -vo jpeg \
+ -tv driver=v4l2:device=$device \
+ tv:// #1>/dev/null 2>/dev/null
+ mv 0000000$frame.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
+
diff --git a/Cancer/git/git-clone-into b/Cancer/git/git-clone-into
new file mode 100755
index 00000000..67e820e6
--- /dev/null
+++ b/Cancer/git/git-clone-into
@@ -0,0 +1,48 @@
+#! /bin/sh
+#
+# usage: git-clone-into repository directory
+#
+set -euf
+
+tempdir() {
+ set -- `tempnam $1`
+ mkdir $1
+ echo $1
+}
+
+## [prefix] -> tempnam
+tempnam() {
+ until set -- $1 ${1-}`candnam` && ! test -e $2; do :; done
+ echo $2
+}
+
+candnam() {
+ uuidgen 2>/dev/null || date +%s%N
+}
+
+
+
+ tmp_remote=`candnam`
+ tmp_branch=`candnam`
+
+ subdir=$2
+ if test -e $subdir; then
+ echo 'You are made of stupid!' >&2
+ exit 23
+ fi
+ tmpdir=`tempdir /tmp/tempdir-`
+ #trap "test -d $tmpdir && rm -vfR $tmpdir" EXIT
+ trap "test -d $tmpdir && rm -fR $tmpdir" EXIT
+ repository="${1-$repository}"
+ git clone "$repository" $tmpdir
+ (cd $tmpdir
+ subdir="$subdir" git filter-branch --tree-filter '
+ if ! test -d $subdir; then
+ mkdir -p $subdir
+ git ls-tree -z --name-only $GIT_COMMIT | xargs -I. --null mv . $subdir
+ fi
+ '
+ git checkout -b $tmp_branch)
+ git remote add $tmp_remote $tmpdir
+ git fetch $tmp_remote
+ git merge $tmp_remote/$tmp_branch # TODO configurable branch
diff --git a/Cancer/crypto/git/git-eternal-move b/Cancer/git/git-eternal-move
index 50361e7b..50361e7b 100755
--- a/Cancer/crypto/git/git-eternal-move
+++ b/Cancer/git/git-eternal-move