Brian Hornsby's Repository for Kodi Version 1.0.0

Brian Hornsby's Repository for Kodi Version 1.0.0

22 June 2013

I have finally got around to creating a Kodi repository for my plugins and scripts.

The repository contains the following plugins and scripts: BBC iPlayer, OpenStreetMap, OpenVPN, Similar Tracks and TuneIn Radio.

Download: repository.brianhornsby-1.0.0.zip

How To Setup Your VPN Client

How To Set Up Your VPN Client

20 February 2015

The following guide originally appeared on the TV Addons forum. Many thanks to the original author "invisable" for letting me reproduce it here.

This is a guide on how to get your VPN working on your Raspberry Pi using Brian Hornsby's OpenVPN for Kodi add-on. I have tested this and it works for both Raspbmc and OpenELEC (still to test on XBian). It also works on the OpenELEC versions of Kodi on the Hummingboard so it will probably work on the CuBox-I. This add-on does not work on Apple TV due to it not having a OpenVPN client installed also this only works on Gotham/Kodi and later builds of OpenELEC.

The add-on is a bit simpler then the previous method, which used advanced launcher, but still involves a little bit of work which includes modifying a few files. This guide assumes that you know the basics and you know how to move files and folders from your PC/Mac to your Raspberry Pi. I have tried to make this a simple as possible, thank to rayw1986 as he originally brought the method of editing the files to my attention, also thanks to Brian Hornsby the developer for writing the add-on.

I use Private Internet Access (PIA) as my VPN provider, so I am using them as an example for this guide. Please note: If you are also using using PIA you may need to generate a password for socks, pptp to use on this guide, this can be done by logging into PIA and clicking generate password from the client control panel.

Step 0 (Raspbmc only)

Raspbmc doesn't have a OpenVPN client installed by default so the first thing we need to do is download one so log in via putty

username: pi
password: raspberry

If you see the timezone setup message and do not want to set it all up, just hit ctrl+C on your keyboard to abort it, you should then see the UNIX bash prompt.

You need to be super user to setup OpenVPN so enter:

pi@raspbmc:~$ sudo bash

The prompt should change to indicate you are root. It's a good idea to update the software repositories first so enter:

root@raspbmc:/home/pi# apt-get update

Depending on your connection it may take a few minutes to complete. To install OpenVPN enter:

root@raspbmc:/home/pi# apt-get install openvpn

This will also take a few minutes, once finished you will be returned to the prompt, now you can exit putty and restart your raspberry pi.

Step 1

First thing you need to do is download your clients vpn configuration including the certificate files if needed. for PIA they can be download from this link: https://www.privateinternetaccess.com/openvpn/openvpn.zip. There are a couple of free OpenVPN services don't know how good they are but if you want to set up a free one you could try these: http://freevpn.me/accounts the certificate files are usually included in the .ovpn files

Step 2

Once your VPN configuration files have been downloaded extract it to a folder on your computer (I created a folder on the desktop and extracted them there).

Step 3

Open up the folder where you extracted all your configuration files to and remove all the spaces in the names of the locations you want to use, so for example. CA North York.ovpn would become CANorthYork.ovpn

Step 4

Open up notepad++ if you havent got this it is free to download from here http://notepad-plus-plus.org/download/ On the first line you need to type your username (nothing else). On the second line type your password (nothing else). Click file and save it as pass.txt (make sure it is a txt file)this should be saved into the same folder where you extracted your VPN configuration files.

Step 5 (OpenELEC)

Open up one of the OpenVPN configuration files you want to use for example this is USMidwest.ovpn from PIA. It will look like this:

client
dev tun
proto udp
remote us-midwest.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
tls-client
remote-cert-tls server
auth-user-pass
comp-lzo
verb 1
reneg-sec 0
crl-verify crl.pem

You need to edit the lines beginning with ca ca.crt and auth-user-pass. Also we need to edit the last line "crl-verify crl.pem" so it looks like this:

client
dev tun
proto udp
remote us-midwest.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /storage/.config/vpn-config/ca.crt
tls-client
remote-cert-tls server
auth-user-pass /storage/.config/vpn-config/pass.txt
comp-lzo
verb 1
reneg-sec 0
crl-verify /storage/.config/vpn-config/crl.pem

