Thursday, November 3, 2011

Living in the cloud

These days many people own multiple internet enabled devices and it's becoming important to keep this data in sync across your phone, laptop, desktop and tablet.  This is not only necessary for convenience but also because the personal data, like photos, contacts and documents, is increasingly becoming a very big part of people's lives and backing this data up is essential.  Fortunately there are a bunch of services that make this super easy.  So here is a list of the best apps for simplifying your digital life and keeping all your precious data safe.

Email
What to use: Gmail
Gmail is awesome, email, contacts, phone calls, video conferencing, great search and lots more all from your browser.  If you're not using Gmail already you should be.  It's free to get a gmail address and access their services, you can even use your own domain if you don't want an @gmail address.  Also you get a massive amount of storage so you'll never need to delete an email, it also automatically filters spam and viruses.

What not to do:
Do not use the free email account(s) you get from your ISP.  Aside from making you look silly it's just bad practice to tie your email address to your ISP.  What will you do if you want to change providers or move?

Contacts
What to use: Gmail + Android
There is a lot of heated debate on the internet about iOS vs Android but one place where Android is definitely ahead of the curve is cloud services.  It integrates seamlessly with your Gmail, contacts and calendar.  So if you add a contact on your phone it is instantly in your Gmail account, likewise, if you add an event to the calendar in Gmail it will instantly appear on your phone's calendar.  If you lose, upgrade or reset your phone just sign in with your Gmail account and all your contacts, email and events will be there.

What not to do:
Don't keep your contacts all on a single device, like your phone, or spread across several devices with no centralised backup.  What's your plan if you lose your phone?  Also keeping your contacts centralised means you only need to make updates in one place.

Photos
What to use: Ubuntu One
Ubuntu One is great for backing up photos, you get 5GB free space and it will sync your files across Android devices and your computers.  The Android client has a great feature where as soon as you take a photo on your phone it is backed up to Ubuntu One and synced to your Desktop, Laptop and Tablet.

Unfortunately at the moment Ubuntu One is only available on Ubuntu(and its variants), Android and Windows.  So if you're on OSX check out DropBox.

What not to do:
Don't keep your photos on a bunch of poorly labeled DVDs.  First off it's a hassle if you want to look through your photos and they are spread across multiple DVDs.  Second, DVDs are a dead format, although they are still in wide use, they won't be for long(I don't own a single CD or DVD).  Thirdly, DVDs can degrade over time.

Files
What to use: Ubuntu One or DropBox
There are two options here depending on what you want to do.  Seeing as they both work in basically the same way I will outline the basic process here.  When you install the DropBox or Ubuntu One client it will create a folder within your home folder.  After installation any file placed in that folder will be automatically backed up to the server and synced to all your other devices.

Ubuntu One
For personal file storage I prefer Ubuntu One because of it's large free capacity and great Ubuntu and Android integration(as discussed previously). 

DropBox
For storing files you want to share with other people and work on collaboratively nothing beats DropBox.  It supports Linux, Windows and OSX.

What not to do:
Do not keep all your important files on a single computer or on random usb sticks and DVDs, it's annoying to maintain, not automated and prone to failure.

Bookmarks and History
What to use: Chrome Sync
This will sync your bookmarks, history, form data, etc across all your computers using your google account.  It's really easy to set up and works flawlessly behind the scenes.  Of course this assumes you are using Google Chrome as you web browser, if you're  not using Chrome already then get it now.

Documents
What to use: Google Docs
Google Docs is a full featured office suite inside your browser providing document, spreadsheet and presentation apps.  It also has amazing collaboration tools for real time editing of documents by multiple users.  Add version control, sharing and access control to this and you have one awesome document management system.  Admittedly the web interface isn't as full featured as Libre Office or MS Office but it is good enough for 99% of use cases.  You can always edit documents on your desktop and just upload them to Google Docs.

What not to do:
Don't just keep all your important documents in poorly organised folders on your computer.  Don't keep revising and re-sending documents via email, just add it to Google Docs and then give access to the person you want to share it with, they will even be able to see your changes in real time.

Books
What to use: Amazon Kindle
The Amazon Kindle Store is a great way to buy books.  They are cheaper, easier and can can be synced across all your devices and accessed from anywhere. It means you don't have to throw out your book collection every time you move to a different country and don't need to have bookshelves and piles of books cluttering up your house.

What not to do:
Whatever you want, I can't argue that I don't like the feel of a real book in my hands and in the right setting a bookshelf can look great but if you live a rather transient lifestyle like myself maintaining a physical book collection is not viable.

