Skip to content

Instantly share code, notes, and snippets.

View darth-veitcher's full-sized avatar

James Veitch darth-veitcher

View GitHub Profile
@darth-veitcher
darth-veitcher / WDTVLive.xml
Created January 12, 2014 12:53
WDTV device profile.xml for Plex Media Server
<Client name="WD TV Live HD Media Player">
<!-- Author: Plex Inc. -->
<!-- http://www.wdc.com/w...4779-705035.pdf -->
<!-- Model number tested: WDBAAN0000NBK -->
<!-- TODO - a few more limitations around codec profiles, which are high enough that they're probably not worth listing at present -->
<Identification>
<Header name="User-Agent" substring="alphanetworks" />
<Header name="User-Agent" substring="ALPHA Networks" />
</Identification>
<Settings>
CREATE FUNCTION dbo.CleanString (
@SomeText VARCHAR(8000)
)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @return VARCHAR(8000) = ''
DECLARE @position int = 1
WHILE @position <= DATALENGTH(@SomeText)
@darth-veitcher
darth-veitcher / gist:11365589
Created April 28, 2014 08:36
Python - iterate .lua and export nodes (ESO Harvest addon)
import re
from pprint import pprint
import os
debug = True
base_dir = os.path.join(os.path.expanduser('~'),'Documents','Elder Scrolls Online','liveeu','SavedVariables')
print("Assuming working directory of [{0}]\r\n".format(base_dir))
lua = os.path.join(base_dir,'HarvestMap.lua')
@darth-veitcher
darth-veitcher / docker-hacks
Last active August 4, 2016 22:51
Useful Docker hacks
# Connect to shell on container with ability to exit out again
docker exec -ti <containerId> bash
# Copy from container out to host
docker cp <containerId>:/file/path/within/container /host/path/target
# Remove all Stopped containers
# -f is the filter flag
docker rm $(docker ps -aqf status=exited)
@darth-veitcher
darth-veitcher / original-torrc
Created June 27, 2015 14:52
Vanilla torrc file
## Configuration file for a typical Tor user
## Last updated 2 September 2014 for Tor 0.2.6.1-alpha.
## (may or may not work for much older or much newer versions of Tor.)
##
## Lines that begin with "## " try to explain what's going on. Lines
## that begin with just "#" are disabled commands: you can enable them
## by removing the "#" symbol.
##
## See 'man tor', or https://www.torproject.org/docs/tor-manual.html,
## for more options you can use in this file.
@darth-veitcher
darth-veitcher / km-0809.ini
Created July 3, 2015 07:39
UK Keyboard Map
[noshift]
Key8=0:0
Key9=65307:27
Key10=49:49
Key11=50:50
Key12=51:51
Key13=52:52
Key14=53:53
Key15=54:54
Key16=55:55
@darth-veitcher
darth-veitcher / ipad.recovery.md
Last active August 28, 2015 17:43
Put iPad into recovery mode

Note to self

Hold down power for 5 seconds then press and hold the home button (while still holding down power) until the Apple logo appears. Release the power button while still holding down the home button until "connect to iTunes" appears.

@darth-veitcher
darth-veitcher / pip install specific version (range)
Created December 20, 2015 19:50
install latest LTS version of Django (version 1.8.x)
# grab latest LTS version of Django (version 1.8.x)
pip install 'django>=1.8,<1.9'
@darth-veitcher
darth-veitcher / Initial Ubuntu Desktop Setup.md
Created December 24, 2015 10:25
Initial Ubuntu Desktop Setup

Initial Ubuntu Desktop Setup

Brief notes for quick re-installs of core programmes I'm using.

Atom.io

Installed via PPA for ease of updates

sudo add-apt-repository ppa:webupd8team/atom
sudo apt-get update
sudo apt-get install atom -y
@darth-veitcher
darth-veitcher / nat.sh
Created April 16, 2016 21:18
Ubuntu Router - Enable IP forwarding and Masquerading
echo -e "\n\nLoading simple rc.firewall-iptables version $FWVER..\n"
DEPMOD=/sbin/depmod
MODPROBE=/sbin/modprobe
EXTIF="eth0"
INTIF="eth1"
#INTIF2="eth0"
echo " External Interface: $EXTIF"
echo " Internal Interface: $INTIF"