Archive for the ‘UbuntuIreland’ Category

Getting Google Calendar to work with KDE’s KOrganizer, Kontact and KMail (on Kubuntu 9.10 Karmic Koala)

Friday, February 19th, 2010

Woah! That’s a lot of K’s in the title! But it’s all in the name of getting your calender talking to your desktop so it’s for a good kause (sorry!)

There’s this great package in KDE that has a really cool name called Akonadi (pronounced Ahh-Kon-ahh-dee if you want to impress your friends!). But more than just a cool name it does cool things – particularly in the realm of syncing data on your desktop with a remote server. Ooo yeah, including Google’s servers. Akonadi is one of the ‘pillars’ of the KDE platform and here’s how you can use that pillar to prop up your schedules and calendaring with KOrganizer-Google integration. It’s easy on Kubuntu Karmic!

– Install the Google data package for Akonadi
sudo apt-get install akonadi-kde-resource-googledata
– Ensure the Akonadi Tray Utility is running by performing the following steps
– Search for Akonadi in the search box of the Kickoff Launcher (KDE’s “Start” menu). Click the Akonadi Tray Utility that is found
– Go to the tray on the bottom right of your beautiful KDE desktop and click the small arrow, if necessary, to to expand all the tray icons
– You should see an icon for Akonadi. Right click on it and select ‘Start Akonadi’
– This should start the Akonadi server. You can verify this by right clicking the icon again and checking to see that there is now a ‘Stop Akonadi’ option
– Right click on the Akonadi icon yet again and select ‘Configure’
– Under the Akonadi Resources configuration, click Add and elect to add a Google Calendar Data Resource
– Enter your login details for your google account
– Next it’s off to Kontact. Go to the Calendar in Kontact
– There should be a small Calendar pane on the bottom right to set up calendar resources. Click the Plus sign to add an “Akonadi (Provides access to calendars stored in Akonadi calendar folders)”
– In the resulting popup, choose the google resource in the list and ensure that Events is ticked to the right of it. (I didn’t try to get Todos or Journals working because I don’t use them)
– Hey presto! All your calendar details should now be pulled into KOrganizers calendar! Hurrah!!!

Just to note, at time of writing I found that I had to search and find the Akonadi Tray Utility on restarting the computer. Once it’s in the System Tray elect to start Akonadi as we did above and you’re back in the game! If you find a solution to this minor inconvenience on restarting your machine then please post below!

Thanks to Christian Mangold for this article which served as a great reference.

Santa’s got Gems baby! Ruby Ireland Christmas Meetup 2009

Friday, December 18th, 2009

Ho ho ho! The month’s Ruby Ireland meetup sprag right out of the traps with early adopters showing up at 6pm in the lobby area of the Trinity Capital Hotel, Wed Dec 16th. Easing into the evening with a 4 euro pint and talk of Android phones – seemingly the top item of everyone’s Christmas shopping list – the latest crop of gems in the Ruby world was in hot debate, gemcutter in particular.

A couple of folks had been playing around with RubyGame for visualising data as it changes on the fly – showing that this framework is for more than just gaming. The XML/HTML parser Nokogiri was also mentioned a few of times in passing, with the particularly eye-catching quote “XML is like violence – if it doesn’t solve your problems, you are not using enough of it” adorning the home page of its website. And the cracking little tool tig was also brought up, which has a dinky little ncurses interface into git repositories. Pretty cool; not least because it makes it easier for newbies to avoid being bitten when they start git’tin.

The downstairs lobby in the hotel worked out great for people to meet up and relax, with most people turning up at the scheduled 7 o clock for kick off. From there we took over the, what has to be said, pretty classy meeting room complete with old style couches and some Joan Miró paintings. Just in tune with the creative buzz we had going on. There wasn’t too much talk of Ruby for a while as most people were in stunned admiration of the room. Then the food platter arrived. Impressively, this is when everyone showed off their good manners by looking shyly at the platter for a few minutes, with that kind of “You first, sir” glint in their eye, before taking the plunge and sinking into the pakoras and wedges! Pretty much undoing any good work in the gym from earlier in the day!