What we are doing here is telling the ovpn file where to find your certificate and login details. (Sometimes the certificate is inserted into the OpenVPN file so you will not need to edit the line that starts with ca)

Step 5 (Raspbmc)

Open up one of the OpenVPN configuration files you want to use for example this is USMidwest.ovpn from PIA. It will look like this:

client
dev tun
proto udp
remote us-midwest.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
tls-client
remote-cert-tls server
auth-user-pass
comp-lzo
verb 1
reneg-sec 0
crl-verify crl.pem

You need to edit the lines beginning with ca ca.crt and auth-user-pass. We also need to edit the path or delete the last line "crl-verify crl.pem" so it looks like this:

client
dev tun
proto udp
remote us-midwest.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /home/pi/vpn-config/ca.crt
tls-client
remote-cert-tls server
auth-user-pass /home/pi/vpn-config/pass.txt
comp-lzo
verb 1
reneg-sec 0
crl-verify /home/pi/vpn-config/crl.pem

What we are doing here is telling the ovpn file where to find your certificate and login details. (Sometimes the certificate is inserted into the OpenVPN file so you will not need to edit the line that starts with ca).

Step 6

Repeat the process of Step 5 to all the ovpn configuration files you want to use from within Kodi

Step 7

Once you have modified all the .ovpn/.conf files that you want to use it is time to move them onto your pi.(there are many ways to do this but the easiest way for those who really dont know is just to put the files on a usb stick (fat32) that way you can plug it into your pi).

On Kodi go into Settings->Appearance->File lists and make sure "show hidden files and directories" is checked. Next open the filemanager in Kodi, click on add source a window will pop up. Click "Root filesystem" it will open up lots of folders ignore this just press the OK box. It will now take you back, click on the box at the bottom where it says "Enter a name for this media Source" name it Root then click OK at the bottom

Step 8 (OpenELEC)

If you know what your doing the *.ovpn files you edited along with your pass.txt and the ca.crt need to be transferred onto you pi into /storage/.config/vpn-config if you dont understand this carry on reading this Step. On the Kodi file manager you should see the new source in window, which is called root, click on this on WINDOW A, on the left.

WINDOW A (LEFT SIDE)

  • click on: storage
  • click on: .config
  • click on: vpn-config
This folder will be empty but if you look under the big letter A you can see it is listed /storage/.config/vpn-config.

WINDOW B (RIGHT SIDE) next put in your (fat32) usb stick into your pi and wait a couple of seconds for the pi to recognize it and you should see it pop up in WINDOW B on the left side of your TV screen go into the location on the usb stick where transferred all of your edited ovpn files, your pass.txt ad the ca.crt file. bring up context menu over each of the files and select copy it will now appear in window A it is important that you copy all the files across including pass.txt ca.crt

Step 8 (Raspbmc)

If you know what your doing the *.ovpn files you edited along with your pass.txt and the ca.crt need to be transferred onto you pi into /home/pi/vpn-config (you will need to create the folder vpn-config)if you don't understand this carry on reading this step. On the Kodi file manager you should see the new source in window which is called root click on this on WINDOW A on the left.

WINDOW A (LEFT SIDE)

  • click on: home
  • click on: pi
Bring up context menu and create a folder, make sure that this folder is named vpn-config Now click on: vpn-config This folder will be empty but if you look under the big letter A you can see it is listed /home/pi/vpn-config

WINDOW B (RIGHT SIDE) next put in your (fat32) usb stick into your pi and wait a couple of seconds for the pi to recognize it and you should see it pop up in WINDOW B on the left side of your TV screen go into the location on the usb stick where transferred all of your edited ovpn files, your pass.txt ad the ca.crt file. bring up context menu over each of the files and select copy it will now appear in window A it is important that you copy all the files across including pass.txt ca.crt

Step 9 (OpenELEC)

Log into your Raspberry Pi using putty

username: root
password: openelec
We need to check your work so at the command prompt type:
openvpn /storage/.config/vpn-config/whatever_your_vpn_is_called.ovpn
So as the name of the vpn you edited so as we edited USMidwest.ovpn we would type
openvpn /storage/.config/vpn-config/USMidwest.ovpn
The VPN service should start, if it completed successfully you will get a message saying so and you will have to exit out of your ssh client