Games
What to use: Steam
Steam allows you to purchase games via their store and then install them locally to your computer.  The great thing about it is you can install Steam on any computer, log in and all your games are there.  This means no more game DVDs, remembering CD Keys etc.

What not to do:
Don't buy physical copies of games. They will often require you to have an optical drive and you will need to actually keep track of physical DVDs and CD keys.


The risks of cloud storage
While cloud storage is very reliable and hassle free it is worth remembering that your data is being stored on someone else's server.  If the company storing your data closes, stops service or experiences technical failures it is possible you will lose data.  Most free services provide a paid option which comes  with guarantees about data loss.  If this is a concern make sure you read the terms of service thoroughly.  

The hosting of your data on someone else's server also raises some privacy concerns so again if this is something you worry about make sure you read the terms of service.


Note: I am not bothering to mention solutions like Deja Dup or Apple's Time Machine as I believe they are unnecessary.  I like having a clean install of my OS and find it strange people go to great lengths to preserve their current install when 9 times out of 10 it would just be quicker to format and re-install(it only takes an hour).  If you are using an OS like Ubuntu that works out of the box, comes with everything from word processing to torrent clients pre-installed and has an awesome app store then setting up after a fresh install is no hassle at all.  Drive imaging backup tools only encourage people to stick with their slow bloated, years old installs.

Saturday, October 15, 2011

Install memcached with PHP on Ubuntu 11.04

Memcached is a great tool for optimising your website.  It can be used to cache commonly used data in memory for fast access.  This can help greatly in increasing speed, reducing DB load and scaling your site.  To find out more check out the memcached site here.

Here is a short guide to installing memcached on Ubuntu.  This is a guide to installing via the command line but if you prefer a GUI you can install via the Ubuntu Software Center.

Open a terminal(Ctrl + Alt + T) and enter the following:

sudo apt-get install memcached

sudo apt-get install php5-memcached

sudo /etc/init.d/apache2 restart


to test memcached is up and running enter:

telnet localhost 11211

if it connects you are good to go.
*Note to quit telnet enter Ctrl + ] then Ctrl + d then enter "quit" and hit enter.

To test that memcached is working with Apache and PHP see the instructions here

Friday, September 9, 2011

Install Humble Bundle on XBMC Live

I recently purchased the latest Humble Bundle and wanted to get the games working with my XBMC Live setup.  I have put together this guide for setting up Humble Bundle 3 games with your XBMC Live setup.  This guide assumes you are using the install files provided as part of Humble Bundle but should work equally well for files downloaded directly from the game website.

I haven't finished writing guides for all games yet but I will add them to this post as they are published:

Install Revenge of the Titans in XBMC Live

Install Steel Storm in XBMC Live

Install Braid in XBMC Live

Install And Yet It Moves in XBMC Live

Install Osmos in XBMC Live


Have Fun!

Install And Yet It Moves on XBMC Live

I recently purchased the Humble Bundle 3 and have been setting up the games to run on my XBMC Live Box.  Here is a short guide to installing And Yet It Moves on XBMC Live.

Step 1 - get the .deb file
Download the deb file from the Humble Bundle website.  You will need to transfer the deb file to the home folder on your XBMC Live box, my guide to using FileZilla to copy files to XBMC Live.

Step 2 - install the game
Open a terminal, see 3 ways to access the terminal on your XBMC Live box,  and enter the following.

sudo apt-get install libtheora0 libopenal1
sudo dpkg -i andyetitmoves_1.2.1_i386.deb

Step 3 - create launcher script
There are 2 ways to do this the command line way or the GUI way

The command line way:

mkdir scripts

cd scripts

nano andyetitmoves.sh

now paste in this:
#!/bin/bash
fluxbox &
/usr/games/AndYetItMoves
killall -9 fluxbox


Now press Ctrl+X and then Y to save and exit

chmod +x andyetitmoves.sh

The GUI way:
Using FileZilla create a folder called "scripts" in the home folder on your XBMC Box.

Download this file and copy it to the "scripts" folder.



Give the file execute permissions, first right click and then select "File Permissions".  Check all the "execute" checkboxes and hit ok.



Step 4 - Add shortcut to launcher
Now you just need to set up a shortcut to the game launcher script in the XBMC Launcher Addon.  Follow my guide to Add a Shortcut to Launcher Add-on in XBMC to create a shortcut for the new script file.

Step 5 - Fix profile saving bug
There is a bug in the config file of the And Yet It Moves installer so that your profile and settings will not be saved, to fix the problem do the following:


edit this file

~/.Broken Rules/And Yet It Moves/common/commonConfig.xml

and change "Company"  tag from "Broken Rules" to ".Broken Rules"

source ivl @ http://andyetitmoves.net


And that's it, you can now launch the game by going "Programs" -> "Launcher".

Install Osmos on XBMC Live

I recently purchased the Humble Bundle 3 and have been setting up the games to run on my XBMC Live Box.  Here is a short guide to installing Osmos on XBMC Live.


Step 1 - get the .deb file
Download the deb file from the Humble Bundle website.  You will need to transfer the deb file to the home folder on your XBMC Live box, my guide to using FileZilla to copy files to XBMC Live.

Step 2 - install the game
Open a terminal, see 3 ways to access the terminal on your XBMC Live box,  and enter the following.

sudo dpkg -i Osmos_1.6.1.deb

Step 3 - create launcher script
There are 2 ways to do this the command line way or the GUI way

The command line way:

mkdir scripts

cd scripts

nano osmos.sh

now paste in this:


#!/bin/bash
fluxbox &
/opt/Osmos/Osmos
killall -9 fluxbox

Now press Ctrl+X and then Y to save and exit

chmod +x osmos.sh

The GUI way:
Using FileZilla create a folder called "scripts" in the home folder on your XBMC Box.

Download this file and copy it to the "scripts" folder.



Give the file execute permissions, first right click and then select "File Permissions".  Check all the "execute" checkboxes and hit ok.



Step 4 - Add shortcut to launcher
Now you just need to set up a shortcut to the game launcher script in the XBMC Launcher Addon.  Follow my guide to Add a Shortcut to Launcher Add-on in XBMC to create a shortcut for the new script file.

And that's it, you can now launch the game by going "Programs" -> "Launcher".

Install Steel Storm on XBMC Live

I recently purchased the Humble Bundle 3 and have been setting up the games to run on my XBMC Live Box.  Here is a short guide to installing Steel Storm on XBMC Live.


Step 1 - get the .deb file
Download the deb file from the Humble Bundle website.  You will need to transfer the deb file to the home folder on your XBMC Live box, my guide to using FileZilla to copy files to XBMC Live.

Step 2 - install the game
Open a terminal, see 3 ways to access the terminal on your XBMC Live box,  and enter the following.

sudo apt-get install libsdl-net1.2
sudo dpkg -i steel-storm-burning-retribution_2.00.02818_i386.deb

Step 3 - create launcher script
There are 2 ways to do this the command line way or the GUI way

The command line way:

mkdir scripts

cd scripts

nano steel-storm.sh

now paste in this:

#!/bin/bash
fluxbox &
/opt/steelstorm/steelstorm -basedir /opt/steelstorm
killall -9 fluxbox

Now press Ctrl+X and then Y to save and exit

chmod +x steel-storm.sh

The GUI way:
Using FileZilla create a folder called "scripts" in the home folder on your XBMC Box.

Download this file and copy it to the "scripts" folder.



Give the file execute permissions, first right click and then select "File Permissions".  Check all the "execute" checkboxes and hit ok.



Step 4 - Add shortcut to launcher
Now you just need to set up a shortcut to the game launcher script in the XBMC Launcher Addon.  Follow my guide to Add a Shortcut to Launcher Add-on in XBMC to create a shortcut for the new script file.

And that's it, you can now launch the game by going "Programs" -> "Launcher".

Installing Braid on XBMC Live

I recently purchased the Humble Bundle 3 and have been setting up the games to run on my XBMC Live Box.  Here is a short guide to installing Braid on XBMC Live.


Step 1 - get the .deb file
Download the deb file from the Humble Bundle website.  You will need to transfer the deb file to the home folder on your XBMC Live box, my guide to using FileZilla to copy files to XBMC Live.

Step 2 - install the game
Open a terminal, see 3 ways to access the terminal on your XBMC Live box,  and enter the following.

sudo apt-get install nvidia-cg-toolkit


sudo dpkg -i braid_1.0.0-0ubuntu2_i386.deb

Step 3 - create launcher script
There are 2 ways to do this the command line way or the GUI way

The command line way:

mkdir scripts

cd scripts

nano braid.sh

now paste in this:


#!/bin/bash
fluxbox &
/opt/braid/braid
killall -9 fluxbox

Now press Ctrl+X and then Y to save and exit

chmod +x braid.sh

The GUI way:
Using FileZilla create a folder called "scripts" in the home folder on your XBMC Box.

