summaryrefslogtreecommitdiffstats
path: root/btc/mining/bin
diff options
context:
space:
mode:
authorroot <root@chinaman.(none)>2011-07-08 17:24:48 +0200
committerroot <root@chinaman.(none)>2011-07-08 17:24:48 +0200
commit2f791c20ae45e7030c1b27d65f69186309a8ef8c (patch)
tree51a75164913e4d2caa424a5c7f118e12e31b1c45 /btc/mining/bin
parentefc72df0e8a8115741e60bffed6e5854a43b5b38 (diff)
mining: added archlinux cruise control
mining/Makefile: added archlinux cruise control (auto installer) which always does the right thing. loosely after http://rubyists.github.com/2011/06/08/how-to-build-a-namecoin-or-bitcoin-miner-in98-easy-steps.html mining/{user/,}/bin:renamed mining/bin/newkey.sh: add policy Xorg keygen
Diffstat (limited to 'btc/mining/bin')
-rwxr-xr-xbtc/mining/bin/ati_temper5
-rwxr-xr-xbtc/mining/bin/cleanup_tmp4
-rwxr-xr-xbtc/mining/bin/ensure-router27
-rwxr-xr-xbtc/mining/bin/ensure-wlan032
-rwxr-xr-xbtc/mining/bin/newkey.sh15
5 files changed, 83 insertions, 0 deletions
diff --git a/btc/mining/bin/ati_temper b/btc/mining/bin/ati_temper
new file mode 100755
index 00000000..283a6024
--- /dev/null
+++ b/btc/mining/bin/ati_temper
@@ -0,0 +1,5 @@
+#displays: CARD1TEMP CARD2TEMP CPUTEMP OUTSIDE
+echo -n "`DISPLAY=:0 aticonfig --adapter=1 --od-gettemperature | grep Temperature | sed -n 's/.*Temperature - \([0-9.]*\) C/\1/;p'` "
+echo -n "`DISPLAY=:0 aticonfig --adapter=2 --od-gettemperature | grep Temperature | sed -n 's/.*Temperature - \([0-9.]*\) C/\1/;p'` "
+echo -n "`sensors | grep temp1 | sed -e 's/temp1: *+\([0-9.]*\).*/\1/'` "
+echo "`temper`"
diff --git a/btc/mining/bin/cleanup_tmp b/btc/mining/bin/cleanup_tmp
new file mode 100755
index 00000000..e1395b19
--- /dev/null
+++ b/btc/mining/bin/cleanup_tmp
@@ -0,0 +1,4 @@
+#! /bin/sh
+ls -lAtr /tmp/ | sed -rn '
+ /\.so$/{$!{s/.* ([A-Za-z0-9]+\.so)$/rm -v \/tmp\/\1/p}}
+' | sudo sh
diff --git a/btc/mining/bin/ensure-router b/btc/mining/bin/ensure-router
new file mode 100755
index 00000000..ec78f610
--- /dev/null
+++ b/btc/mining/bin/ensure-router
@@ -0,0 +1,27 @@
+#! /bin/sh
+
+if test "${nosudo-false}" != true -a `id -u` != 0; then
+ echo "we're going sudo..." >&2
+ exec sudo "$0" "$@"
+ exit 23 # go to hell
+fi
+
+if=eth2
+
+if ! ifconfig $if | grep -q 'inet addr'; then
+ beep -l 50 -f 2500; ifconfig $if 0.0.0.0 down || :
+ beep -l 50 -f 2500; ifconfig $if 23.0.0.1/8 up || :
+ beep -l 50 -f 2500; /etc/init.d/dnsmasq restart
+ beep -l 50 -f 2500; iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
+ beep -l 50 -f 2500; iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE
+ if ifconfig $if | grep -q 'inet addr'; then
+ beep -l 50 -f 2500 -n -l 100 -f 3000
+ else
+ beep -l 50 -f 2500 -n -l 100 -f 1000
+ fi
+else
+ case "${1-}" in
+ (--quiet) : ;;
+ (*) beep -l 50 -f 2500 -n -l 100 -f 2500 ;;
+ esac
+fi
diff --git a/btc/mining/bin/ensure-wlan0 b/btc/mining/bin/ensure-wlan0
new file mode 100755
index 00000000..92839a13
--- /dev/null
+++ b/btc/mining/bin/ensure-wlan0
@@ -0,0 +1,32 @@
+#! /bin/sh
+
+if test "${nosudo-false}" != true -a `id -u` != 0; then
+ echo "we're going sudo..." >&2
+ exec sudo "$0" "$@"
+ exit 23 # go to hell
+fi
+
+if ! ifconfig wlan0 | grep -q 'inet addr'; then
+ if ! grep -q wlan0 /etc/network/interfaces; then
+ cat >> /etc/network/interfaces <<EOF
+# generated by rc.local
+auto wlan0
+iface wlan0 inet dhcp
+wpa_conf /etc/wpa_supplicant/wpa_supplicant.conf
+EOF
+ fi
+
+ beep -l 50 -f 2000; /etc/init.d/network-manager restart
+ beep -l 50 -f 2000; ifdown wlan0
+ beep -l 50 -f 2000; ifup wlan0
+ if ifconfig wlan0 | grep -q 'inet addr'; then
+ beep -l 50 -f 2000 -n -l 100 -f 3000
+ else
+ beep -l 50 -f 2000 -n -l 100 -f 1000
+ fi
+else
+ case "${1-}" in
+ (--quiet) : ;;
+ (*) beep -l 50 -f 2000 -n -l 100 -f 2000 ;;
+ esac
+fi
diff --git a/btc/mining/bin/newkey.sh b/btc/mining/bin/newkey.sh
new file mode 100755
index 00000000..e71ab85b
--- /dev/null
+++ b/btc/mining/bin/newkey.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+auth=$HOME/.Xauthority
+cp /dev/null $auth
+
+if [ "$1" = "-md5" ]; then
+ key=`pstat -pfS | md5`
+else
+ key=`perl -e 'srand; printf int(rand(10000000000000))'`
+ key=$key$key
+fi
+
+xauth add unix:0 . $key
+
+xauth add ${HOST}:0 . $key