Ubuntu 14.04 – post-install enhancements for Trusty Tahr

Excellent coincidence that the release of Ubuntu 14.04 LTS (Trusty Tahr) fell into the Easter holidays. This gives me the time to install earlier than I normally have time for.

Trusty Tahr

This realease being a LTS (long-term support) release means it is a fairly conservative release. There are some nice enhancements and most importantly for me the 3.13 Kernel means finally Wacom Touch devices are supported without kernel mods.

Unfortunately some things are still not included (such as the boot-repair tools not being part of the standard repos).

Fortunately it’s relatively easy to fix most of these things.

Install core packages

One line to fix it (well – mostly …). This is a very personal & subjective list based on what I need all the time. Most things would not be relevant to casual users. Ignore at will.

sudo apt-get install -y vim chromium-browser filezilla owncloud-client gnome-gmail httrack keepass2 inkscape s3cmd putty openssh-server nfs-common fslint unoconv xsane libreoffice-base libreoffice-mysql-connector offlineimap pwgen getmail4 apache2-mpm-itk libapache2-mod-php5 mysql-client mysql-server php5 php5-mysql php5-common php5-xmlrpc php5-gd php5-common curl php5-curl php5-ldap php5-odbc php5-xsl php5-ldap php-pear libapache2-mod-wsgi python-django python-imaging python-pythonmagick python-markdown python-textile python-docutils python-mysqldb rapidsvn umit flashplugin-installer cups-pdf git gnome-schedule regexxer ubuntu-restricted-extras arduino gufw cifs-utils subversion sysinfo jobs-admin network-manager-openvpn network-manager-vpnc openjdk-7-jre openjdk-7-jdk icedtea-7-plugin bum mysql-workbench traceroute whois sublime-text bleachbit grive dia-gnome tintii calibre openscad pepperflashplugin-nonfree

NOTE: Since Chromium Flash plugin support is broken in 14.04 (due to Chromium killing Netscape Plugin API) you need to run the Pepper Flash install script to allow flash to play in Chromium.

sudo update-pepperflashplugin-nonfree --install

Adding ‘nice-to-haves’

Sublime Text

Currently my favorite text editor (even though the licensing is dodgy) – I also generally install ‘geany’ as well.

sudo add-apt-repository ppa:webupd8team/sublime-text-3


sudo add-apt-repository ppa:librecad-dev/librecad-stable

Opera Browser

The main reason is that sometimes I need more than 3 browsers at the same time (don’t ask – joys of web-dev) and Opera is my 3rd choice.

sudo vim /etc/apt/sources.list
#add the following repo
deb http://deb.opera.com/opera/ stable non-free
sudo apt-get update
#get keys
sudo wget -qO - http://deb.opera.com/archive.key | sudo apt-key add -
sudo apt-get install debian-archive-keyring


Get a real video player. See this blog.

echo 'deb http://download.videolan.org/pub/debian/stable/ /' | sudo tee -a /etc/apt/sources.list.d/libdvdcss.list && echo 'deb-src http://download.videolan.org/pub/debian/stable/ /' | sudo tee -a /etc/apt/sources.list.d/libdvdcss.list && wget -O - http://download.videolan.org/pub/debian/videolan-apt.asc|sudo apt-key add -


sudo echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

Note: At the time of writing this (2014-04-21) it is necessary to edit /etc/apt/sources.list.d/virtualbox.list and edit the first replacing ‘trusty’ with the ‘saucy’ repo as Oracle has not yet (and usually is very slow) updated their repo.

sudo apt-get update
sudo apt-get install -y opera vlc libdvdcss2 librecad google-talkplugin virtualbox-4.3 unity-tweak-tool gnome-tweak-tool compizconfig-settings-manager


