Archive for the ‘Uncategorized’ Category

ossdev-ireland: A new Irish Open Source Developers Group

Monday, January 18th, 2010

ossdev-ireland is a group set up to act as a melting pot for the various different Open Source groups in Ireland.

Many group mailing lists already exist in Ireland for individual technologies, development languages and frameworks. However, each community is sandboxed into its own world. As a result there is less chance for cross-pollination of ideas between FOSS technologies, communities and individuals. The ossdev-ireland mailing list is to augment the existing mailing lists as a place to share ideas across the entire Open Source development community in Ireland.

In particular, it would be great to see the outcomes of code jams, bug triage sessions, or even links to slides that were presented at a group meetup, posted here. You never know who may be interested!

So if you want to browse or join ossdev-ireland, please visit us at http://groups.google.com/group/ossdev-ireland

Qt Programming Tips

Saturday, January 16th, 2010

This is a little more of an unusual blog post. It’s going to simply house a slowly growing list of Qt tips over time. Here goes

* Qt has the concept of models baked in. Usually you will only want to use them if you have a list of records involved. So let’s say you have a list of contacts like in an address book then this could be encapsulated in a QAbstractTableModel. If you just want to display a record in one-off fashion you can just populate a bunch of form fields (such as QLineEdits).

Offline Documentation for Rails (and other Ruby gems)

Thursday, November 12th, 2009

I used to pretty much always install gems with the –no-ri –no-rdoc options to speed up installation. Recently however, I’ve found myself needing to get access to documentation whilst on the move. So just in case you don’t know how that works, here’s the deal.

* Install your gems as per normal (ie. don’t use –no-ri or –no-rdoc)
* Run the command ‘gem server’ from the command line
* Browse to http://localhost:8808
* And voila! You should have all the docs you need available by clicking on the rdoc link for any given gem
* But if you really want to get fancy check out the searchable Rails documentation at http://railsapi.com – there’s an online version as well as the downloadable (the links are at the top of the page and can easily be mistaken for an advert!)

Audacity Tip of the Day – How Not to Lose Data!

Saturday, September 19th, 2009

One issue when editing audio, is copy and pasting a section of a track from one open Audacity project to another. To save space audacity does not copy the underlying track completely to the new project, rather it links to it. This means that your second project (the one you are pasting into) is not completely self-contained as it depends on external files. This can be a quickfire way for the unsuspecting podcaster to lose a whole bunch of data (yes, me!). This problem is particularly nasty as you don’t realise something has gone wrong until you close and reopen the project – finding that a long stretch of audio containing your beautiful voice is missing. To avoid this, adhere to the following workflow when copy and pasting from one project to another.

* In the first project, select and copy the audio you wish to duplicate
* Paste the audio into the second project
* In the File menu of the second project, click ‘Check Dependencies’
* Click ‘Copy All Audio into Project (Safer)’
* Just to stress the previous point, you really do want to use the Safer of the two copying options. I’ve found that using the other option results in some of the audio I wanted to copy being truncated

* Save the project

By following this workflow you should hopefully avoid seeing what I call the ‘dreaded blue flat-line of death’ where, on reopening of a project, you find that the middle of a track has been lost. If you adhere to these instructions you should also be able to select ‘Delete orphaned files’ when it appears from time to time while reopening an Audacity project. However, due to the frustrating and sensitive nature of audio loss issues, I accept no responsibility for anything that goes wrong! Best of luck and happy editing!

5 Apache Troubleshooting Tips for Friday

Friday, February 20th, 2009

1) When you browse all your hosted sites and they’re all down then there’s a good chance Apache is too. Do a ’sudo /etc/init.d/apache2 restart’ and pay special attention to see if the ‘fail’ message appears. Not sure if you get as good an indication that the server is ‘ok’ if you just do the more graceful ’sudo /etc/init.d/apache2 restart’

2) It goes without saying but check your log files, especially the error.log file at /var/log/apache2

3) Under /etc/apache2/sites-available/my_cool_website.com, ensure that any custom ErrorLog’s or CustomLog’s you have set actually exist on disk – or else apache may fail to restart

