How to get a Raspberry pi to use WiFi to connect to eduroam on a (UK) University Network

This is based on a tutorial from the University of Southampton (YouTube)

To enable eduroam
Open a terminal and type;
sudo leafpad /etc/network/interfaces
 
This will open the interfaces file in leafpad, edit this file to look something like below where we have set wlan0 to use wpa_supplicant
 
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and ‘man dhcpcd.conf’
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
 
auto lo
iface lo inet loopback
iface eth0 inet manual
 
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
 
Next, in a terminal type;
sudo leafpad /etc/wpa_supplicant/wpa_supplicant.conf
 
Edit this file as below
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
 
network={
identity=”username@stir.ac.uk”
password=”your_network_password”
eap=PEAP
phase2=”auth=MSCHAPV2″
ssid=”eduroam”
pairwise=CCMP
key_mgmt=WPA-EAP
}
Reboot the pi and check that wifi is working and you’re connected via eduroam

Setting up SSH and VNC on a Raspberry pi 3

This is based on my experience with a Raspberry pi 3 running Raspbian Jessie.

Setup SSH
 
In Raspbian Jessie ssh may already be enabled by default but if not open a terminal and type
sudo raspi-config
select 7 Advanced Options
select A4 SSH
You’ll be asked if you want enable SSH Select Yes.
To find the IP address of you pi open a terminal and type:
hostname -I
On another computer open terminal(Linux) or command line in Windows, I’m using Ubuntu and type;
ssh pi@<YOUR Raspberry Pi IP ADDRESS>
It will prompt you for your password. NOTE: the default password for the user pi is raspberry, you can now change this.
 
Now install VNC Server on the Raspberry pi
Open Terminal, and type:
sudo apt-get install tightvncserver
To start VNC Server, type:
tightvncserver
You’ll be asked to set a password to access the pi. You’ll need this when you try to access the pi from another computer.
To run VNCServer at Startup
You will normally want the VNC Server to run automatically after the Raspberry Pi reboots, open a terminal and type:
cd /home/pi
cd .config
mkdir autostart
cd autostart
Create a new autostart file for TightVNC by typing the following:
sudo leafpad tightvnc.desktop
This will open the default text editor (leafpad) with a blank file called tightvnc.desktop Edit the contents of the file with the following text:
[Desktop Entry]
Type=Application
Name=TightVNC
Exec=vncserver :1
StartupNotify=false
Connecting to Raspberry Pi via VNC
 
On another PC open Remina (or other VNC Client)
server address is IP-Address-of-Your-pi:1 (note :1 which defines display 1)
Username is pi
Password is: whatever you set for Tightvnc
You should now have a VNC connection to your pi.
This is all fine if you want to run the pi headless and administer it remotely but, if like me you want to run a pi with a monitor attached as a display sign for example then you will need to be able to display the same monitor output on both HDMI and VNC. Remember from above the pi was displaying session :0 and VNC displayed session :1
To achieve this I used X11VNC rather than TightVNC
 
Install X11VNC
Open a Terminal and type:
sudo apt-get install x11vnc
x11vnc -storepasswd
As with TighVNC before we need to set X11VNC to autostart in a terminal type:
cd /home/pi
cd .config
mkdir autostart [You can miss this step if you’ve already created the directory]
cd autostart
sudo leafpad x11vnc.desktop
Type the following text into the x11vnc.desktop file:
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=
Exec=x11vnc -forever -usepw -display :0 -ultrafilexfer
StartupNotify=false
Terminal=false
Hidden=false

Note: If you created an autostart file for TightVNC as above, then remember to either remove this file from the autostart directory or delete it, otherwise when you reboot your pi it will try and start both TightVNC and X11VNC.

You should now be able to connect to your Raspberry pi using your VNC client with the IP address of your pi (without the :1) and it should display the same output as the Rasperry pi HDMI monitor.

 

How to get Google Play music in the UK for Ubuntu & Android

Update: Google Play is now available in the UK. Here’s how to use it in Ubuntu. And here’s  a guide to tweaking the desktop app Nuvola.

Google Play, formerly Google Music is only available in the US at the moment presumably for licencing reasons. But it is possible to get it outside the US in a variety of ways. Basically you have to trick the Google Play site into thinking you are actually in the US so you can register with your normal Gmail account. There are numerous tutorial on the web detailing how to do this so I’m not going to repeat everything here, I’m just going to recount what I tried and what eventually worked for me.

I wanted to be able to access my music from my Android mobile with Google Play and upload my music to the cloud from my Ubuntu PC. To do this you’ll need the Play Music app for Android, but since it’s not available outside the US the easiest way to get it is from the xda-developers site, download to your phone then install the apk file following this method. To upload your music you need the Google Music Manager, there was a copy on the xda-developers site  but this was the Windows version so I decided to wait till I’d registerd with play.google.com and download their Ubuntu 64bit version.