One of the funnier moments of the night was when someone went to check the tweets against the (now settled upon) #rubyireland hashtag. Only to find lost rubyists tweeting from the hotel lobby as to where the meetup was on. After a quick runaround the lobby to herd anyone wielding a Macbook into the meeting room, the evening was back on track. We split up into a few smaller groups, with the main walk-through being on the qtonrails – a Rails plugin to simply developing applications on Linux and other platforms using Nokia’s Qt framework atop Rails.

To finish off we had a bit of improv comedy from everyone at different closing stages of the evening; in particular Paul O’Malley with his faithful rendition of an emotion beekeeper. And yes now we’re straying off topic so it’s probably time to go. We’ll leave you with Paul’s write up of last night’s shenanigans :-)

Thanks to everyone who showed. Have a great Christmas and catch ye all in Jan 2010 – surely destined to be the decade of Ruby domination!

Ciao,
Dec

Eight Useful Git Tips

Sunday, November 22nd, 2009

1.) You can check your config using git config -l

This tells you useful stuff like what remotes you’re bound to, etc.

2.) You can blow away files listed as ‘untracked’ (by the git status command) using git clean (be careful!).

If you want any of those files to hang around (but not appear as ‘untracked’) then add them to your  .gitignore file.

3.) You can re-enter your last commit using git commit --amend. What’s nifty is that you can change files (including file addition and deletion) as well as the commit message. Just do what you gotta do before running the amend command and enter a replacement commit message.

4.) You can undo your last commit completely using git reset HEAD^

*** This does not change the working tree ***

Alternatively, you can use the syntax git HEAD~2 instead of HEAD^^

5.) Refer to the last revision by HEAD, the second last as HEAD^ and the third last as HEAD^^

You can keep adding carrets forever! Sounding like Bugs Bunny there.

6.) You can see the contents of a file from a revision using

git show rev:path/to/file

7.) Ok, this tip is a bit of a longer one. Use git merge some_other_branch to merge another branch into the one your working on. (Note that git pull does a merge automatically once it’s completely – if you don’t want this to happen use git fetch). There are a few possible outcomes:

Fast-forward merge : If changes were made on only one of the branches since the last merge, then the merge should happen without any need for you to act.

Three-way merge: If changes were made on both branches, then git decides how to merge them using an algorithm. If any changes conflict with each other, then git will report them and let you resolve them. Once you’ve fixed any conflicts then you can git commit.

If there were no conflicts, git automatically does a commit with a stock commit message for the log. If you don’t like the idea of this then use git merge --no-commit some_other_branch. You need to manually do the commit afterwards. (This is more like how other distributed VCS’s such as Mercurial. This was the tip that inspired this post!).

8.) Finally, one tip that I found useful is that you don’t want to git pull into your repository when you have uncommitted changes. Especially if you treasure your sanity. Instead git stash is your friend. Here’s how
* Do a git stash to move your uncommitted changes to a magical place in git temporarily
* Then do the git pull
* And finally do a git stash apply. This will now move your ’stashed’ uncommitted changes back (from the magical temporary place in git) into your working directory and take into account what what was changed by the pull. Neat!

Tips 1-7 taken from:  Git – SVN Crash Course. Tip 8 taken from painful experience :-)

If you want a good detailed yet friendly reference on a particular command search the Git User Manual on kernel.org.

Getting Drupal 7 (development snapshot) running on Ubuntu

Monday, September 28th, 2009

Notes before starting

  • At time of writing, only experimental snapshots of Drupal were available with the actual Drupal 7 release being some way off. The Drupal 5.x or Drupal 6.x series is recommended if you want to use Drupal in production
  • This guide was written against Ubuntu 8.04
  • This guide assumes
    • You have apache, mysql and php happily installed on your machine
    • That you are serving websites out of /var/www/
    • That that sites under /var/www/ are accessible in your browser via http://localhost/