4) Restart, restart, restart! When you enable sites or modules try not to forget to restart apache. It easy to change a setting such as the server url of your site in a sites-available file and forget the all import restart. You’d think I did this before!

5) When you migrate servers don’t forget to set your application or site directories to the appropriate user. This is distro specific; on Red Hat and Cent OS this is ‘apache’, on Ubuntu this is ‘www-data’. Others could be different again.

Bonus tip: Apache comes with mod_rewrite installed but not enabled. If you need it, be sure to enable it using a ’sudo a2enmod rewrite’ and ya, you guessed it, restart apache!

Site Outage – 19th Feb 2009

Thursday, February 19th, 2009

Hi folks! The (hardworking) Irish Penguin has just been resolving some issues that led to a site outage last night due to a server migration that almost went smoothly! Apologies if it led to any inconvenience. All it takes is one little misplaced command!

The outage has been resolved and will keep you posted if I notice any other issues.

Happy hackin!

Recording Sound in Kubuntu 8.10 (running KDE 4.1)

Sunday, September 14th, 2008

Exciting times ahoy! This weeks mystery was to get sound recording with the minimum of fuss. We’re not sure what soundcard is running inside the Dell Inspiron 1520 which was our test laptop but it seems to report itself as an HDA Intel SigmaTel STAC9205 in the system settings. Anyway, the first thing to do was to apt install audacity which can then be used for testing the recording functionality. Not being sure if the laptops builtin in mic had been detected correctly, we jacked in an external microphone into the mic socket.

This didn’t produce any encouraging results initially when we tried recording in audacity so we opened up the KDE volume controls by clicking the speaker icon on the taskbar and electing to open the mixer. Unfortunately the GUI controls for the mixer doesn’t have the full complement of volume controls so it was the good ol command line to the rescue – typing alsamixer in terminal brings up a nice range of controls. You can navigate between screens of controls with the tab key and jump from control to control using the left/right arrow keys. The trick was to navigate to the two controls marked ‘Capture’ and bump up the volume (they also need to be activated by pressing the spacebar when you’re on the control). Additionally, there were two controls marked ‘Digital’. One of these controlled the volume of the mic (via the up and down arrows) and the other switched between analog and digital mode (again via the up and down arrows). We found that the latter had to be set to ‘Analog I’ for the best result.

Then it was back to audacity to record a bit of chatter – and then lament how weird ones voice sounds when recorded! Now get mixing mon amis!

QUICK UPDATE (14 Sep 08)
One issue that occurred was that after recording a sample, it couldn’t be played back(“Error while opening sound device. Please check the output device settings and the project sample rate.”). Additionally, a second track couldn’t be recorded. The solution to these problems was to open the Preferences dialog and set both the Playback and Record devices to ALSA (default). Reference: http://audacityteam.org/forum/viewtopic.php?f=18&t=3377

Getting Ruby Plasmoids up and running in KDE 4.1 (on Kubuntu)

Saturday, August 2nd, 2008

NOTE: THIS ARTICLE IS NOT YET COMPLETE. IF YOU FOLLOW IT THEN YOU WILL GO A LONG WAY BUT THE PLASMOID IS NOT YET DISPLAYING. SEE THE ‘Run your applet’ SECTION NEAR THE END OF THIS ARTICLE BEFORE PROCEEDING.

Introduction
KDE 4.1 is an absolutely terrific release of the KDE desktop, licking most of the issues presented in the original 4.0 release. Although it is still an early adopter release, 4.1 will be of interest to techie’s who want to get their mitts on a sexy new graphical interface and is reasonably stable for daily usage. Not quite ready for Aunt Tillie yet though! One of the nicest features is the beauty and simplicity of Plasmoids and these super flexible little gadgets can now be written in Ruby – well almost!

This guide assumes that you’re using Kubuntu Hardy Heron. But you should be able to adjust the instructions for any distro.

  • The starting point for our tour is to have Ruby installed. Google this if you’re unsure as to whether or not it’s installed.
  • We need to install cmake via ’sudo aptitude install cmake’. This is a cross-platform build system, similar to make.
  • It’s likely that you will need to install the build UNIX build tools via ‘aptitude search build-essential’.