The simplest thing I tried first was some free proxy services like Hide My Ass and TunnelBear which effectively allows you to surf anonymously so web services cannot detect your true IP address. I tried a couple of these services but didn’t have any luck. I then followed the tutorial on  Engadget.com which recommended using the Tor Browser Bundle. Tor sets up a secure internet connection for you and by using the browser (a modified version of FireFox) included you should be able to connect with play.google.com. Unfortunately everytime I tried this approach I got suck on the T&C agreement stage and the browser just seemed to hang there.

Finally I found an approach that did work, TunnelBear have just released an Android app to allow you to set up a secure connection and select whether you’re in the UK or US. By selecting US all sites you visit will believe you are actually in the US. next thing to do was open a browser and go to  play.google.com and sign in with my usual Gmail account details, agree to the T&C and bingo I had now registered .

Back on my PC and using my normal WiFi connection I logged into play.google.com and proceeded to download the music manager which you’ll need to upload your music to the cloud.

So now all I have to do is spend ages uploading music to the cloud as it is by all accounts a very slow process.

Download music from Amazon in Ubuntu without using the Amazon Downloder

I’ve bought downloaded MP3s from Amazon on many occasions but was always annoyed to have to use their downloader so I was interested to find an open source alternative called Clamz in the Ubuntu 10.10 repositories. First install Clamz through Synaptic or sudo apt-get install Clamz if you prefer in a terminal.

Next, buy your MP3s on Amazon as you would normally, you will then be directed to a page telling you to download and install their downloader, assuming you don’t have it. Skip to the bottom of the page and look for the phrase “If you have already installed the latest Amazon MP3 Downloader, click here to enable it for use with this browser.” Click the link and now your browser should save the Amazon file in your Downloads directory.

As Clamz is a command line program you need to open a terminal and run the following command where ****** is the number sequence of the Amazon file.

clamz -d ~/Desktop AmazonMP3-******.amz
This will unzip the MP3s in the download to your Desktop.

Get an additional 1.7Gb Storage Free from Dropbox

I, like many people have the basic free version of Dropbox which provides a very useful 2Gb of cloud storage but with a few clicks you can increase this to 2.7Gb. Read the Lifehacker posts here and here. Recently the Dropbox team launched a scavenger hunt offering up to an additional 1Gb storage for free although this does require a bit more effort, unless you want to follow some of the walk throughs already posted.

If you don’t have a Dropbox account yet head over to Dropbox and sign up for the free 2Gb account then follow the Lifehacker tips above to get an additional few Mbs with a few clicks. Once done you can start the scavenger hunt by heading over to https://www.dropbox.com/dropquest2011 There are twenty nine steps in total and you cannot skip any unfortunately. have fun.

How to: Get Thunderbird to work with MS-Exchange server in Ububtu

Ever since Ubuntu 7.06 I’ve been using it on my companies corporate LAN and managed, after some digging around to get Evolution to connect to MS-Exchange server and manage all my mail, calendar and contacts. I am now using Ubuntu 8.04 and all was well until a couple of days ago, all of a sudden Evolution started crashing and even crashed X-server. Next thing I knew I could not get Evolution to connect to MS-Exchange at all it kept returning an error Could not authenticate to server (password incorrect?)“. At first I put this down to a recent update for Evolution and did some digging around the forums, I found that many others had the same problem but there were no apparent solutions. I then read a few posts which suggested that Evolution did not work with Exchange server 2007, a quick check via web access to my mail and it certainly appeared that my company had updated from Exchange 2003 to 2007.

I had tried to use Thunderbird in the past but it connects to MS-Exchange server using IMAP and this was not available, so I was left with Evolution which connects using Outlook Web Access (OWA) and this was working fine…till now.

I tried everything with Evolution but eventually gave up, I did however discover an open source alternative in development called OpenChange which has an Evolution plug-in due for release in Gnome 2.24 so I might go back to this.

I thought it was a long shot to try Thunderbird again but if the Exchange server had been upgraded then perhaps IMAP connections were now possible, so here’s what I did.

There is a good explanations of the basics at downloadsquad.com, blog.indigio.com and McGill university. some of which I’d followed the last time I tried to use Thunderbird.