Download this file and copy it to the "scripts" folder.



Give the file execute permissions, first right click and then select "File Permissions".  Check all the "execute" checkboxes and hit ok.



Step 4 - Add shortcut to launcher
Now you just need to set up a shortcut to the game launcher script in the XBMC Launcher Addon.  Follow my guide to Add a Shortcut to Launcher Add-on in XBMC to create a shortcut for the new script file.

And that's it, you can now launch the game by going "Programs" -> "Launcher".

Installing Revenge Of the Titans on XBMC Live

I recently purchased the Humble Bundle 3 and have been setting up the games to run on my XBMC Live Box.  Here is a short guide to installing Revenge of the Titans on XBMC Live.


Step 1 - install Java
First follow my guide to installing Java on XBMC Live.

Step 2 - get the .deb file
Download the deb file from the Humble Bundle website.  You will need to transfer the deb file to the home folder on your XBMC Live box, my guide to using FileZilla to copy files to XBMC Live.

Step 3 - install the game
Open a terminal, see 3 ways to access the terminal on your XBMC Live box,  and enter the following.

sudo dpkg -i  RevengeOfTheTitans-HIB-18012-i386.deb

Step 4 - create launcher script
There are 2 ways to do this the command line way or the GUI way

The command line way:

mkdir scripts

cd scripts

nano revenge_of_the_titans.sh

now paste in this:

#!/bin/bash
fluxbox &
/opt/revengeofthetitans/revenge.sh
killall -9 fluxbox

Now press Ctrl+X and then Y to save and exit

chmod +x revenge_of_the_titans.sh


The GUI way:
Using FileZilla create a folder called "scripts" in the home folder on your XBMC Box.

Download this file and copy it to the "scripts" folder.



Give the file execute permissions, first right click and then select "File Permissions".  Check all the "execute" checkboxes and hit ok.



Step 5 - Add shortcut to launcher
Now you just need to set up a shortcut to the game launcher script in the XBMC Launcher Addon.  Follow my guide to Add a Shortcut to Launcher Add-on in XBMC to create a shortcut for the new script file.

And that's it, you can now launch the game by going "Programs" -> "Launcher".

Add a Shortcut to Launcher Add-on in XBMC

This is a short guide on installing and adding a shortcut to the XBMC Launcher Add-on.  It is part of a series I am doing on installing Humble Bundle 3 on XBMC Live.

Installing Launcher Add-on
Go to "Settings" -> "Add-ons"


Now select "Program Add Ons"


Select Launcher and choose "Install"


Adding a Shortcut
Start the Launcher Add-on from the "Programs" menu, if it is the first time you have run it you will be prompted to add a shortcut straight away.  Otherwise click on one of the existing menu items and select "Add New Launcher"


Choose "Stand Alone(Normal PC Executable)"

Select the location of the script file


Now just leave the script arguments blank and give the shortcut a sensible name.

And that's it you can now launch you script from the Launcher menu.

3 ways to access the terminal on your XBMC Live box

There are a bunch of cool things that you can do with your XBMC Live install like set up games or install a browser but to do this you're going to need to get your hands dirty with a little command line work.  Don't worry though it's super easy so here are three ways you can access the terminal on your XBMC Live box.

1 - SSH
This is my preferred method as it can be done remotely and I can access XBMC Live on my laptop from the comfort of the couch.  Obviously your XBMC box will need to be connected to your network for this to work, you will also need the IP address of you XBMC box.  If you don't already know the IP address of you XBMC box you can find it under Settings->System Info->Summary

If you are in Linux or OSX open a Terminal and type:

ssh <xbmc live user>@<xbmc IP address>

Enter you password when prompted and that's it you're in.

*NOTE: if you did not do a HDD install of XBMC Live and are running it off a memory stick use the default XBMC Live credentials.
Username: xbmc
Password: xbmc

2 - Terminal
This is probably the easiest one to access.  Simply select "Exit" from the shutdown menu and you will drop into a Linux terminal.  Enter your XBMC Live username and password to login.

3 - Fluxbox
If you prefer a GUI you can also access Terminal emulators through Fluxbox which comes with the default install of XBMC Live.  To do this follow the steps outlined above(section 2) to access the terminal and after logging in type:

startx

and hit enter this will bring up the Fluxbox desktop.

Right click anywhere on the Fluxbox desktop to bring up the main menu the select:

Applications->Terminal Emulators->XTerm

If you found this helpful you might also like my guide to accessing files on XBMC Live.

Thursday, September 8, 2011