Get coding!
And now you’re be ready to go. The main tutorial out there on Ruby Plasmoids at time of writing is the Ruby Applet tutorial on KDE Techbase. This is a very good, well written guide on creating a simple Ruby applet in which a web browser is embeded inside the plasmoid. But the guide has a couple of gotcha’s, especially for the newbie (myself included!), so we have listed solutions to these problems as we go. In summary, use our article as an supplement to KDE Techbase’s.

Ok, to start with a demo everyone wants a nicely packaged directory of files, so let’s quickly put together the basic directory structure for our plasmoid – it’s pretty simple!

  • Create a directory called ‘ruby-web-applet’
  • Save the files plasma-ruby-applet-web.desktop and web_applet.rb into this directory.
  • Create a file called CMakeLists.txt under your ruby-web-applet directory and paste the following code into it
set(SERVICES_INSTALL_DIR /usr/lib/kde4/share/kde4/services/)
set(DATA_INSTALL_DIR /usr/lib/kde4/share/kde4/apps/)

FIND_PACKAGE (Ruby REQUIRED)

include_directories( ${RUBY_INCLUDE_PATH} )
install(FILES plasma-ruby-applet-web.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES web_applet.rb DESTINATION ${DATA_INSTALL_DIR}/plasma_ruby_web_applet)

Go to KDE Techbase
Once you have the above directory in place, go and read the Ruby Applet tutorial on KDE Techbase article down to just before the ‘Install and test the Applet’ paragraph. This will teach you what’s going on in the code. At that point come back to me as I’ll go into a little more detail on the final installation procedure!

You’re back!
Great! Ok, so we have the files on disk, you have a good idea of what the code is doing, now let’s install it and kick your plasmoid into action!

Open the CMakeLists.txt file listed above in a text editor. Change the path listed for KDE4 services and data directories to the ones on your system. These are the lines to change.

set(SERVICES_INSTALL_DIR /usr/lib/kde4/share/kde4/services/)
set(DATA_INSTALL_DIR /usr/lib/kde4/share/kde4/apps/)

Do this by replacing ‘/usr/lib/kde4/share/kde4/services/’ with the output of the command ‘kde4-config –install services’ and replace ‘/usr/lib/kde4/share/kde4/apps/’ with the output of the command ‘kde4-config –install data’ command. If you are using Kubuntu then they should be the same as mine but otherwise you may need to change them.

Then make sure you are inside your ruby-web-applet directory and type

cmake .

to generate nice makefiles for you which the make command can then use. Don’t forget the trailing dot! Now type ‘make’ and ’sudo make install’. This will install your plasmoid code into the KDE4 services directory (you can see where this is by running ‘kde4-config –install services’) and your plasmoid data into the KDE4 data directory (you can see where this is by running ‘kde4-config –install data’). Effectively, the installation just involves the two files – plasma-ruby-applet-web.desktop web_applet.rb. If it’s worked then you’ll get output like

Install the project…
– Install configuration: “”
– Installing: /usr/lib/kde4/share/kde4/services/plasma-ruby-applet-web.desktop
– Installing: /usr/lib/kde4/share/kde4/apps/plasma_ruby_web_applet/web_applet.rb

The applet is now installed!

Run your applet (THIS DOES NOT WORK YET)
There are two ways to do this. In a developer kind of way you can run ‘kbuildsycoca4′ from the command line followed by ‘plasmoidviewer plasma-ruby-web-applet’. Unfortunately this currently brings up the error

findServiceByDesktopPath:  not found
findServiceByDesktopPath:  not found

IF YOU HAVE A SOLUTION TO THIS THEN PLEASE COMMENT BELOW!!!

As a user, the cmake/make/make install procedure should have done all the necessary to install your plasmoid and you can activate it by going to the right of the task bar and clicking the Add Widgets icon. You should see your plasmoid listed but unfortunately this is not yet working – presumably for the same reason as the above. Oh well, I’m sure a solution will soon be posted. Until then, happy hackin!