Instructions

  • Download Drupal 7 from the development release section at and http://drupal.org/project/drupal
  • Extract the folder and rename the extracted folder to drupal7
  • Move the folder to an appropriate place on your webserver, such as under /var/www/
  • Create a fresh settings file for your new Drupal 7 site. You should use the supplied settings file as a basis, eg.
    • cp sites/default/default.settings.php sites/default/settings.php
  • Make the settings file writeable, so that the installer can edit it, using
    • chmod a+w sites/default/settings.php
  • Create a database for your Drupal 7 site
    • Log into mysql, eg.
      • mysql -uroot -p
    • Create a database once logged into mysql from the ‘mysql>’ prompt, eg.
      • create database drupal7;
    • Create a user for the database and grant permissions from the ‘mysql>’ prompt, eg.
      • GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON drupal7.* TO ‘drupal7user’@'localhost’ IDENTIFIED BY ‘drupal7password’;
  • Run the install script as follows
    • Browse to your new Drupal site at http://localhost/drupal7/install.php
    • Elect to proceed with a normal Drupal install (ie. not minimal) in your chosen language
    • As you proceed through the wizard, the installer may encounter issues creating certain directories for Drupal on the file system. If so, ensure then do the following
      • cd to the root of your drupal7 directory
      • mkdir sites/default/files
      • mkdir -p sites/default/private/files
      • mkdir sites/default/private/temp
      • Change the ownership of the created directories to belong to user account under which the web server runs under (www-data)
        • chown -R www-data:www-data private
        • chown -R www-data:www-data files
    • The wizard now asks you to configure the database settings. In the form presented by the wizard, replace the user ‘admin’ with the ‘drupal7user’ you created earlier and point at the drupal7 database. Remember to put in the correct password for ‘drupal7user’
    • If you get a 500 error in the last step, then ignore it and elect to continue through to the error page. This will actually let you continue the install
    • If you get the error starting with something like “Fatal error: Allowed memory size of 16777216 bytes exhausted” then allocate Drupal more memory in the settings file (see See http://drupal.org/node/90605 for more information), eg. Add the line
      • ini_set(‘memory_limit’, ‘30M’);

Hopefully now you should be good to go!

Open Letter to the Irish Government on Open Source Driven Innovation

Friday, September 18th, 2009

“Recent years show that openness and collaboration is essential to the generation of innovation in the software sector. Technology increasingly means software. In Ireland, we can see that the production of hardware technology in many, but not all, cases is providing ever diminishing returns. Here we outline some key policy recommendations that are crucial to the fulfilling the vision of making the Irish Smart Economy a reality for the software industry through the adoption and encouragement of Open Source technologies.”

The above extract is from a paper we are submitting to the Innovation Taskforce as requested by the Department of Taoiseach. The draft paper is available at Positioning Ireland as an International Innovation Hub

Please note, we are submitting the paper ahead of the deadline which is Friday the 18th of September. We appreciate any feedback, support or criticisms you may have. Please post them as comments below.

Packaging Ruby Apps for Ubuntu: Dissecting an existing Ruby Ubuntu Package

Wednesday, September 9th, 2009

One of the best ways to learn about how a Ubuntu package is put together is reverse engineer the package into it’s constituent components. We are going to take a look at how to do this for the chef application and it’s related libchef library is packaged as a Debian package.

* Visit the page http://packages.ubuntu.com/karmic/ruby/chef
* Under the Download chef section, download the package via the ‘All’ link into a directory called chef
* Visit the page http://packages.ubuntu.com/karmic/ruby/libchef-ruby1.8
* Under the Download libchef-ruby1.8 section, download the package via the ‘All’ link into a directory called libchef1.8

From the following guide (http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages) you can learn how to ‘unzip’ a Debian package. This is easy as they are pure ar archives. Here’s what we need to do

* In the chef directory, run the commands

ar vx chef_0.7.8-0ubuntu2_all.deb
tar -zxvf data.tar.gz

* In the libchef1.8 directory, run the commands

ar vx libchef-ruby_0.7.8-0ubuntu2_all.deb
tar -zxvf data.tar.gz

Now you can study the layout of the of the data payload of the package (this is where to look in order to study the anatomy of the application as it was being packaged). This layout is what will be of most interest to you.

If you have an application in a particular programming language that you wish to package, pick a similar application for which a package already exists and dissect it as shown above. Then bend your app into a similar shape in terms of directory layout before attempting to package it. To find out more about how to create your own Ubuntu packages check out this great video by Horst Jens Ubuntu: Making a .deb package out of a python program. It’s worth the effort of watching it to the end!

Happy packaging!

Bringing Back the Spirit of the Amateur Programmer

Wednesday, August 26th, 2009

In a blog post this month, Richard Dale (the man behind Qt/KDE’s Smoke bindings) eloquently phrased a noble goal,

“In the 1980s there were lots of computer magazines that used to publish programming articles with BASIC code, that everyone could input and run on their own computers. However, in the 1990s such large scale end user computer programming pretty much died out – tweaking the odd web page isn’t quite the same thing. One of the assumptions that the Free Software movement makes is that every user is also a programmer of some sort, who is able to tweak the software on their computers. I hope we can get back to that spirit, and change the way that people think about KDE programming, because at the moment there is a tendency to think it is hard and that only the ‘C++ gods’ like David Faure or Thiago Macieira can do it. In fact it is pretty easy to write small Python and Ruby apps and plasmoids, or to write a little script to message an app over DBus. We just need to get communities of like minded people together who write tutorials on TechBase, create blog entries with code (like the 1980s BASIC articles), and help beginners get started. These ubiquitous end user programming environments in Kubuntu (and other distributions I hope) will make it possible to do that.”

This really sums up something that would be fantastic to see over the next few years. There’s so many gadget lovers and technology geeks out there – the type of people who would’ve probably punched those BASIC tutorials into a Commodore 64, an Amstrad CPC464 or ZX Spectrum back in the good old days – that feel left behind as they perceive professional programmers to have blazed ahead a path that cannot be caught. But in many ways nothing could be further from the truth. For any programmer, there’s always some guy or gal that’s coding something more challenging or doing cleverer(er) stuff on the next machine. It’s all relative. And since software turned into a mainstream industry over the last couple of decades, it’s been the programmers doing the simplest tasks that have made the megabucks whilst the hardcore wizards of machine code and assembly have seen their demand dimish.

So next time you think there’s no point in picking up a few programming skills give a language like Ruby or Python a shot. Hopefully, with the continuing progress of Kubuntu and other distro’s to make programming more accessible, you’ll have the perfect environment to do so!

VirtualBox and Running a Virtual Ubuntu Image within an Ubuntu Host

Friday, March 27th, 2009

“What?” you say, “that’s a lot of Ubuntu going on! Why would you want to do such a thing?” The answer – for testing applications, replicating environments or perhaps running a few servers on one box.

This guide should work pretty well for any Linux distro, though you may need to replace the aptitude commands with the package manager of your choice. Here we’ll install a Hardy Heron guest inside an Intrepid Ibex host. Afterwards, we’ll also use dselect with apt in order to clone the packages on a machine we wish to replicate onto our guest OS. Oh ho the fun! Here goes…

We’ll start from scratch on your developer (host) machine with no prerequisites. Here are the steps
* Install the VirtualBox program
sudo aptitude install virtualbox
* Install 7zip, needed to extract downloaded image
sudo aptitude install p7zip
* Download Ubuntu 8.04 Hardy Heron iso image from http://virtualbox.wordpress.com/images/ubuntu/
* Make a new folder called my_temp
Move the downloaded file into my_temp
cd into my_temp
* Extract image
p7zip -d downloaded_imagefile
This should yield a folder called something like ubuntu-8.04-x86.
cd into this directory and run
- ‘mv VDI/ubuntu-8.04-x86 ~/.VirtualBox/VDI’
* Create a new virtual machine
- Run VirtualBox (should be in Accessories under the Applications menu or just type ‘virtualbox’ at the command line)
- Click the New button to create a new virtual machine
- Create a name for your Virtual Machine and set it’s OS Type
- Set the base memory to 256MB
- Elect to add an ‘Existing Hard Disk’, you the Add button and choose the ubuntu-8.04-x86.vdi under the ~/.VirtualBox/VDI directory
* Run and customise new virtual machine
- You should now have a new Virtual Ubuntu machine at your disposal. Start it up by clicking the Start button.
- Log in with ubuntu/reverse as username password. Double check that this is correct by looking at the site you downloaded the image from
- Once logged in change the password through the System/Administration/Users and Groups menu
- Install ‘Guest Host Additions’ from the Devices menu of the running window of you virtual machine. GHA allow you to copy and paste between the host and guest OS’s, along with a raft of other improvements. Tip: If your mouse gets stuck in the virtual machine window then use the right control key to let it escape.
If the GHA install does not work (due to a timeout) then you will need to install the Guest Host Additions manually, as follows
i) On your real Ubuntu machine (ie. the host) download the file that was specified as a URL in the popup that was displayed when you previously tried to install Guest Host Additions – if you forget the URL try to download the GHA again from the Devices menu and when the URL appears copy and paste it into FireFox running on your host machine. Note: The GHA are installed onto your host machine.
ii) Once downloaded, move the file to /usr/share/virtualbox on your host machine and create the following symlink (as virtualbox won’t recognise the file if it has the revision number in the filename)
sudo ln -s /usr/share/virtualbox/VBoxGuestAdditions_2.0.4.iso /usr/share/virtualbox/VBoxGuestAdditions.iso
iv) Once again try to install ‘Guest Host Additions’ from the Devices menu of the running window of you virtual machine. This time it will pick up the local file you downloaded.
* Create a shared folder – to swap files between your host and your VM
- On your host machine create a directory you will use for sharing
- On your running virtual machine create a directory you will use for sharing
- From the Devices menu of the running VirtualBox windows select Shared Folders and set the ‘folder path’ to the folder you just created on your host. Give it a friendly name in the ‘folder name’ field and elect to make it permanent. Then on your VM run
mount -t vboxsf the_friendly_name /path/to/folder/on/virtual/machine

