How to setup VPN connection Oxford University Ubuntu (Linux)

I needed to connect to Oxford University via a VPN connection from my Ubuntu 13.10 laptop.  They have some instructions by they are quite complicated and not very clear. Here is how I did it:

1 – Install a Cisco compatiable VPN Client
Oxford University uses the Cisco VPN. You can install this directly from the repositories.

sudo apt-get install network-manager-vpnc vpnc <code>network-manager-vpnc-gnome</code></pre>
<pre>

2 – Update the VPN service

sudo nano /etc/dbus-1/system.d/nm-vpnc-service.conf

Add a new policy before the </busconfig>

<policy at_console="true">
     <allow own="org.freedesktop.NetworkManager.vpnc"/>
     <allow send_destination="org.freedesktop.NetworkManager.vpnc"/>
</policy>

You can save and close nano by ctrl-o (for saving files) and ctrl-x (for exiting).

3 – Get the settings…
Go to https://register.it.ox.ac.uk/self/index and follow these steps to get the settings. Note: you will need to login using your account details (these will be the same as your emails etc).

Login then select “Register for and download site-licensed software (Sophos, VPN)”

oxford_university_vpn_ubuntu_step1

Select “VPNC Client for Linux/Unix”

oxford_university_vpn_ubuntu_step2

Client the “vpnc configuration file”

oxford_university_vpn_ubuntu_step3

… and up pops this window.

oxford_university_vpn_ubuntu_step4

You will need all this information for the following steps.

4 – Configure the VPN Connection Locally

Click on the network icon at the top right of the screen.  Select VPN connections -> Configure VPN…

configuring_vpn_connections_ubuntu

In the Network Connections dialog box – click “Add”

vpn_connection_add

Select “Cisco Compatitble VPN (vpnc)”.  It you can’t see this option then you need to go back and install the VPNC client.

vpn_choose_a_connection_type

Fill in the fields as show below.  You will need your University login and also the setting which we found before.

oxford_university_VPN

Then click “Save”.  You can connect…

5 – Connect…

Click on the network icon and under “VPN Connections” – select the VPN connection that you have just created.  The network icon will pulse and you should see this icon:

Selection_012

Let me know if this works or doesn’t work for you.

Happy VPN’ing.

Ansible Diff Function

Ansible is a great tool for configuring servers. I only recently discovered the Ansible diff argument which can be used to check what changes are going to be made for a file. If you use this with the –check flag you can see what changes will be applied. I find this especially useful when coming back to a project after a break.

ansible-playbook paybook.yml –check –diff –limit my.example.com

You can read the Ansible docs on this here:

Awesome.

How to get Airplay to work on a ddwrt router

I just brought an Airplay device (an Audio Pro Allroom Air One) because I wanted to stream music from my iPhone and Synology NAS.

I followed the installation instructions and connected the Airplay device to the network. The device appeared as an option when playing music on the phone. However, the streaming started and after about 5 seconds the network crashed and music stopped playing.

I logged into the router and checked the signal strength:

Airplay device on dd-wrt network
Airplay device on dd-wrt network

I knew it was a network crash because everything got kicked off. My Ubuntu laptop, the Airplay device and the phone all lost network connection.

The Solution

Step 1 – Disable the SPI Firewall.
On your router, go to Security -> Firewall. Disable the SPI Firewall, save changes and then apply them.

Disable the spi firewall on dd-wrt router to get airplay to work on network.
Disable the spi firewall on dd-wrt router to get airplay to work on network.

Step 2 – Change Network Security from WPA (TKIP) to WPA (AES)
Some of posts on Apples website suggest that changing from TKIP to AES will reduce the network crashes and this seems to be the case for me. To change this setting go to Wireless -> Security and select AES. Then save and apply changes. I found that I had to reconnect the AudioPro device to the network after making this change.

change_wireless_security_protocol_to_aes

Step 3 – Enable JIFFS2
I have no idea why enabling jiffs2 would make a difference but it seems to. On the router, go to Administration -> Management and stroll near the bottom to enable jiffs.

how_to_enable_jiffs2_on_ddwrt

Selection_010

Does this work for you?
If this works for you or if you find another way to stop Airplay freezing / killing your network then please let me know by leaving a comment.

How to test if Bacula-fd is running

I just installed a new Bacula client but for some reason the server could not connect to it. I found this out by trying to get the status of the client on the server with the following command:

sudo bconsole
status client=my.client-rd

Here is the things that I checked on the server.

Step 1 – Check that the service bacula-fd is started:

sudo service bacula-fd status

Step 2 – Check the bacula-fd process is bound to the port 9102

sudo netstat -an|grep 9102

Step 3 – Check that you can telnet into the client port from the server.

telnet ip.ad.dr.ess 9102

I found the the client configuration did have the correct client ipaddress but each of these checks enabled me to narrow down the problem.

The Teamviewer daemon is not running – please start the daemon ubuntu

I have just started using Teamviewer on Ubuntu 13.10 to help a few people setup some software on their computers. When I try and launch it pops up a dialogue saying:

The TeamViewer daemon is not running!

Please start the daemon (needs root permissions) before running TeamViewer

teamviewer –daemon start
….

Trying “sudo teamviewer –daemon start” doesn’t actually do anything – so the solution is to:

sudo teamviewer --daemon enable

php ini_set(“memory_limit”) isn’t working at all

If you are trying to set your php memory limit at the top of a php script using the php int_set() and it doesn’t appear to have any affect then there is a chance that you have the PHP Suhosin security extension installed. Suhosin stops a script from being able to increase the memory limit.

If you have the Suhosin extension installed then simply edit /etc/php5/conf.d/suhosin.ini and change:

;suhosin.memory_limit = 0

To:

suhosin.memory_limit = 1G

Or however much memory you would like to allow for the script. Then restart nginx / or apache.

sudo service apache2 restart

Note – if you use int_set() and attempt to set a higher memory limit than allowed in the suhosin settings then it will no have any affect at all.