The Irish Penguin Watching Open Source unfold across Ireland

18Nov/100

Installing Ruby and Rubygems on Meego

Thanks to some great people on the Meego mailing lists I can happily show you how to get recent versions of Ruby and Rubygems running on your beloved MeeGo. The steps I present here are simply extracted from the guide at http://wiki.meego.com/Quality/QA-tools/TDriver

Once the more recent Ruby releases (1.8.7 and higher) gain more traction in MeeGo they will likely move into the core repository. So, be sure to see if they are there before changing adding/removing repositories as it outlined here.

Warning: You need to disable the MeeGo core repository and enable the testing and development repositories so be sure that you're happy to do this before continuing.

Steps:

#Remove the MeeGo core repo
sudo zypper rr core

# Enable the testing repo
sudo zypper ar http://download.meego.com/live/Trunk:/Testing/standard/Trunk:Testing.repo

# Enable the dev repo
sudo zypper ar http://download.meego.com/live/devel:/quality/testing/devel:quality.repo

If you run into trouble remove this last repo with the command. If you do so you will be able to go no further.

sudo zypper rr devel_quality

# Install Ruby 1.8.7
sudo zypper install ruby

# Install rubygems
sudo zypper install rubygems

Yay! You're done! This guide would likely not have happened unless the MeeGo conference and its sponsors had not given away free MeeGo netbooks to the smiling attendees. Well done guys! And thank you!

9Oct/100

Will there be a red carpet for Nokia at The Appys?

Just heard about this new awards ceremony The Appys! It will hand out the accolades to what it judges to be best mobile applications out there for a range of devices. As a long time Maemo fan and now MeeGo fan I'll be interested to see many apps are submitted for Nokia and its Ovi store.

Alas, my own humble efforts developing Qt on Rails apps aren't quite ready for entry. If you want to send in your own or vote on an app then today's deadline day! I just hope there's not too much in the way of gushing winners doing emotional acceptance speeches when the curtains come down on this one!

7May/101

Getting started with PostgreSQL when developing Rails applications

If you're familiar with MySQL and trying out PostgreSQL for the first time while doing some Ruby on Rails development, things can initially seem quite unfamiliar. A great first article to look at is available on the OLM on Rails site at Switching Rails to PostgreSQL. Also at this early stage in your PG career you'll need to know how to change things like user passwords so check the Examples section of the PostgreSQL Alter User docs.

Ok, after that you should know how to create a database in PostgreSQL, hook up to a Rails app and run migrations. Once that's done, you'll need to be able to do the same things that you were able to do in MySQL in the psql shell. Here's the first commands you need...

  • typing 'help' displays help at any time
  • \? displays help with psql commands
  • \l lists databases
  • \c some_database connects to a database
  • \c with no argument tells you what database you're currently connected to
  • \ds lists schemas within the currently selected database. A schema is simply a namespacing of tables within a given database
  • \dt lists tables in the currently selected database
  • \du lists all postgres database user accounts (more detail here)

Here's  a list of good of stuff...

4May/100

Doing Raw MongoDB Queries when using MongoMapper with Rails

Even though, you're using MongoMapper with Ruby and Rails, you may sometimes want to do queries using the Mongo database itself. Here's how I do it (note: there may be a better way, please post a comment).

# Getting at the mongodb instance
MongoMapper.database

# Listing its collections
MongoMapper.database.collections

# Get at any collection while within any model (note: returns a Mongo::Cursor)
coll = MongoMapper.database['questions'].find({})

# Convert that collection to an array (useful!)
coll.to_a

# Display a collection (note: 'each' does an implicit 'to_a()')
MongoMapper.database['questions'].find({}).each {|x| puts x.inspect}

# In the Question model you can use this shortcut
# collection to get at the questions collection
collection.find({}).to_a

29Mar/100

Hooking up a laptop to a projector using Nvidia Twinview on Kubuntu

UPDATE 1: As far as it can be confusing as to whether Nvidia Twinview is changing the underlying resolution of your display. Here's some tips that may help

  • Adjust the resolution ***before*** you hook up your laptop to a projector
  • If you adjust the resolution and it doesn't look like what you would expect (eg. the bottom half your display is missing) then logging out and back in may help

UPDATE 2: I found that adjusting the display settings using a tool other than Twinview helped (in KDE on OpenSuse 11.2 I found that searching for sax2, a part of YaST, let me change my screen resolution without problems - once I dropped the screen resolution to be the same as the resolution of the projector then I didn't need to mess around with Twinview at all).

Here is the rest of the original article...

The number of configuration options can be a bit daunting when you haven't used Nvidia Twinview before. Here's a quick simple recipe

* Set both the laptop screen to be the same as the maximum supported resolution of the projector (you can use the 'Model' dropdown list to choose between settings for the laptop and the projector). If you set the of the project to Auto and click apply the diagram should tell you the max supported resolution for the projector
* Ensure position is set to Absolute for both the laptop and the projector
* You can drag the actual boxes representing each screen in the diagram but the best thing to do is ensure they overlap as much as possible
* Finally click Apply and you should get a pretty good match. You may still need to resize the window you want to show in order to get the projector fully displaying it

18Jan/100

ossdev-ireland: A new Irish Open Source Developers Group

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

16Jan/100

Qt Programming Tips

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).

Tagged as: No Comments
12Nov/090

Offline Documentation for Rails (and other Ruby gems)

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!)

19Sep/091

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

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!

Filed under: Uncategorized 1 Comment
20Feb/090

5 Apache Troubleshooting Tips for Friday

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!

Filed under: Uncategorized No Comments