Step 9 (Raspbmc)

Log into your pi using putty

username: pi
password: raspberry
We need to check your work so at the command prompt type:
pi@raspbmc:~$ sudo openvpn /home/pi/vpn-config/whatever_your_vpn_is_called.ovpn
So as the name of the vpn you edited so as we edited USMidwest.ovpn we would type
pi@raspbmc:~$ sudo openvpn /home/pi/vpn-config/USMidwest.ovpn
The VPN service should start, if it completed successfully you will get a message saying so and you will have to exit out of your ssh client

Step 10

So if all is successful you now have a working VPN if you wanted to check that your connected to you vpn run the hub maintenance tool and there is a option to check you ip address and location. Anyway now we need to install the OpenVPN script it can be found here: http://brianhornsby.com/downloads/ (click on script.openvpn-?.?.?.zip)

Step 11

Once you have installed the script go to programs highlight the OpenVPN script and bring up the context menu and select addon-settings. We now need to tell the addon where the OpenVPN client is so it can run the script so on the first page click on the box where it says "openvpn" you will need to back up by selecting the .. or pressing the backspace key untill you can back up anymore. Select "Root file system" then select the folder "usr" select the folder "sbin" select "openvpn" and click ok in the box the path that should be writen should be /usr/sbin/openvpn. (Raspbmc ONLY) For Raspbmc you need to run the script using the sudo command so while in the addon setting move along to the second page called script and check the box that says "run openvpn using sudo" make sure the box underneath that says "password" in left unchecked.

Step 12

Now all that is left to do is import you ovpn files, in the addon-setting select import openvpn file and import your edited ovpn files, it will ask you to name them to what you want. once you have imported all the locations you want to use, run the addon and select your chosen location. to dissconnect open up the addon again and select disconnect at the bottom

Good luck and don't forget to keep a backup of all your edited files!!! The OpenELEC backup tool doesn't backup any of the content from the .config folder so I always manually take a copy of this folder that way its easy if anything happens to your system.

OpenVPN for XBMC Version 2.1.0

OpenVPN for XBMC Version 2.1.0

25 May 2014

New release of OpenVPN for XBMC.

The release contains an update to the XBMC Python version for Gotham. See GitHub for more details on the changes in this release.

Download: script.openvpn-2.1.0.zip

TuneIn Radio for XBMC Version 2.1.0

TuneIn Radio for XBMC Version 2.1.0

25 May 2014

New release of TuneIn Radio for XBMC.

The release contains an update to the XBMC Python version for Gotham and a couple of fixes. See GitHub for more details on the changes in this release.

Download: plugin.audio.tuneinradio-2.1.0.zip

TuneIn Radio for XBMC Version 2.0.5

TuneIn Radio for XBMC Version 2.0.5

12 October 2013

Hotfix release of TuneIn Radio for XBMC.

The release contains a fix for an issue causing certain streams to fail to play. See GitHub for more details on the changes in this release.

Download: plugin.audio.tuneinradio-2.0.5.zip

TuneIn Radio for XBMC Version 2.0.4

TuneIn Radio for XBMC Version 2.0.4

12 October 2013

New release of TuneIn Radio for XBMC.

The release contains a new setting to only display TuneIn favourites and added the ability to playback m3u playlists. Release also contains a number of bugfixes. See GitHub for more details on the changes in this release.

Download: plugin.audio.tuneinradio-2.0.4.zip

OpenVPN for XBMC Version 2.0.1

OpenVPN for XBMC Version 2.0.1

12 October 2013

New minor release of OpenVPN for XBMC.

The release contains a fix for an issue with the geo-location lookup returning an error. See GitHub for more details on the changes in this release.

Download: script.openvpn-2.0.1.zip

TuneIn Radio for XBMC Version 2.0.3

TuneIn Radio for XBMC Version 2.0.3

12 October 2013

Minor release of TuneIn Radio for XBMC.

The release contains a fix for an issue where headless control of plugin causes XBMC to freeze. See GitHub for more details on the changes in this release.

