commit 76f247d1624da5cb7f3e905beeea28c37fdde012 Author: Raphaƫl Vinot Date: Mon Nov 3 22:43:56 2014 +0100 Initial commit diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..1f90145 --- /dev/null +++ b/README.txt @@ -0,0 +1,28 @@ +howtoinstall + +sudo vi /etc/xdg/lxsession/LXDE/autostart +remove screensaver +sudo apt-get install unclutter xdotool git-core screen apache2 +git clone git://git.drogon.net/wiringPi +cd wiringPi +./build + +mkdir website +cd website +wget https://raw.github.com/HubSpot/odometer/v0.4.6/odometer.js +wget https://raw.github.com/HubSpot/odometer/master/themes/odometer-theme-car.css +cd .. +mkdir -p /home/pi/.config/lxsession/LXDE/ +cat > /home/pi/.config/lxsession/LXDE/autostart <<"EOF" +@xset s off +@xset -dpms +@xset s noblank +@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences +@unclutter -display :0 -noevents -grab +@screen -dm ./buttonscanner.sh +@firefox http://localhost/ +@sleep 60s +@xdotool key F11 +EOF + +wget http://code.jquery.com/jquery-1.11.1.min.js diff --git a/autostart/system b/autostart/system new file mode 100644 index 0000000..2526520 --- /dev/null +++ b/autostart/system @@ -0,0 +1,3 @@ +@lxpanel --profile LXDE +@pcmanfm --desktop --profile LXDE + diff --git a/autostart/user b/autostart/user new file mode 100644 index 0000000..68c3469 --- /dev/null +++ b/autostart/user @@ -0,0 +1,8 @@ +@xset s off +@xset -dpms +@xset s noblank +@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences +@unclutter -display :0 -noevents -grab +@screen -dm bash sensorscanner.sh +@firefox http://localhost/ +@bash -c 'sleep 60s;xdotool key F11;date > /tmp/gk' diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..a7d6b0e --- /dev/null +++ b/install.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +set -x +set -e + +ODOMETER_VERSION='v0.4.6' +JQUERY_VERSION='1.11.1' + +HOME_DIR='/home/pi' + + +sudo apt-get install unclutter xdotool git-core screen apache2 + +if [ -d "wiringPi" ]; then + pushd wiringPi + git pull +else + git clone git://git.drogon.net/wiringPi + pushd wiringPi +fi + +sudo rm -rf /usr/local/bin/gpio + +./build + +popd + + +mkdir -p /etc/xdg/lxsession/LXDE/ +sudo cp autostart/system /etc/xdg/lxsession/LXDE/autostart + +mkdir -p ${HOME_DIR}/.config/lxsession/LXDE/ +cp autostart/user ${HOME_DIR}/.config/lxsession/LXDE/autostart + +cp -rf sensorscanner.sh website ${HOME_DIR}/ + +pushd ${HOME_DIR} + +pushd website +wget https://raw.github.com/HubSpot/odometer/${ODOMETER_VERSION}/odometer.js +wget https://raw.github.com/HubSpot/odometer/${ODOMETER_VERSION}/odometer-theme-car.css +wget http://code.jquery.com/jquery-${JQUERY_VERSION}.min.js -O jquery.js +touch counter.txt +popd +popd + diff --git a/sensorscanner.sh b/sensorscanner.sh new file mode 100755 index 0000000..d8ef12b --- /dev/null +++ b/sensorscanner.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# run in background, install into inittab, anything goes +# example for inittab: +# P0:2345:respawn:/root/buttonscanner.sh +COUNTER=/home/pi/website/counter.txt +WiringPIN=18 # physical pin 12 +PATH=/bin:/usr/bin:/usr/local/bin +gpio -g mode $WiringPIN in # set to input mode +gpio -g mode $WiringPIN down # set internal pulldown +echo "Sensor scanner starting" +while true +do + echo "scanning..." + gpio -g wfi $WiringPIN falling # wait for detection (uses no cpu, but interrupt) + echo "got event" + gpio -g read $WiringPIN + if [ $(gpio -g read $WiringPIN) -eq 0 ] + then + counter="$(head "$COUNTER")" + counter=$((counter+1)) + cp -p "$COUNTER" "$COUNTER".new + echo "$counter" > "$COUNTER".new + mv "$COUNTER".new "$COUNTER" + echo "counter is now $counter" + echo "sleeping for 10s" + sleep 10 + fi +done + diff --git a/website/index.html b/website/index.html new file mode 100644 index 0000000..5cc06e0 --- /dev/null +++ b/website/index.html @@ -0,0 +1,29 @@ + + +
+ + + + +










+
+

you have been phished

+You are number +
123
+to fall for this trap +
+ + + +