Skip to content

Instantly share code, notes, and snippets.

@rdmarsh
rdmarsh / chips.yml
Created March 12, 2016 12:26
Set CHIP up as an airplay server using ansible playbook
---
# Set CHIP up as an airplay server.
# Based on https://www.hackster.io/11798/c-h-i-p-play-speakers-7cebb9
# Note; you will still have to edit shairport-sync.conf to set the name
- name: configure chips for iot shairport use
hosts: shairport-chips
become_user: root
@rdmarsh
rdmarsh / remote.xml
Last active July 16, 2016 04:40
Stop a video in kodi when backing out of it
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<FullscreenVideo>
<remote>
<back>stop</back>
</remote>
<keyboard>
<back>stop</back>
<backspace>stop</backspace>
<escape>stop</escape>
@rdmarsh
rdmarsh / gen.xml
Last active March 7, 2016 12:55
Basic settings for red, green, yellow and blue keys in kodi
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<global>
<keyboard>
<escape>Pause</escape>
<key id="251">activatewindow(home)</key>
<key id="252">activatewindow(videos,movietitles)</key>
@rdmarsh
rdmarsh / nzbget
Last active December 10, 2017 12:36
nzbget logrotate
/var/nzbget/dst/nzbget.log {
missingok
notifempty
size 2M
rotate 4
copytruncate
}
@rdmarsh
rdmarsh / gist:ea4e02b03551b786d793
Last active February 7, 2018 23:33
syslog-ng error binding socket
Starting syslog-ng: Error binding socket; addr='AF_UNIX(/dev/log)', error='Address already in use (98)'
Error initializing source driver; source='s_sys', id='s_sys#1'
Error initializing message pipeline;
[FAILED]
to solve: rm /dev/log
@rdmarsh
rdmarsh / loadstrobe.py
Created April 3, 2015 14:48
Simple prog to chase leds up and down for the rasberrypi piface. The higher the load, the slower they go
#!/usr/bin/python3
#Simple prog to chase leds up and down for the rasberrypi piface
#The higher the load, the slower they go
from time import sleep
import pifacedigitalio
import sys
if __name__ == "__main__":
@rdmarsh
rdmarsh / loadled.py
Created April 3, 2015 13:57
Silly program to light up LEDs on raspberrypi piface depending on system load
#!/usr/bin/python
#silly program to light up LEDs on raspberrypi piface depending on system load
#basically multiplys load by x10, rounds, and lights up that many leds
from time import sleep
import pifacedigitalio
import sys
DELAY = 1.0 # seconds
@rdmarsh
rdmarsh / salt-ssh no hosts found.md
Last active December 1, 2015 09:11
How to fix "No hosts found with target * of type glob" for salt-ssh

If you get this error when running sudo salt-ssh '*' test.ping:

"No hosts found with target * of type glob"

Check the file /etc/salt/roster for fomatting errors.

Note: It doesn't like tabs.

@rdmarsh
rdmarsh / dvorak-evolution.pl
Created September 10, 2014 01:04
Try and find a better keyboard layout using evolution algorithm
#!/usr/bin/perl -w
#
#kb calculation by david marsh
#
#version 1.11
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.