Download: plugin.audio.tuneinradio-2.0.3.zip

SimilarTracks for XBMC Version 2.0.1

SimilarTracks for XBMC Version 2.0.1

10 October 2013

New minor release of SimilarTracks for XBMC.

The release contains a fix for an issue with handling unicode characters. See GitHub for more details on the changes in this release.

Download: script.similartracks-2.0.1.zip

TuneIn Radio for XBMC Version 2.0.2

TuneIn Radio for XBMC Version 2.0.2

8 October 2013

New minor release of TuneIn Radio for XBMC.

The release contains a fix for an issue with parsing ASX files. See GitHub for more details on the changes in this release.

Download: plugin.audio.tuneinradio-2.0.2.zip

TuneIn Radio for XBMC Version 2.0.1

TuneIn Radio for XBMC Version 2.0.1

6 October 2013

I have released a new version of TuneIn Radio for XBMC.

The release contains a couple of fixes for issues raised with v2.0.0. See GitHub for more details on the changes in this release.

For this release I used the Git Flow branching model. To help me with this I used the Git Flow extensions.

Download: plugin.audio.tuneinradio-2.0.1.zip

OpenStreetMap for XBMC

OpenStreetMap for XBMC

3 July 2013

I have just created a new repository on GitHub called script.openstreetmap. This repository contains the code for an XBMC addon script that allows access to OpenStreetMap maps.

At the moment the script allows you to search for a location, move around the map and zoom in and out. Use the arrow keys to move around the map, page up/down keys to zoom in/out and the context menu key to bring up the search dialog.

At the moment I'm still developing the script on my systems (OSX and Ubuntu), but it seems to be working ok.

TuneIn Radio for XBMC Version 2.0

TuneIn Radio for XBMC Version 2.0

27 June 2013

It must be the cold weather that's keeping me indoors and coding, but I have committed a new version of TuneIn Radio for XBMC.

The changes are:

  • Add a station to XBMC favourites.
  • New icons.
  • Check to see if url provided by TuneIn redirects, if yes, use that url.
  • A couple of bug fixes.

I have also tagged and released the updates I made to my OpenVPN and SimilarTracks XBMC scripts.

Downloads:

SimilarTracks for XBMC Version 2.0

SimilarTracks for XBMC Version 2.0

22 June 2013

I seem to have got my XBMC addon coding mojo back recently.

As well as working on my OpenVPN addon I have also been working on my SimilarTracks addon. I have just committed to GitHub a new version of it. The code hasn't changed that much, just improved it and fixed some minor bugs.

Like my OpenVPN, addon at the moment I'm still testing the script on my systems (OSX and Ubuntu), but it seems to be working ok.

OpenVPN for XBMC Version 2.0

OpenVPN for XBMC Version 2.0

16 June 2013

I have just committed to GitHub a new version of my OpenVPN for XBMC script. It is a complete re-write of the existing code.

The major changes are:

  • The script now uses existing ovpn configuration files, rather than creating the file on the fly.
  • Uses the OpenVPN management interface to work out if a configuration is connected.
  • Checks the user wants to start the configuration, if OpenVPN is already running.

At the moment I'm still testing the script on my systems (OSX and Ubuntu), but it seems to be working ok.

Tools used to create this website

Tools used to create this website

15 June 2013

Until recently I haven't been doing much with this website. I just ran a wordpress blog, that I very rarely updated. Anyway, about a week or so ago I decided that I would give coding my own website a go.

You can now see the results. I'm still messing around with it, like creating this blog. Hopefully the fact I'm coding the website will keep me interested in it, and stop me forgetting about it.

I thought I would detail some of the tools I have used in the creation of the website.

Bootstrap
Web development framework.
Simple Icons
A free set of PNG icons with an accompanying list of colour codes. I used the Envelope, Github, Google+, LinkedIn and Twitter icons, which you can see in the main header for this site.
Font Awesome
Scalable vector icons. I used the download, code, apple, linux and windows icons.
Open Sans Font
Open Sans font commissioned by Google
Sublime SFTP
Sublime Text package that allows SFTP access to a remote server.
Sublime Text 2
Text editor for coding.