Copy Files to XBMC Live with sFTP and FileZilla

Here is a quick guide to connecting to XBMC Live via sFTP using FileZilla.  This will enable you to copy files to and from your XBMC Live installation.  By default XBMC Live installs an SSH server so you don't need to do any configuration on the actual XBMC box.

First you need to install FileZilla, if you are on Ubuntu just search for it in the Software Center or if you are using OSX or Windows you can download it here.

Next you need the IP address of your XBMC box, you can find this out by going to Settings->System Info->Summary



Now you have the IP address of your XBMC box open FileZilla and enter the following settings:

Host: your XBMC box IP address
Username: the username you chose during XBMC installation
Password: the password you chose during XBMC installation
Port: 22



*NOTE: if you did not do a HDD install of XBMC Live and are running it off a memory stick use the default XBMC Live credentials.
Username: xbmc
Password: xbmc

You can now easily copy files to and from you XBMC Live box.

Tuesday, September 6, 2011

Install Java(JRE) on XBMC Live

I had some trouble getting the Sun Java 6 JRE running on my new XBMC Live 10.1 Dharma installation so I figured I would write it down for anyone else having similar problems.  Here are the steps to get java up and running.

First drop into a command line or SSH into your XBMC HTPC.  To do this you can go to the shutdown menu and select the "Exit" option or follow my "3 ways to access the terminal on your XBMC Live box" guide.  You then need to log in with your XBMC Live username and password that you set up during installation.  Now you're at the terminal just enter the following:

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"

 sudo apt-get update

sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts java-common sun-java6-bin unixodbc odbcinst1debian1 odbcinst


and that's it, have fun!

BTW: just out of interest what are you installing java for on XBMC Live for?  I was doing it to get some humble bundle games working but I'm interested in what other people are doing with their setup so leave a comment if you found this useful.

Wednesday, August 10, 2011

XBMC TV v0.1 - Streaming XBMC Plugin

I'm happy to announce the initial release of my XBMC Plugin, XBMCTV.  The XBMCTV plugin provides easy access to thousands of streaming videos from many sources around the net.  The plugin requires XBMC Dharma, if you're not familiar with XBMC you can read up about it here.

The current features:
Around 2000 videos available
Browse videos by category
View latest videos
Browse by channel
Browse by show


The latest version of the plugin can be found here:
http://jamespcole.com/xbmctv/www/plugin_builds/

To install the plugin just follow these steps:


Download the ZIP file and save to a location accessible by XBMC.

Open XBMC and browse to System > Add-ons > Install from zip file.

Browse to the file you downloaded and select it.

source

After installation the plugin will appear under Videos > Video Add-ons > XBMCTV


At the moment the video collection is limited to a few thousand streams so if you have any video RSS feeds you want added then leave a link in the comments below.  Also any feature requests are welcome just leave them in the comments.


Saturday, August 6, 2011

Elementery OS Jupiter Review

I've been using Elementary OS  on my home development machine and netbook for a couple of months now and I have to say I'm pretty pleased with it.  The current Elementary OS is based on Ubuntu 10.10 and is bought to you by the same team that creates the highly popular elementary themes and nautlius customisations for Ubuntu.  I guess I woud call Elementary more of an Ubuntu remix than a full fledged distro, it's essentially the Ubuntu core with a different set of default installed apps and all the elementary team's sweet eye-candy and themes pre-installed and configured.

The default desktop configuration, looking minimal and quite spartan.

You'll get smaller set of installed apps compared to a regular Ubuntu install but the software center is pre-installed so you can install anything you want in just a couple of clicks.  One of the things that lets the current release down in the default browser which is Midori, it looks nice and is webkit based but just isn't ready for general use yet, it has a ton of bugs and felt really unstable.  No problem though you can just install Chrome, Chromium or Firefox easily.

Ubuntu Software Center in Elementary OS

The choice of colours and icons in Elementary makes it look a little like OSX which I was put off by at first, being a big fan of dark themes.  Fortunately the rest of the Elementary configuration is very similar to the way I like to customise my Ubuntu setup anyway, with a minimal look, Docky, desktop icons turned off and elementary nautilus etc.  However the Elementary theme gives the whole OS a light and breezy feel which makes it a pleasure to use and somehow seems much snappier than a standard Ubuntu install.  Perhaps due to the smaller number of pre-installed apps.  Although after a while you notice the similarity to OSX is only slight and that the UI/UX is actually quite different.  I also added compiz to my setup for some extra bells and whistles and as you would expect everything works flawlessly.

