This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ESP01S lighting controllers are pretty cheap, you can get them on aliexpress/ebay/amazon etc... | |
* https://www.amazon.co.uk/ESP8266-ESP-01-ESP-01S-Controller-Electronic/dp/B0819VRPXX | |
* | |
* A bit thin on decent software though, so I've cobbled together this MQTT client that lets you | |
* use MQTT to change the LED colours. With LED0 reserved for status of the device itself. | |
*/ | |
#include "EspMQTTClient.h" | |
#include <FastLED.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# GIT to MQTT Publishing hook | |
# | |
# This script provides a post-update hook solution which is intended to be self-contained and simply publish to | |
# a mosquitto server the current most recent commit ref for each branch. | |
# | |
# Once the branch is published clients subscribed to that specific topic will be informed of their necessity to | |
# update. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Single analogue joystick control for dual motors | |
// | |
// Applications include | |
// - Accessible control for single handed people | |
// - free up the second analogue stick for adding weapons or camera control | |
// - improving on the arduino battle bot PS2 code | |
// PS2X lib is buggy, especially with my cheapo controllers which have a few bits flipping | |
// randomly, other than that, and a little bit of a pain with a poor connection, it seems | |
// to work reliably enough most of the time. YMMV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Kills whatever emulator was started with emurun | |
# Sets up audio volume and re-enables suspend. | |
DISPLAY=:0.0 | |
if [ -f ~/emu.pid ]; then | |
PID=`cat ~/emu.pid` | |
if ps -p $PID > /dev/null; then | |
echo -n "Sending sigint to $PID..." | |
kill -SIGINT $PID | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Execute an emulator which is linked to this script, e.g. ln -s ~/bin/emurun ~/bin/dolphin-emu-nogui | |
# Then execute ~/bin/dolphin-emu-nogui to wrap it in this, disables suspend timers sets the TV volume and moves the cursor | |
# out of the way. Importantly it kills pulseaudio which does horrible things to audio. | |
# | |
export DISPLAY=:0.0 | |
export PATH=/usr/games:$PATH | |
EX=`basename $0` | |
echo autospawn = no > $HOME/.config/pulse/client.conf | |
/bin/kill -9 `/bin/pidof pulseaudio` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires: https://github.com/jcsaaddupuy/python-xbmc | |
# | |
# enable/disable kodi power management shutdown timer | |
# | |
# weird bug when you enable after 5 minutes of it sitting idle, it will shutdown... almost as if the timer is always going | |
# | |
from xbmcjson import XBMC | |
import sys | |
if __name__ == "__main__": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
import urllib2 | |
url = 'http://openwrt/cgi-bin/luci/' | |
data = {'luci_username': 'root', 'luci_password': 'password'} | |
r = requests.post(url, data=data, allow_redirects=True) | |
cookie = r.request.headers['Cookie'] | |
m = re.search('sysauth=(.*)', cookie, re.IGNORECASE) | |
sysauth = m.group(1) |