Final notes

Note that the KDE techbase article provides a version of this file but it didn’t work for me because

  • I knew nothing about cmake or cmake files and I didn’t even cop that right clicking on the CMakeLists.txt file link in their article and saving it to disk would also save a load of HTML into the file
  • The line ‘FIND_PACKAGE (RUBY REQUIRED)’ should really be ‘FIND_PACKAGE (Ruby REQUIRED)’ as it’s case sensitive and will otherwise give you the error

    CMake Error at CMakeLists.txt:6 (FIND_PACKAGE):
    find_package could not find module FindRUBY.cmake or a configuration file for package RUBY.

    Adjust CMAKE_MODULE_PATH to find FindRUBY.cmake or set RUBY_DIR to the directory containing a CMake configuration file for RUBY. The file will have one of the following names:

    RUBYConfig.cmake
    ruby-config.cmake

  • The destination targets specified in the file didn’t work for me. Perhaps some environment variables need to be set somewhere
  • I didn’t even know how to use cmake! Or that you needed to follow it up with ‘make’. Anyway we’ll come cover this soon!

I didn’t need to set any CMAKE_MODULE_PATH but if you are having troubles with this then it’s at /usr/share/cmake-2.6/Modules/ on Kubuntu Hardy Heron. You may be able to set it in your script if your having difficulties as follows ’set(CMAKE_MODULE_PATH /usr/share/cmake-2.6/Modules/)’. Again I haven’t tried this my self!

Microsoft Not So Sure on Taking on World…

Tuesday, May 15th, 2007

Under pressure arising from comments made by Microsoft’s Horacio Gutierrez and Brad Smith in an Fortune magazine article earlier this week saying that Open Source software contains 235 Micrsoft patents, the company has released a statement that it does not intend to resort to litigation in an effort to halt the growth of Open Source software. So why would they highlight an issue and then when asked to state specifically which are the patents in question they respond, “We’re not going to have a discussion publicly with that level of detail.”

The answer is simple. If they publish them it is likely that most of them will be thrown out by the U.S. courts as invalid. This became much easier recently, when the U.S. Supreme court made it easier to legally challenge individual patents and get them invalidated. This is because most software patents have been granted without due consideration and aren’t actually valid for many reasons. Patents have been grantly for things that are patently unpatenable.

Once this weeds out the likely majority of patents – Open Source developers will endevour to work around what patents, if any, remain.

So, back to the question, why would Microsoft highlight a meaningless question? Well, to bring up the issue in this manner creates a degree of uncertainty in the minds of certain business owners – however misplaced. Such people must weigh up risk every day and anything that they perceive adding risk to their business they will avoid. This will take two forms, one is to avoid Open Source software and stick with closed solutions. But this is becoming increasingly difficult as it is making more and more business sense to deploy Open Source solutions every day. The other is pay royalties to Microsoft for these (vaguely) alledged infringing patents. This is a sad situation because paying ‘money for nothing’ is money that you could otherwise use to grow your business.

Use the Force to Fix Evil Vista’s Bootloader

Friday, April 20th, 2007

Hmmm… Those lovely folks at Microsoft are at it again. This time trying to break my lovely Linux system by killing my bootloader – the clever bit of software which lets you choose whether to boot into Linux or Windows. Cheers guys! You’re real sweet!

I bought my machine with Vista pre-installed with about 50 gig spare for Linux. I installed OpenSuse 10.2 into this space, which uses a little program called GRUB to switch between the Windows Vista and OpenSuse Linux when you start up the computer. Somehow Vista managed to overwrite this – I don’t know how, as I installed Linux second, but anyway in order to fix you need to do the following

1.) Get yourself a LIVE Linux CD (ie. a linux system that boots of a CD with requiring it be installed on your harddrive). I used the OpenSuse 10.2 Live CD
2.) Boot from this disk and then folllow the brief instructions at the following link. Even though it outlines the process for Ubuntu (a different Linux distribution), it works just as well for OpenSuse 10.2

Happy hacking!