Compiz widow switching in Elementary OS

Compiz workspace switcher Elementary OS

While the current 'Jupiter' release is bassed on Ubuntu 10.10 the new 'Luna' release will be based on Ubuntu 11.10 and should be arriving around November.  The upcoming 'Luna' release will bring a whole bunch if improvements including Elementary's very own app launcher alled 'Slingshot'.

Overall the first release of Elementary OS is a great start and even though it is a first release it is very stable and I have been using it every day with no issues.  So if you want a fast, pretty and lightweight version of Ubuntu then give Elementary OS a try.

Tuesday, July 19, 2011

AMOLED Screens Will Change the Future of UI Design

The latest Super AMOLED Plus screen such as the one featured in the new Samsung Galaxy S II will begin having a real impact on UI design.

Why is that? you ask.

The latest generation of AMOLED screen use little to no power when displaying black pixels.  This means that on a mobile devices it is much more power efficient to use black pixels as much as possible.  I think this will mean that in the coming years mobile devices will increasingly use darker UIs in order to increase the battery life of their devices.  Android seems to have already made the decision to have black backgrounds on their UI quite a while ago and it makes me wonder whether this choice was purely aesthetic or a very far sighted engineering decision based on the likelihood that in future mobile screens would have 0 power black pixels.

Does this mean we could see a revision of the rather light iOS UI in the coming years to a more efficient and stern black based UI?  Probably not,  but it is interesting that the latest Meego builds for the N900 also use a light coloured theme by default but in the upcoming Nokia N9 running Meego with an AMOLED screen they have opted for a very black theme. See here: http://www.engadget.com/2011/06/21/nokia-n9-first-hands-on/

Anyway only time will tell but for my $0.02 I'd say that in future of UI design black is the new black.

Thursday, June 9, 2011

Enable Docky Settings in Elementary OS

I've been testing out the latest Elementary OS(Jupiter) on my Netbook. Elementary uses Docky as the default dock, it's a great app and I have used it extensively on standard Ubuntu. By default the dock does not autohide and on my 1024x768 netbook it's using way too much screen space. For some reason the Elementary team have decided to hide the dock settings by default.

To enable the Docky settings icon to appear in the dock do the following:

Open a terminal by pressing Ctrl + Alt + T or using the menus go Applications->Accessories->Terminal

Enter this at the terminal and hit enter:

gconftool-2 --set "/apps/docky-2/Docky/Items/DockyItem/ShowDockyItem" --type bool "true"

The Docky settings icon should appear on the left hand side of the dock.

It's the anchor icon on the far left

Alternatively you can do it via a GUI using gconf-editor.  To start gconf-editor open a terminal type gconf-editor and hit enter.

Select the "ShowDockyItem" option



Tuesday, June 7, 2011

Installing LAMP on Ubuntu 11.04 Natty Narwhal

This is a short guide to setting up LAMP(Linux, Apache, MySQL, PHP) on Ubuntu 11.04 Natty Narwhal.
If you are using 10.10 you can check out my LAMP setup guide here.

First step is pretty easy, open a terminal and enter the following:

sudo apt-get install lamp-server^

During the installation process you will be asked to enter you MySQL root password, after that you have a basic lamp stack set up.

The following steps are optional but recommended:

Install CURL for php.

sudo apt-get install php5-curl

Install mod rewrite for url rewriting.

sudo a2enmod rewrite

sudo gedit /etc/apache2/sites-available/default

This will open your sites config file, now find the XML block that looks like this:

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

change the AllowOverride directive from "None" to "All".  The result should look like this

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

now save and close the file.



Next restart Apache for the changes to take effect.

sudo /etc/init.d/apache2 restart

And that's it, happy coding!

Installing Google Chrome in Ubuntu 11.04 Natty Narwhal

The deb package from Google Chrome download site does not currently work with Ubuntu 11.04(Natty Narwhal).  Luckily it's easy to just add the chrome PPA and install from the command line.

Open a terminal(Ctrl + Alt + T) and enter the following:

sudo -s

echo "deb http://dl.google.com/linux/deb/ stable non-free main" | tee -a /etc/apt/sources.list

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -


apt-get update

sudo apt-get install google-chrome-stable

exit

And now chrome should be installed, have fun.

Wednesday, February 16, 2011

Simple PHP oAuth example for Facebook Graph API

I needed to implement oAuth for the the Facebook graph API today and couldn't find any straight forward php examples so I thought I would post this in case any else is in a similar situation.