Note: That vboxsf is the filesystem type that VirtualBox is using for shared folders

Now you should be ready to go with your VM. Congratulations!

As a final step you may want to take this vanilla Ubuntu machine update it so that it has the same packages as another machine, in the case where you are looking to replicate an environment. Use dselect and apt to do this as laid out in the following guide Restore Packages using dselect on Kevin von Zonneveld’s blog.

As a final step you may want to install any other software that is not covered by aptitude packages – such as programs for which no debian package exists or for things like Ruby on Rails gems. It shouldn’t take you long to put these on your new virtual machine and “hey presto!” you’re ready to rock!

Blackout Ireland Campaign Begins – No to Irish Internet Censorship

Thursday, March 5th, 2009

The battle for control of the Internet has begun within Ireland. In the red corner, Eircom has sided with the Big Four record companies – Sony-BMG, Universal and Warner and EMI – who are seeking to control the Irish Internet using coporate censorship and civil law techniques. In the blue corner, the Blackout Ireland campaign is looking to highlight the dangers of this censorship and has used social networking tools such as Twitter and Facebook to build support to protest this decision. A similar campaign was succesful in New Zealand, will it work again here?

Read more on OpenWriters.org.

Installing Drupal on Ubuntu (Gutsy) in a few easy steps

Friday, November 28th, 2008

Drupal is a great solution if you’re looking for a CMS system. In order to sneakily install LAMP with the minimum of fuss, I usually just install mod php and mod mysql (the apache related modules for php and mysql respectively) and that triggers pretty much everything else to be pulled automatically! So, from the command line…

sudo aptitude install libapache2-mod-php5

sudo aptitude install php5-mysql

… should give you Apache, MySQL and PHP in one fell swoop. Just to be sure that all is well run the following install commands

sudo apt-get install mysql-server
sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install php5-mysql

Then download and install Drupal (version 6.6 at time of writing) at http://drupal.org and follow their install guide.

One final tip, if there’s any problem with your apache installation’s configuration, you can install phpMyAdmin in order to plough through these problems as it will supply its own configuration. For example, I got the database configuration error when I was trying to connect to my database for the first time using Drupal

“Your web server does not appear to support any common database types. Check with your hosting provider to see if they offer any databases that Drupal supports.”

Turns out my apache config was dodge as when I did a ’sudo apache2ctl restart’ I got the following…

“apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName”

Installing phpMyAdmin and choosing apache2 when prompted during this process did the trick. Now go forth and Drupal!