All of these are personal: ‘unity-tweak-tool’ & ‘gnome-tweak-tool’ can be used to customise lots of UI aspects (I generally limit this as I don’t have time.

The main reason for installing ‘compizconfig-settings-manager’ is that I like to disable animations. Even on fast machinery it adds to speeding up the overall experience and reduce waste. I very much prefer speed over useless eye-candy. If you want to go the next step you might look ad installing a more lightweight flavour of Ubuntu (such as Xubuntu).

Adding latest stable versions

Since Ubuntu repos sometimes have quite old version of some popular projects I tend to use some PPA’s to get the latest stable versions.

These repos update the included versions of Gimp, VLC and some Gnome3 related tools (I don’t use Gnome 3 as such as I have made peace with Unity over the years and find it quite workable these days and don’t have the time to play around too much).

sudo add-apt-repository ppa:videolan/stable-daily
sudo add-apt-repository ppa:otto-kesselgulasch/gimp
sudo add-apt-repository -y ppa:gnome3-team/gnome3
sudo apt-get update
sudo apt-get install -y gimp vlc

Remove unwanted stuff

The main thing I always remove is the so-called ‘Amazon-Lense’ which includes Amazon search results in the HUD display in th UI. The easiest way I have found is to remove the ‘webapps’ feature. This is a bit of a sledgehammer approach as it removes other webapps, but I have always found these very annoying – so it suits me to remove the lot. However you can also disable the feature in the ‘System settings’ UI.

I also remove Empathy & Thunderbird as I have no use for local utils. All my mail and calendars are stored on remote servers as I use a number of devices and have no time for synchonisation hell …

sudo apt-get remove --purge unity-webapps-common evolution evolution-indicator empathy empathy-common thunderbird xul-ext-unity unity-chromium-extension
sudo update-desktop-database

Disable remote search scopes

Removes the online searches from the HUD.

gsettings set com.canonical.Unity.Lenses disabled-scopes "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']"

Normal scroll bars

gsettings set com.canonical.desktop.interface scrollbar-mode normal

Fixing UEFI Secure Boot problems on Ubuntu 14.04

Unfortunately the mess that is UEFI Secure Boot still causes issues on some hardware. In my case it’s a Toshiba Z930 Ultrabook. I have documented the procedure to get it working here.

However it turns out that there is no ‘Trusty’ release for the boot-repair utility. The fix is relatively easy.

sudo vim /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.list
#change the following line from 'trusty' to 'saucy'
sudo vim /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.list

You can then just finish with
sudo apt-get update
sudo apt-get install -y boot-repair && (boot-repair &)

Another option is to boot off a USB image (or CD) created from http://sourceforge.net/p/boot-repair-cd/home/Home/.

Apache Cordova development environment install on Ubuntu

Apache Cordova has very nice documentation, however as so many projects it is focused on the Windows/MacOS duopolies only. Fortunately it’s not too hard to work out the differences.

Apache Cordova Logo

Installing dependencies

Thanks to: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

sudo apt-get install python-software-properties python g++ make ant

Installing Android SDK

Please note: one of the problems I found was that I had some Android tools from the Ubuntu repos that were conflicting with the SDK install. It’s probably a good idea to remove them first. That might save you from a lot of headaches down the line (and time to troubleshoot).

sudo apt-get remove android-tools-adb android-tools-fastboot

Download as per http://developer.android.com/sdk/index.html

wget http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz

Note: check for updated link version obviously

vim ~/.bashrc

Add the PATH variables to the top of the file

#AndroidDev PATH
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools

Reload bash variables without reboot / logout

source ~/.bashrc

Testing SDK


This command should now bring up the SDK manager.

Installing Eclipse IDE

This is obviously an optional step depending on the IDE you want to use. I have previously covered a manual Eclipse install (as opposed to the Ubuntu repositories).

Install Eclipse ADT Plugin

As per: http://developer.android.com/sdk/installing/installing-adt.html

Node.js Install

The main difficulty on Ubuntu (as with so many development tools – see Eclipse above) is that the included node.js version in the Ubuntu repositories is outdated (remove the Ubuntu version with ‘sudo apt-get remove node’).

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install python-software-properties python g++ make nodejs

Install Cordova

sudo npm install -g cordova

Check Cordova Requirements

This will check for Android SDK installation, Ant and other dependencies – saving you going through error messages later.


Create Cordova Project

mkdir ~/projects/PROJECTNAME
cd ~/projects/PROJECTNAME
cordova -d platform add android
cordova build

Create Eclipse Project

Open Eclipse
Create New Android project from existing sources
Import ~/projects/PROJECTNAME/platforms/android
Test in emulator by right clicking the project and selecting “Run As –> Android App”

RaspberryPi real-world control with REST API

Finally found some time playing with a RaspberryPi and an attached PiFace Interface board to control some garden pumps and potentially an Aquaponics setup in the near future.

PiFace board


Base Raspian (Debian Wheezy) Install (I prefer the clean minimal install via https://githutb.com/hifi/raspbian-ua-netins).

Configure the base system as per my previous base install.

Install Apache & PHP

sudo apt-get install apache2 php5 php5-dev php5-cli php5-mcrypt curl raspi-config

Ensure mod-rewrite is enabled

sudo a2enmod rewrite

Install PHP SPI Extension

More info: https://github.com/frak/php_spi

git clone https://github.com/frak/php_spi.git
cd php_spi
./configure --enable--spi
make test
make install

Install PiFace REST API

cd /var/www/
git clone https://github.com/natefanaro/piface-rest-api
cd piface-rest-api
curl -sS https://getcomposer.org/installer | php
php composer.phar install

Thanks to Nate Fanaro for the excellent work on the API.

Make sure SPI is enabled on the RPi


Advanced Options –> A5 SPI –> yes

Install PiFace Modules

sudo apt-get install python3-pifacedigitalio python-pifacedigitalio
sudo usermod -a -G gpio www-data
sudo usermod -a -G spi www-data

For more info visit http://www.piface.org.uk/guides.

Apache2 API Configuration

Enable SPI extension

sudo vim /etc/php5/apache2/php.ini
#add the following extension

Apache VHost config

sudo vim /etc/apache2/sites-available/piface

Paste the following VHost config

<Virtualhost *:80>
ServerAdmin webmaster@domain.com
DocumentRoot /usr/share/piface-rest-api/public_html
ErrorLog /var/log/apache2/piface_error.log
CustomLog /var/log/apache2/piface_access.log combined
<Directory />
AllowOverride All
Order allow,deny
Allow from all

Enable the newly created VHost

a2ensite piface
service apache2 restart


curl http://HOSTNAME/led/test/

Next up will be some modification for securing access to the PiFace REST API via some sort of API Key or digital certificate as it’s open by default at the moment.

Getting Foscam IP Cameras to work from Linux (Ubuntu)

As with most hardware manufacturers of hardware Foscam utility software is Windows or Mac only. The actual unit tested with the below is a FI9805E Outdoor POE camera.

Foscam Outdoor Cam


The installation is relatively painless as the unit is set up to get the IP assignment via DHCP (check your routers DHCP assignment list).


should get you to the web-admin interface. The default user is ‘admin’ with no (empty) password.

Taking snapshots


I had some issues with the color of the images in daylight (which for an outdoor camera is not really a good thing. A Firmware update (V2.14.1.5) improved this (you can disable the IR LEDs during daylight hours). Thanks for FOSCAM UK support via Twitter I found the download URL as the main site seems to have been down for a while.

Firmware URL: http://foscamuk.co.uk/downloads/

Streaming in H.264 video

The easiest way to get the stream appears to be the RTSP connection (using VLC or any network video player). MXPlayer on Android works very well too.


Streaming in MPEG mode

The be able to use the MPEG streaming the stream format needs to be set first.



Resetting back to H264:


Next steps will be to make this work from a headless device with an Amazon S3 storage backend. This Github project https://github.com/phil-lavin/Foscam-FI8908W-Recorder is looking promising.

Watch this space.

Automatically posting GooglePlus articles to Twitter

I have switched most of my Social Media postings to Google+ over the last year. Despite popular opinion being that Google+ is some ‘ghost town’, I find G+ the most useful environment for my particular needs & interests (specially since the introduction of groups). It has in my experience a vastly better signal-to-noise than other social media in particular Facebook.

RSS Logo

However I would still like to feed postings through to my Twitter stream. Unfortunately Google has (stupidly / purposely / nastily) not included RSS support to make this possible without much work. There are a few publicly accessibly services out there, but they generally are either not updated or tend to fail very frequently as they hit the API Access limits as soon as they get a few users on their services.

To achieve this I have created a PHP script utilising the Google API Client to convert the public activities to a standard RSS feed. The code is available on GitHub. I used to use a script by by Michael Mahemoff (https://plus.google.com/106413090159067280619/posts/8NE3cFi4cB6) – thank you ! The main reasons for needing to change were IFTTT having issues with the initial script output (not valid RSS and illegal characters).

Create API Project

  1. Go to https://cloud.google.com/console/
  2. Create a project
  3. Go to ‘APIs & auth’ –> ‘APIs’ and turn “Google+ API” on (see Screenshot below)
  4. Go to ‘APIs & auth’ –> ‘APIs’ and create a ‘Public API access’ key (see Screenshot below)
  5. Copy the API Key for the next step

Enable Google+ API

Enable Google+ API

Create API Key

Create API Key

Setting up the RSS Feed

  1. Copy files from Github repository to your website (either by downloading the ZIP file or cloning the repository
  2. Change your Google User ID and your API Key (from the previous step) in gplus2rss.php
  3. Test the feed on your YOURWEBSITE/gplus2rss.php (and copy the URL for the next step)

You can then use the standard IFTTT RSS Feed trigger to post to a Twitter Channel to automatically update Twitter anytime you post to Google+.

Setting up IFTT

  1. Create a new IFTTT recipe here: https://ifttt.com/myrecipes/personal/new
  2. Choose the ‘Feed’ trigger
  3. Choose the ‘New Item’ to trigger the recipe whenever a new item appears in your GPlus feed
  4. Paste your feed link and click on ‘Create Trigger’
  5. Click on the ‘that’ link to create the action
  6. Paste your feed link and click on ‘Create Trigger’
  7. Choose ‘Twitter’ icon and choose ‘Create new Tweet’ as the action
  8. Paste your feed link and click on ‘Create Trigger’
  9. Choose the fields from the feed (see screenshot below)
  10. Finish off by clicking the ‘Create Recipe’ button
IFTTT Choose Feeds

IFTTT Choose Feeds

Edit files on remote host via SSH

Whilst most commandline editors have the ability to edit files on a remote host directly this can get messy sometimes when there are multiple files involved. Mounting the remote folder via SSHFS seems to be more reliable in practical use.


sudo apt-get install sshfs
sudo addgroup USERNAME fuse
sshfs remoteuser@remotehost:/remote/path /local/mountpath


fusermount -u /local/mountpath

Ubuntu Touch install on Nexus 4

This is the last of a series of alternative mobile OS installs and the easiest install by a country mile !

Ubuntu Touch Logo


Everything is quite well documented here: https://wiki.ubuntu.com/Touch/Install.

sudo add-apt-repository ppa:phablet-team/tools
sudo apt-get update
sudo apt-get install phablet-tools android-tools-adb android-tools-fastboot
phablet-flash ubuntu-system --channel devel --bootstrap

That is it really ! This is how a OS change on a mobile should work !


Ubuntu touch can not yet handle the radio firmware past Android 4.3 devices. So if your N4 was upgraded to Android 4.4 (KitKat) you need to flash the radio to the Android 4.3 (up to Version 2.0.1700.84) else WIFI will not work.

Download 4.3 Stock Image from: https://developers.google.com/android/nexus/images#occamjwr66y

fastboot flash radio fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.84.img
fastboot reboot

Wifi setup

(Optional – this can be done via phone UI as well). Connect the phone via USB

adb shell
nmcli -pretty dev wifi connect NETWORK-NAME password PASSWORD

Making VIM the default text editor on Ubuntu

In my never ending quest to find the ideal text editor here is another installment. Since I have been using VIM as my default command line editor for years I thought I give it a try for basic GUI editing as well.

VIM Logo

Install and set desktop app & icon

sudo apt-get install vim vim-gnome
sudo wget --output-document=/usr/share/applications/gvim.desktop https://raw.github.com/leogaggl/misc-scripts/master/gvim.desktop
sudo wget --output-document=/usr/share/icons/hicolor/scalable/apps/gvim.svg http://gfxmonk.net/images/vim-logo/vim-logo.svg
sudo update-desktop-database

Set MIME defaults

vim ~/.local/share/applications/mimeapps.list
#add or edit the following mime type and add others as needed

Install FirefoxOS on Nexus S (GT-9023)

I just had one of my old hand-me-down phones returned by my offspring in a great condition (junior is very careful with his equipment – well done young man !). This doesn’t happen all too often shows that the Nexus S is a decently built phone. This is also a good example of breaking the built-in obsolescence of modern phones. This particular unit has served me well for nearly 2 years (my average is one year) and served 2 kids after that.

These instructions have been compiled on Ubuntu 13.10 64bit to allow me to re-do this process in future. It should work on any Linux based distro (see pre-requisites) – if you are using another Operating System it might be time to switch. Hopefully it might be useful for other people as well.

Installing pre-requisites

As per https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Linux_Prerequisites

wget https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py
python bootstrap.py

Ubuntu 13.10 additions

As per https://developer.mozilla.org/en-US/Firefox_OS/Firefox_OS_build_prerequisites#Ubuntu_13.10.

sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git lib32ncurses5-dev lib32z1-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip libxml2-utils
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 1
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 2
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 1
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 2
sudo update-alternatives --set gcc "/usr/bin/gcc-4.6"
sudo update-alternatives --set g++ "/usr/bin/g++-4.6"

Check out & build Firefox OS

git clone git://github.com/mozilla-b2g/B2G.git
cd B2G
echo "export HIDPI=1" > .userconfig
./config.sh nexus-s
./build.sh -j3

The config script will take quite some time depending on your internet connection as it has to download a lot of data. The build time will depend on your machine. In my case it took xx hours for the config and yy hours for build.


I had the following error with the config script: https://bugzilla.mozilla.org/show_bug.cgi?id=956098 (workaround contained in comments).

Install on the phone

NOTE: Before doing this you obviously want to backup your phone & data if you have anything useful on there (in my case not necessary).
NOTE: Before doing this step you need to ensure that the Nexus S bootloader is unlocked

  1. Reboot the Nexus S into bootloader mode by pressing volume up + power buttons simultaneously until you see the bootloader screen
  2. Connect the device to the PC via the USB cable
  3. Check the line “LOCK STATE – LOCKED”

If the unit is locked you can unlock it by issuing the following command
fastboot oem unlock
And use the VOLUME key to select + the POWER key to confirm/

Flash the phone



FirefoxOS Home Screen

Or you can do it manually by using fastboot to copy the images

fastboot erase boot
fastboot erase system
fastboot erase userdata
fastboot flash userdata userdata.img
fastboot flash system system.img
fastboot flash boot boot.img
fastboot reboot

For the people that don’t want or can not (time to upgrade your OS!) build I have uploaded the resulting images (Build Date: 2014-01-20) to GoogleDrive. As usual this comes with a warning – proceed at your own risk !

If you want to return back to the factory Android ROM you can find the Google images here: https://developers.google.com/android/nexus/images

Now this unit will serve as a secondary phone (being compared against Ubuntu Touch on a Nexus N4) while Overseas where I generally need 2 phones.

Thank you Mozilla foundation for all the work and making it available fully in Open Source ! If you haven’t done so it’s time to join here: https://sendto.mozilla.org/

FirefoxOS Browser

Thank you to Google for NOT making it harder than necessary to extend the usefulness of their NEXUS range of phones and tablets. And in the same breath curse you SAMSUNG, APPLE, … ! The reason for me moving phones actually was the fact that the Galaxy S4 is such a P.I.T.A. to get upgraded and get rid of the Samsung bloatware. Back on the Nexus range – in hindsight I should have never left.