In Thunderbird select File>New>Account (if it hasn’t already prompted you to do so) and select new Email account, fill in your name (I used my LAN user name here) and email address. Next select IMAP as the server typeserver type, you only have the choice of POP or IMAP anyway. That’s the basic account set up, now you have to configure the server settings etc. Click on the account name in the left pane then select view settings for this account in the right pane. This gives you a whole load of things you can configure for your mail account but first thing to do is select server settings. Here make sure your server name is correct, usually something like mail.company.com. Under security settings the settingsguides I’d read previously recommended setting this to ‘Never‘ but this just didn’t work for me so I tried ‘TLS, if available‘ and bingo, it worked. All the other settings are up to you. You’ll also need to input the correct address for the outgoing SMTP server. In my case I got this by going back into MS-Outlook and in the mail account properties you’ll see the server name. Also in my case this requires a user name in the security and authentication section and again I chose ‘TLS, if available‘. That is the basics of the account set up now I had to select which folders on my Exchange account I wanted to view. I did this by right clicking on the account name in the left pane of Thunderbird  and selecting ‘subscribe‘ all being well this should open up a window showing all the folders available, just check those you want and click OK. I now had access to my Exchange inbox, sent and deleted folders.

The next stage was to get the global address book connection. In Thunderbird click on Address book then select File>New>LDAP Directory. global address bookThen fill in the details, I called mine ‘global address list’ the host name is usually the server name where your global address book (gab) is located, again this can be found out by going back to Outlook in Windows and looking at the properties of the global address book. So for example if the address was gabserver.ad.company.com then put gabserver in the Hostname box. In the Base DN box the rest of the address is added in the following format dc=ad, dc=company, dc=com The Bind DN is your DOMAIN\username and the port number defaults to 389 but this did not work for me, on blog.indigio.com they suggest port 3268 which did work for me. You should now be able to search the global address book and you’ll be asked for your password. You should also set up the global address book in the auto complete section in Edit>Prefernces>Addressing check the Directory Server box and you should see the address book you created before in the list. This means that as soon as you start to type a name in an email address bar Thunderbird will search your global address book for possible matches to auto complete.

Because I’d been using Evolution for some time I’d backed up a lot of email locally (~8000) as we have mailbox limits here so now I needed to get those into Thunderbird. I thought I’d just have to import but it wasn’t quite that simple. Thunderbird needs a plugin called MboxImport to be able to import emails in the Mbox format. Once this is installed it’s fairly simple though, select Tools>Import/Export in Mbox/eml format then point to the local directory where Evolution stores your mail (usually Home/Name/.evolution/mail/local), that’s it.

But what about the calendar? I here you ask, good question and so far it has me stumped. Thunderbird has a good calendar available as an Add-on called Lightning lightningbut getting this to connect to the calendar on MS-Exchange is another matter and one I’m still struggling with. There is a solution posted at blog.indigio.com but this involves direct access to the mail server which I don’t have. I tried a few things like logging onto my mail through Firefox (OWA) right clicking on the link for the calendar looking at properties and using this address to set up a new calendar in Thunderbird. Click the Calendar icon in the bottom left then right click in the left pane and select New Calendar>On My Network>Next. There are three options ICS, CalDav and WCAP, none of which worked for me at all, but  you may have more luck. I’ll keep looking and maybe I’ll find a solution or maybe if the Evolution plug-in is finished soon I may go back to Evolution. I have to say that given a choice I’d go for Thunderbird over Evolution but the fact is whichever one I can get to work with MS-Exchange is the one I’ll go for and for the time being that is Thunderbird, albeit without a calendar connection.

Loading image

Click anywhere to cancel

Image unavailable

Some of Googles ‘hidden’ functions

Here are some other useful things you can do with Google that may not be immediately obvious.

Essential Tools, Sofware and Resources

I’ve been bookmarking sites with lists of essential resources for some time now, some are lists of open source software, others to resources with hosts of information for web designers etc. All of them are useful and help you find resources and software you may not have previously known about. So this is a series of links to many of the lists I’ve found useful recently.

Ubuntu Linux on an Ageing IBM Thinkpad

A couple of years ago I put Ubuntu 5.04 on my old IBM Thinkpad 390X, it worked sort of OK but the sound was all messed up amongst other things so I gave up and went back to Win 2K. Recently I decided to have another go with Feisty (7.04), I had to use the alternative CD as the live CD required more RAM than the system could provide. As in most cases the installation went without a hitch and the poor sound, as well as some other other previous problems were now OK. Since the last try I had installed a wireless network and I really didn’t have any expectations of getting this to work. As expected Ubuntu didn’t even ‘see’ the installed PCMCIA wireless card that Win 2K worked with. But, I also had an old 3Com USB wireless stick (3CRUSB10075) lying around which I hadn’t been able to get to work on any PC or laptop running Win XP or Win 2K, so I assumed it was knackered, but what the hell I thought give it a go. Plugged it in and ‘bingo’ Ubuntu network manager popped up, saw the stick and promptly asked if I wanted to connect to my wireless network, success! I was even more surprised that this was a bog standard installation of Ubuntu with the included network manager plus I was using a previously useless USB wireless stick. This time I think Ubuntu is going to stay on my old Thinkpad 390X