The basic process for the authentication is outlined here so I won't go into the details of it.  In the example below the bit you'll need to take note of is the "scope" parameter in the link, this defines the permissions you are requesting.  To see a full list of available permissions click here.

You'll also need to sign up for an API key first and register your application with Facebook, you can sign up here.

Step 1:
In your page make a link like this:

<a href="https://www.facebook.com/dialog/oauth?client_id=<?=FACEBOOK_APP_ID?>&redirect_uri=
<?=urlencode('http://yoursite.com/fb_oauth_return.php')?>
&scope=offline_access,user_checkins,friends_checkins">Connect with Facebook</a>

Step 2:
Create a page called fb_oauth_return.php which contains the following code

<?
if(!isset($_GET["error"]))
{

 if(isset($_GET["code"]))
 {
  $code = $_GET["code"];    
  $url = 'https://graph.facebook.com/oauth/access_token?client_id='.FACEBOOK_APP_ID.'&redirect_uri='.urlencode('http://yoursite.com/fb_oauth_return.php').'&client_secret='.FACEBOOK_SECRET.'&code='.$code;
  
  $curl_handle=curl_init();
  curl_setopt($curl_handle,CURLOPT_URL,$url);
  curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,6);
  curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
  $buffer = curl_exec($curl_handle);
  curl_close($curl_handle);    
  if(strpos($buffer, 'access_token=') === 0)
  {
   //if you requested offline acces save this token to db 
   //for use later   
   $token = str_replace('access_token=', '', $buffer);
      
   //this is just to demo how to use the token and 
   //retrieves the users facebook_id
   $url = 'https://graph.facebook.com/me/?access_token='.$token;
   $curl_handle=curl_init();
   curl_setopt($curl_handle,CURLOPT_URL,$url);
   curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
   curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
   $buffer = curl_exec($curl_handle);
   curl_close($curl_handle);
   $jobj = json_decode($buffer);
   $facebook_id = $jobj->id;
   
   
  }
  else
  {
   //do error stuff
  }
 }
}
else
{
 //do error stuff
}
?>

And that's it.  If you requested offline access you'll need to save the token to your database so that you can use it to make requests on the user's behalf later.

Friday, February 11, 2011

Nokia + WP7 and the fate of Meego

Big news for Nokia and WP7 fans today with the announcement of a partnership between Nokia and Micosoft to release a range of WP7 based Nokia handsets.  Hopefully for Nokia this can help increase their flagging smartphone market share.  However for me this raises some importatnt questions about the fate of Meego which I was really looking forward to seeing hit the handset market this year.  Sadly it looks like there will not be the proliferation of Meego devices I was hoping to see.  Nokia released a rather cryptic statement about future Meego development:

"MeeGo will place increased emphasis on longer-term market exploration of next-generation devices."

What this actually means remains to be seen but they have confirmed they will release one Meego handset this year.  Given that the scope of Meego is quite broad, aimed at everything from in vehicle systems to netbooks we may see it popping up on other devices soon it's clear that it will not be Nokia's focus for it's return to the smartphone market in the short term.

I hope there is still a future for Meego on handsets especially with the announcement of the Dalvik Alien VM for running Android apps on non Android devices which would combine the existing Android development ecosystem with Nokia's handsets.  Given that Meego is a partnership between Intel and Nokia I would be interested to hear Intel's thoughts on this new deal.

This is certainly sad news for fans of Maemo 5, Meego and open source operating systems generally but WP7 is a solid mobile OS and Nokia definitely need to move away from Symbian if they want to be taken seriously in the high end smartphone market.  This new gambit with WP7's success will be highly dependent on how much traction WP7 can achieve with consumers over the next year or so.  I'm also guessing that Microsoft is hoping to piggy back on Nokia's brand reputation and following in order to get the general public interested in WP7 which, while still in it's early stages, has yet to gain much of a following amongst consumers.

While Maemo 5 is a truly excellent mobile OS and Meego has tons of potential I fear that this may be the end of Meego handsets as a serious competitor to Android and iOS, at least in 2011.

Sources:
http://www.bbc.co.uk/news/business-12427680
http://www.allaboutmeego.com/news/item/12571_Alien_Dalvik_hopes_to_bring_An.php

Wednesday, February 9, 2011

Backpacking Essentials for the Geek - what to take with you

I usually write about tech but this week I thought I would try something a little different and talk about setting up the perfect backpack for the travelling geek.  If you're planning a long backpacking trip there are a few items I find make life on the road a bit more comfortable.

The essentials:

1. A Netbook
Netbooks are a blessing for the modern backpacker and provide several advantages over lugging around a laptop.  Most 9-inch netbooks weigh less than a kilogram but provide you with a fully functional computer that you can take anywhere.  They are also crazy cheap($300 - $400) so losing/getting wet/stolen is not the huge financial blow it would be with an expensive laptop.  Your netbook will let you do all your skype calling, emailing, photo uploading as well as watching episodes and movies in bed on your downtime nights.  Also given that most hotels and hostels have wifi you can get internet access pretty much anywhere and you can now avoid using the painfully slow, virus laden public access computers in your hostel.  Personally I use an Asus T91 running Ubuntu, it's only 9" and weighs around 900 grams so you barely notice you are carrying it.

Asus Eee PC T91SA-VU1X-BK 8.9-Inch Intel Atom Netbook Computer (Black)
Asus eee Netbook, 9" and 900 grams awesome for your backpack


2. A carrier unlocked Smartphone
In most countries getting a pre-paid SIM card takes about ten minutes and is super cheap so having an unlocked phone will end up saving you a ton of money and hassle in the long run.  If you're like me and you're not willing to take an awesome expensive camera around with you I find my HTC Hero and HTC Desire have great cameras and replace the need to take a point and click with me.  It's also an Mp3 player and GPS so that's two less things to carry.



3.  Spare Rechargeable Batteries
I always carry rechargeable batteries with generic plugs for recharging my phone, Nintendo DS and kindle when I don't have access to mains power as well as a spare phone battery.  Having your mp3 player running out of power 5 hours into a 30 hour train ride is no fun so make sure you always have backup power.

New Trent Dual-port Pack IMP50D 5000mAh External Battery pack for Apple iPad, iPhone 4G 4, iPhone 3G 3GS, iPod Touch (1G 2G 3G), Motorola Droid phones, HTC Android Phones , Blackberry (curve, tour, bold, storm) Black
Something like this portable battery pack


4. Headphones and Adapters
A good pair of bud earphones is essential, you can take over the ear style ones but you always need to be precious with them so they don't get crushed and ultimately I don't think the added sound quality is worth the effort.  The ear plug style buds are best for this as they blog out more external sound which you will really appreciate when you are on a bus with blaring Hindi pop music.  Also take a headphone splitter so that you can share what you are watching/listening to with the person next to you.  I also recommend picking up an adapter for the headphone jacks they use on airplanes so you can use your own headphones with the in flight entertainment.

Sennheiser CX300-B In-Ear Stereo Headphone
These do a great job of blocking out external sound


5. Cables, Adapters and Chargers
The possibilities here are endless but these are what I always take:
- A short length of cat 5
- Mini USB to USB
- Micro USB to USB
- 3.5mm jack to stereo RCA
- 3.5mm to 3.5mm stereo cord
- VGA Cable
- DVI to VGA Adapter
- Headphone Splitter
- AC Power adapters for various countries
- AC power to USB
- A multi-card reader

6. Data Storage (The Cloud is your friend)
You'll want somewhere to store your data while you are on the road and if you want to bring episodes and movies with you then you'll need some storage.  There are a few options here either and external drive, usb sticks and memory cards.  The external drive will give you the most bang for your buck but after having two of them die on me while travelling I decided to buy a bunch of large memory sticks and memory cards instead, a little pricier but worth it.  Make sure you back up your photos to the cloud using something like DropBox or Ubuntu One as often as possible, backing up photos to your memory stick won't do you any good if you lose your backpack.


7. A torch + spare batteries
This one is a no brainer and you'll be surprised how often you use it.  I use a mini maglite which does a great job.

MAGLITE M2A016 AA Mini Flashlight, Black
Definitely worth the space in your pack
8. Passport Photos and a Pen
Most countries still require filling out visa applications and entry cards so having a pen means you can fill everything out and get through customs as fast as possible.  Also most countries will require a passport photo attached to the visa application and not needing to get photos at the only photo booth in the airport will save some serious hassle and cash.  Just remember not to put the photos in with your check-in luggage!

Nice to have:
1. A Nintendo DS
Amazing battery life, tons of games and r4 cards plus wifi multiplayer, why wouldn't you want to.

2. A Kindle
Awesome for reading on the go.  Great battery life, small and light plus the global 3g coverage if you go for the more expensive model means you can shop for books online almost anywhere.

3. A hip flask
Really great to have on a long train trip or a long day of hiking or trekking where space and weight are at a premium.

4. Travel speakers
If you can get some good travel speakers they really come in handy.