<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>The Irish Penguin</title>
	<atom:link href="http://www.theirishpenguin.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.theirishpenguin.com</link>
	<description>When Tux walks in, Irish eyes are smiling...</description>
	<pubDate>Thu, 27 Nov 2008 23:11:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Installing Drupal on Ubuntu (Gutsy) in a few easy steps</title>
		<link>http://www.theirishpenguin.com/2008/11/28/installing-drupal-on-ubuntu-gutsy-in-a-few-easy-steps/</link>
		<comments>http://www.theirishpenguin.com/2008/11/28/installing-drupal-on-ubuntu-gutsy-in-a-few-easy-steps/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 15:54:51 +0000</pubDate>
		<dc:creator>theirishpenguin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<category><![CDATA[UbuntuIreland]]></category>

		<guid isPermaLink="false">http://www.theirishpenguin.com/?p=80</guid>
		<description><![CDATA[Drupal is a great solution if you&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>Drupal is a great solution if you&#8217;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&#8230;</p>
<blockquote><p>sudo aptitude install libapache2-mod-php5</p>
<p>sudo aptitude install php5-mysql</p></blockquote>
<p>&#8230; should give you Apache, MySQL and PHP in one fell swoop. Just to be sure that all is well run the following install commands</p>
<blockquote><p>sudo apt-get install mysql-server<br />
sudo apt-get install apache2<br />
sudo apt-get install php5<br />
sudo apt-get install php5-mysql</p></blockquote>
<p>Then download and install Drupal (version 6.6 at time of writing) at http://drupal.org and follow their install guide.</p>
<p>One final tip, if there&#8217;s any problem with your apache installation&#8217;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</p>
<p>&#8220;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.&#8221;</p>
<p>Turns out my apache config was dodge as when I did a &#8217;sudo apache2ctl restart&#8217; I got the following&#8230;</p>
<p>&#8220;apache2: Could not reliably determine the server&#8217;s fully qualified domain name, using 127.0.1.1 for ServerName&#8221;</p>
<p>Installing phpMyAdmin and choosing apache2 when prompted during this process did the trick. Now go forth and Drupal!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theirishpenguin.com/2008/11/28/installing-drupal-on-ubuntu-gutsy-in-a-few-easy-steps/feed/</wfw:commentRss>
		</item>
		<item>
		<title>3 Cheers for OSS Barcamp Dublin!</title>
		<link>http://www.theirishpenguin.com/2008/11/23/3-cheers-for-oss-barcamp-dublin/</link>
		<comments>http://www.theirishpenguin.com/2008/11/23/3-cheers-for-oss-barcamp-dublin/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 13:52:29 +0000</pubDate>
		<dc:creator>theirishpenguin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<category><![CDATA[UbuntuIreland]]></category>

		<guid isPermaLink="false">http://www.theirishpenguin.com/?p=82</guid>
		<description><![CDATA[Another exciting event has just been announced for Dublin next year with an Open Source Software Barcamp planned for Dublin March 28th next year. And you could be one of the speakers! The idea behind a barcamp is to have a casual relaxed atmosphere where the attendees can help drive the schedule - like a [...]]]></description>
			<content:encoded><![CDATA[<p>Another exciting event has just been announced for Dublin next year with an Open Source Software Barcamp planned for Dublin March 28th next year. And you could be one of the speakers! The idea behind a barcamp is to have a casual relaxed atmosphere where the attendees can help drive the schedule - like a conference done in the spirit of Digg. For more info check out <a title="OSSBARCAMP - 28th March 2009" href="http://www.lczajkowski.com/2008/11/20/ossbarcamp-28th-march-2009">Laura Czajkowski&#8217;s blog post</a> and if you want to keep up to date with further details you can track things on <a title="ossbarcamp on twitter" href="http://twitter.com/ossbarcamp">ossbarcamp on twitter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theirishpenguin.com/2008/11/23/3-cheers-for-oss-barcamp-dublin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>File downloads over the command line via CURL</title>
		<link>http://www.theirishpenguin.com/2008/11/23/file-downloads-over-the-command-line-via-curl/</link>
		<comments>http://www.theirishpenguin.com/2008/11/23/file-downloads-over-the-command-line-via-curl/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 12:58:21 +0000</pubDate>
		<dc:creator>theirishpenguin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[UbuntuIreland]]></category>

		<guid isPermaLink="false">http://www.theirishpenguin.com/?p=81</guid>
		<description><![CDATA[This could be a pretty obvious one to a lot of people but it&#8217;s just so handy. This will download a file from somewhere.com to your local directory
curl -O http://somewhere.com/somefile.tar.gz
Really handy when you&#8217;re administering a remote server and need to pull down files.
]]></description>
			<content:encoded><![CDATA[<p>This could be a pretty obvious one to a lot of people but it&#8217;s just so handy. This will download a file from somewhere.com to your local directory</p>
<p>curl -O http://somewhere.com/somefile.tar.gz</p>
<p>Really handy when you&#8217;re administering a remote server and need to pull down files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theirishpenguin.com/2008/11/23/file-downloads-over-the-command-line-via-curl/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Troubleshooting fcgi and the dreaded undefined method `require_gem&#8217; error</title>
		<link>http://www.theirishpenguin.com/2008/10/09/troubleshooting-fcgi-and-the-dreaded-undefined-method-require_gem-error/</link>
		<comments>http://www.theirishpenguin.com/2008/10/09/troubleshooting-fcgi-and-the-dreaded-undefined-method-require_gem-error/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 20:33:10 +0000</pubDate>
		<dc:creator>theirishpenguin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Rubyonrails]]></category>

		<guid isPermaLink="false">http://www.theirishpenguin.com/?p=79</guid>
		<description><![CDATA[It happens to the best of us. We&#8217;ve coded our app go to deploy it and encounter some dispatch.fcgi issue. Today was the turn of

dispatch.fcgi error: undefined method `require_gem' for main:Object (NoMethodError)

Well way to troubleshoot and arrive at a solution is to actually run ./dispatch.fcgi. I didn&#8217;t know you could do this! It&#8217;s well handy! [...]]]></description>
			<content:encoded><![CDATA[<p>It happens to the best of us. We&#8217;ve coded our app go to deploy it and encounter some dispatch.fcgi issue. Today was the turn of<br />
<code><br />
dispatch.fcgi error: undefined method `require_gem' for main:Object (NoMethodError)<br />
</code></p>
<p>Well way to troubleshoot and arrive at a solution is to actually run ./dispatch.fcgi. I didn&#8217;t know you could do this! It&#8217;s well handy! If you are on a remote server to which you don&#8217;t have ssh access then you can probably still run it as a cron job. Something like cd /path/to/my/app/public &#038;&#038; ./dispatch.fcgi should do it. Remember that the dispatch.fcgi file is in the public directory of your application. The combination of running ./dispatch.fcgi and viewing the Rails log file revealed the useful error message above. Then a quick google search revealed that we need to change require_gem to simply gem (see <a href="http://blog.nanorails.com/articles/2007/12/20/ruby-gem-1-0-is-out">here</a>).</p>
<p>I had to change this in the dispatch.fcgi and then grepped the whole application directory for any instances of require_gem and changed them to gem too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theirishpenguin.com/2008/10/09/troubleshooting-fcgi-and-the-dreaded-undefined-method-require_gem-error/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Recording Sound in Kubuntu 8.10 (running KDE 4.1)</title>
		<link>http://www.theirishpenguin.com/2008/09/14/recording-sound-in-kubuntu-810-running-kde-41/</link>
		<comments>http://www.theirishpenguin.com/2008/09/14/recording-sound-in-kubuntu-810-running-kde-41/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 18:30:39 +0000</pubDate>
		<dc:creator>theirishpenguin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<category><![CDATA[UbuntuIreland]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.theirishpenguin.com/?p=77</guid>
		<description><![CDATA[Exciting times ahoy! This weeks mystery was to get sound recording with the minimum of fuss. We&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>Exciting times ahoy! This weeks mystery was to get sound recording with the minimum of fuss. We&#8217;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.</p>
<p>This didn&#8217;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&#8217;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 &#8216;Capture&#8217; and bump up the volume (they also need to be activated by pressing the spacebar when you&#8217;re on the control). Additionally, there were two controls marked &#8216;Digital&#8217;. 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 &#8216;Analog I&#8217; for the best result.</p>
<p>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!</p>
<p>QUICK UPDATE (14 Sep 08)<br />
One issue that occurred was that after recording a sample, it couldn&#8217;t be played back(&#8221;Error while opening sound device. Please check the output device settings and the project sample rate.&#8221;). Additionally, a second track couldn&#8217;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&amp;t=3377</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theirishpenguin.com/2008/09/14/recording-sound-in-kubuntu-810-running-kde-41/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting Ruby Plasmoids up and running in KDE 4.1 (on Kubuntu)</title>
		<link>http://www.theirishpenguin.com/2008/08/02/getting-ruby-plasmoids-up-and-running-in-kde-41-on-kubuntu/</link>
		<comments>http://www.theirishpenguin.com/2008/08/02/getting-ruby-plasmoids-up-and-running-in-kde-41-on-kubuntu/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 11:24:12 +0000</pubDate>
		<dc:creator>theirishpenguin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.theirishpenguin.com/?p=76</guid>
		<description><![CDATA[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 &#8216;Run your applet&#8217; 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 [...]]]></description>
			<content:encoded><![CDATA[<p><b>NOTE:</b> 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 &#8216;Run your applet&#8217; SECTION NEAR THE END OF THIS ARTICLE BEFORE PROCEEDING.</p>
<p><b>Introduction</b><br />
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&#8217;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!</p>
<p>This guide assumes that you&#8217;re using Kubuntu Hardy Heron. But you should be able to adjust the instructions for any distro.</p>
<ul>
<li>The starting point for our tour is to have Ruby installed. Google this if you&#8217;re unsure as to whether or not it&#8217;s installed.</li>
<li>We need to install cmake via &#8217;sudo aptitude install cmake&#8217;. This is a cross-platform build system, similar to make.</li>
<li>It&#8217;s likely that you will need to install the build UNIX build tools via &#8216;aptitude search build-essential&#8217;.</li>
</ul>
<p><b>Get coding!</b><br />
And now you&#8217;re be ready to go. The main tutorial out there on Ruby Plasmoids at time of writing is the <a href="http://techbase.kde.org/Development/Tutorials/Plasma/RubyApplet">Ruby Applet tutorial on KDE Techbase</a>. 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&#8217;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&#8217;s.</p>
<p>Ok, to start with a demo everyone wants a nicely packaged directory of files, so let&#8217;s quickly put together the basic directory structure for our plasmoid - it&#8217;s pretty simple!</p>
<ul>
<li>Create a directory called &#8216;ruby-web-applet&#8217;</li>
<li>Save the files <a href="http://websvn.kde.org/trunk/KDE/kdebindings/ruby/plasma/examples/applets/webapplet/plasma-ruby-applet-web.desktop?view=markup">plasma-ruby-applet-web.desktop</a> and <a href="http://websvn.kde.org/trunk/KDE/kdebindings/ruby/plasma/examples/applets/webapplet/web_applet.rb?view=markup">web_applet.rb</a> into this directory.</li>
<li>Create a file called CMakeLists.txt under your ruby-web-applet directory and paste the following code into it</li>
</ul>
<pre>
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)
</pre>
<p><b>Go to KDE Techbase</b><br />
Once you have the above directory in place, go and read the <a href="http://techbase.kde.org/Development/Tutorials/Plasma/RubyApplet">Ruby Applet tutorial on KDE Techbase</a> article down to just before the &#8216;Install and test the Applet&#8217; paragraph. This will teach you what&#8217;s going on in the code. At that point come back to me as I&#8217;ll go into a little more detail on the final installation procedure!</p>
<p><b>You&#8217;re back!</b><br />
Great! Ok, so we have the files on disk, you have a good idea of what the code is doing, now let&#8217;s install it and kick your plasmoid into action!</p>
<p>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.</p>
<pre>
set(SERVICES_INSTALL_DIR /usr/lib/kde4/share/kde4/services/)
set(DATA_INSTALL_DIR /usr/lib/kde4/share/kde4/apps/)
</pre>
<blockquote><p>
Do this by replacing &#8216;/usr/lib/kde4/share/kde4/services/&#8217; with the output of the command &#8216;kde4-config &#8211;install services&#8217; and replace &#8216;/usr/lib/kde4/share/kde4/apps/&#8217; with the output of the command &#8216;kde4-config &#8211;install data&#8217; command. If you are using Kubuntu then they should be the same as mine but otherwise you may need to change them.
</p></blockquote>
<p>Then make sure you are inside your ruby-web-applet directory and type </p>
<blockquote><p>cmake .</p></blockquote>
<p> to generate nice makefiles for you which the make command can then use. Don&#8217;t forget the trailing dot! Now type &#8216;make&#8217; and &#8217;sudo make install&#8217;. This will install your plasmoid code into the KDE4 services directory (you can see where this is by running &#8216;kde4-config &#8211;install services&#8217;) and your plasmoid data into the KDE4 data directory (you can see where this is by running &#8216;kde4-config &#8211;install data&#8217;). Effectively, the installation just involves the two files - plasma-ruby-applet-web.desktop web_applet.rb. If it&#8217;s worked then you&#8217;ll get output like</p>
<blockquote><p>
Install the project&#8230;<br />
&#8211; Install configuration: &#8220;&#8221;<br />
&#8211; Installing: /usr/lib/kde4/share/kde4/services/plasma-ruby-applet-web.desktop<br />
&#8211; Installing: /usr/lib/kde4/share/kde4/apps/plasma_ruby_web_applet/web_applet.rb
</p></blockquote>
<p>The applet is now installed!</p>
<p><b>Run your applet (THIS DOES NOT WORK YET)</b><br />
There are two ways to do this. In a developer kind of way you can run &#8216;kbuildsycoca4&#8242; from the command line followed by &#8216;plasmoidviewer plasma-ruby-web-applet&#8217;. Unfortunately this currently brings up the error</p>
<pre>
findServiceByDesktopPath:  not found
findServiceByDesktopPath:  not found
</pre>
<p><b>IF YOU HAVE A SOLUTION TO THIS THEN PLEASE COMMENT BELOW!!! </b></p>
<p>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&#8217;m sure a solution will soon be posted. Until then, happy hackin!</p>
<p><b>Final notes</b></p>
<p>Note that the KDE techbase article provides a version of this file but it didn&#8217;t work for me because</p>
<ul>
<li>I knew nothing about cmake or cmake files and I didn&#8217;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</li>
<li>The line &#8216;FIND_PACKAGE (RUBY REQUIRED)&#8217; should really be &#8216;FIND_PACKAGE (Ruby REQUIRED)&#8217; as it&#8217;s case sensitive and will otherwise give you the error<br />
<blockquote><p>
CMake Error at CMakeLists.txt:6 (FIND_PACKAGE):<br />
find_package could not find module FindRUBY.cmake or a configuration file for package RUBY.</p>
<p>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:</p>
<p>RUBYConfig.cmake<br />
ruby-config.cmake
</p></blockquote>
</li>
<li>The destination targets specified in the file didn&#8217;t work for me. Perhaps some environment variables need to be set somewhere</li>
<li>I didn&#8217;t even know how to use cmake! Or that you needed to follow it up with &#8216;make&#8217;. Anyway we&#8217;ll come cover this soon!</li>
</ul>
<p>I didn&#8217;t need to set any CMAKE_MODULE_PATH but if you are having troubles with this then it&#8217;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 &#8217;set(CMAKE_MODULE_PATH /usr/share/cmake-2.6/Modules/)&#8217;. Again I haven&#8217;t tried this my self!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theirishpenguin.com/2008/08/02/getting-ruby-plasmoids-up-and-running-in-kde-41-on-kubuntu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A Little Help on Importing Gmail Contacts using Ruby on Rails</title>
		<link>http://www.theirishpenguin.com/2008/06/25/a-little-help-on-importing-gmail-contacts-using-ruby-on-rails/</link>
		<comments>http://www.theirishpenguin.com/2008/06/25/a-little-help-on-importing-gmail-contacts-using-ruby-on-rails/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 20:46:33 +0000</pubDate>
		<dc:creator>theirishpenguin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Rubyonrails]]></category>

		<guid isPermaLink="false">http://www.theirishpenguin.com/2008/06/25/a-little-help-on-importing-gmail-contacts-using-ruby-on-rails/</guid>
		<description><![CDATA[We came across a fabulous article on getting your RoR app to pull contacts from your Gmail account at Atlantic Domain Solutions: Import Gmail Contacts using Ruby on Rails. Kudos to Atlantic Domain Solutions! This is a really great article. The only slight issue is that it omitted a couple of details which may confuse [...]]]></description>
			<content:encoded><![CDATA[<p>We came across a fabulous article on getting your RoR app to pull contacts from your Gmail account at <a href="http://rorblog.techcfl.com/2008/04/18/import-gmail-contacts-using-ruby-on-rails">Atlantic Domain Solutions: Import Gmail Contacts using Ruby on Rails</a>. Kudos to Atlantic Domain Solutions! This is a really great article. The only slight issue is that it omitted a couple of details which may confuse the newbie - in particular, where does all the code in points 1, 2 and 3 go and how do the code snippets relate to each other.</p>
<p>So here&#8217;s a set of clarifications to the original article (a &#8216;meta-guide&#8217; if you will), as we didn&#8217;t want to just rip off these nice folks source code. Thus read these clarifications in conjunction with the original Atlantic Domain Solutions guide.</p>
<p>We&#8217;ll assume that you know how to create a new rails app from scratch and create a controller. While you&#8217;re following this you can use localhost as your server (eg. the default localhost:3000).</p>
<p>Create yourself a controller called ImportedContacts</p>
<pre>class ImportedContactsController &lt; ApplicationController

    def authenticate
        # Put the code from point 1 in the Atlantic Domain Solutions article here.

        # Note:
        # Set the next_param to the follow on controller action. For example,
        # next_param = url_for(:action =&gt; 'authorise')
    end

    def authorise
        # Put the code from point 2 in the article here.

        # Note:
        # I changed some of the code as shown below...
        # if resp.code == "200"
        #     token = ''
        #     data.split.each do |str|
        #         if not (str =~ /Token=/).nil?
        #             token = str.gsub(/Token=/, '')
        #         end
        #     end
        #     redirect_to(:action =&gt; 'import', :token =&gt; token)
        # else
        #     redirect_to ('/')
        # end
    end

    def import
        # Put the code point 3 from the article here.

        # Some notes:
        # Put the line 'authsub_token = params[:token]' at around line 4 of this method
        # (just after the two requires). It was accidentally omitted in the original article.
        # I also changed the local variable 'contacts' to '@contacts' so that it is available to views
    end
end</pre>
<p>To see the contacts after importing, I created a folder called &#8216;imported_contacts&#8217; under app/views and placed the file import.rhtml in it, containing the following code.</p>
<pre>
&lt;table&gt;
  <%= @contacts.map { |c| "&lt;tr&gt;&lt;td&gt;Name: #{c['name']}&lt;/td&gt;&lt;td&gt;Email: #{c['email']}&lt;/td&gt;&lt;/tr&gt;" } %>
&lt;/table&gt;
</pre>
<p>Ok! You should be ready to rock! Ensure that you are not logged into gmail and visit http://localhost:3000/imported_contacts/authenticate</p>
<p>You should be brought to a Google account login page. Login and you will be brought to the Google page for allowing third party access to the Google API. Click &#8216;Grant&#8217; and you should be brought to your app&#8217;s import.rhtml page which should hopefully be displaying all your lovely contacts! Hurrah!</p>
<div class="flockcredit" style="text-align: right; color: #CCC; font-size: x-small;">Blogged with the <a style="color: #999; font-weight: bold;" title="Flock Browser" href="http://www.flock.com/blogged-with-flock" target="_new">Flock Browser</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.theirishpenguin.com/2008/06/25/a-little-help-on-importing-gmail-contacts-using-ruby-on-rails/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Just Diff the Internet</title>
		<link>http://www.theirishpenguin.com/2008/06/22/just-diff-the-internet/</link>
		<comments>http://www.theirishpenguin.com/2008/06/22/just-diff-the-internet/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 13:19:44 +0000</pubDate>
		<dc:creator>theirishpenguin</dc:creator>
		
		<category><![CDATA[Geek]]></category>

		<category><![CDATA[Opinion Piece]]></category>

		<category><![CDATA[Politics]]></category>

		<category><![CDATA[Rant]]></category>

		<category><![CDATA[UbuntuIreland]]></category>

		<guid isPermaLink="false">http://www.theirishpenguin.com/2008/06/22/just-diff-the-internet/</guid>
		<description><![CDATA[Woke up this morning and found myself dead&#8230; Well, more to the point, my Internet connection dead. So being a Nymphobyte - someone feverously attracted to a reliable high bandwidth connection - there was little else to do than ponder the state of broadband in Ireland. Options are limited in the land currently home to [...]]]></description>
			<content:encoded><![CDATA[<p>Woke up this morning and found myself dead&#8230; Well, more to the point, my Internet connection dead. So being a Nymphobyte - someone feverously attracted to a reliable high bandwidth connection - there was little else to do than ponder the state of broadband in Ireland. Options are limited in the land currently home to the so called &#8216;Pariahs&#8217; of Europe. Just make our broadband better and we&#8217;ll vote Yes! to Lisbon II and even Lisbon III &#8216;The Search for Spock&#8217;. Until then, you&#8217;re better off sending your packets of data back and forth via carrier pigeon rather than trying to connect via the empty promises of the current providers.</p>
<p>At least things aren&#8217;t as bad as in Sweden, oft thought of as land of the liberal and freedom loving Swedes, where their elected leaders are trying to sell them down the river - forcing a copy of all networked communications to be forwarded on the government so that they can, presumably, check for things like terrorists trying to share the latest episode of Desperate Housewives over Bittorrent. Sweden is now being mentioned in the same breath as China and Saudi Arabia with respect to Internet Freedom. According to an <a href="http://www.information-age.com/home/information-age-today/443366/sweden-to-snoop-on-all-international-phone-and-email-traffic.thtml">Information Age article</a> even Google, not known to be adverse to collecting data on people, has been heavily critical of the crippling legislation. Blogger Oscar Swartz has a rallying mayday call on his <a href="http://swartz.typepad.com/texplorer/2008/06/mayday-mayday-internet-wall-of-china---around-sweden.html">site</a>. Yes, that&#8217;s right, even the Scandinavians have given up on civil rights - now we know the world is doomed! They&#8217;re kind of like a civil liberties version of those budgies that used to warn of noxious fumes down the mine shafts in the old days - once they go tits up then you know the game is over.</p>
<p>Nope, freedom is not on the menu anywhere this week. An <a href="http://www.economist.com/world/britain/displaystory.cfm?story_id=11594471">article</a> in The Economist took stock of the scale of civil liberties that have been eroded under the Labour government and the relative apathy that this has been met with by the people. Gordon Brown, despite the having the popularity of Brian Cowan at a Eurocrat orgy, has even managed to push through legislation in Parliament to the effect that one can now be detained for 45 days at a go without charge. That&#8217;s over 6 weeks! You could miss the whole European championships if you&#8217;re unlucky enough! Which might suit you if you&#8217;re a Portuguese or Croatian fan, after their sides painful exists. But 6 weeks! Perhaps Gordon just has a secret repressed side that he didn&#8217;t know about - which is subconsciously upset that Ireland is now seen as more Eurosceptic than Britain. Forty five days isn&#8217;t so bad though. After all, Tony Blair wanted to lock &#8216;em up for 90 days without charge. Why not go the whole hog and just lock people up at birth? It saves all that awkward decision making and you wouldn&#8217;t even need National Identity Cards anymore. Mind you, who needs ID cards when everyone one has already gotten their own copy of secret government dossiers that they picked up on the Tube on the way to work. Now there&#8217;s a government I wouldn&#8217;t trust mind my dog for the weekend, never mind my confidential information. And I don&#8217;t even own a dog&#8230;</p>
<p>It&#8217;s been a tough week all right. It&#8217;s hard to know how to stay on top of things. My great plan is to do away with RSS feeds and subscriptions and just diff the Internet each morning before going to work. If there was some interesting news found it could be managed using git and deltas emailed to friends to keep them informed. Sure, it would be a lot of data to contend with, but there would be some scant satisfaction knowing that it would make those draconian Swedish government servers that spy on their citizens work that little bit harder!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theirishpenguin.com/2008/06/22/just-diff-the-internet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quick Example of Serialisation via to_json in Ruby On Rails</title>
		<link>http://www.theirishpenguin.com/2008/05/19/quick-example-of-serialisation-via-to_json-in-ruby-on-rails/</link>
		<comments>http://www.theirishpenguin.com/2008/05/19/quick-example-of-serialisation-via-to_json-in-ruby-on-rails/#comments</comments>
		<pubDate>Sun, 18 May 2008 21:41:53 +0000</pubDate>
		<dc:creator>theirishpenguin</dc:creator>
		
		<category><![CDATA[Geek]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Rubyonrails]]></category>

		<guid isPermaLink="false">http://www.theirishpenguin.com/?p=73</guid>
		<description><![CDATA[Ruby On Rails provides a few neat ways to serialise/deserialise objects to JSON. Out of the box you get the following approaches
SERIALISING

* json_string = a_house.to_json

DESERIALISING

* an_object = ActiveSupport::JSON.decode(json_string) # gives you an object of type Object
* a_house.from_json(json_string) # gives you an object of type House, note that a_house
        [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby On Rails provides a few neat ways to serialise/deserialise objects to JSON. Out of the box you get the following approaches</p>
<p>SERIALISING</p>
<pre>
* json_string = a_house.to_json
</pre>
<p>DESERIALISING</p>
<pre>
* an_object = ActiveSupport::JSON.decode(json_string) # gives you an object of type Object
* a_house.from_json(json_string) # gives you an object of type House, note that a_house
                                             # is an instance of House
</pre>
<p>These are pretty straightforward and do exactly what they say on the tin. Of the deserialising methods, note that using ActiveSupport directly gives you an object of type Object so you may prefer the stronger typing of the second technique which gives you an actual House object.</p>
<p><strong>Note:</strong> There&#8217;s  been some great improvements to JSON support built right into Rails since Rails 2 has come around. For more info on this see <a title="here" href="http://blog.codefront.net/2007/10/10/new-on-edge-rails-json-serialization-of-activerecord-objects-reaches-maturity/">here</a>.</p>
<p><strong>When things just aren&#8217;t enough&#8230;</strong><br />
There are times when you will want to override the default serialisation that Rails provides - such as if you want to do some object &#8216;flattening&#8217; like including an attribute from an association on serialising. Now before proceeding check out the latest Rails 2 JSON support mentioned at the end of the previous section as this might make your life a lot easier. Otherwise, let&#8217;s press on with an example of DIY JSON handling.</p>
<p>Given a House object which has an associated Owner object, you might want to include the Owner&#8217;s name attribute when serialising a House.</p>
<p>House Class<br />
- has address and value attributes<br />
- has an associated Owner object</p>
<p>Owner Class<br />
- has a name attribute</p>
<p>We&#8217;ll need to override the default to_json method on the House model.</p>
<pre>class House::Base
  def to_json
    result = Hash.new

    self.class.content_columns.each do |column|
      if self.attributes.include?(column.name)
        result[column.name.to_sym] = self.send(column.name)
      end
    end

    if self.attributes.include?(column.name)
      result[:owner_name] = owner.name
    end

    result.to_json
  end
end</pre>
<p>The above was partially taken from the <a href="http://wiki.rubyonrails.org/rails/pages/howtogeneratejson">howtogeneratejson</a> page on the Rails wiki, which is has little bit more detail. Now all you need to do is call the a_house.to_json method and you get lots of lovely JSON which represents your model! One final note is that you may not want to override the default to_json method. If not, just call your method something else like to_custom_json. Also, there&#8217;s</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theirishpenguin.com/2008/05/19/quick-example-of-serialisation-via-to_json-in-ruby-on-rails/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mercurial, Python and a Packet of Crisps</title>
		<link>http://www.theirishpenguin.com/2008/04/07/mercurial-python-and-a-packet-of-crisps/</link>
		<comments>http://www.theirishpenguin.com/2008/04/07/mercurial-python-and-a-packet-of-crisps/#comments</comments>
		<pubDate>Sun, 06 Apr 2008 18:07:59 +0000</pubDate>
		<dc:creator>theirishpenguin</dc:creator>
		
		<category><![CDATA[Geek]]></category>

		<category><![CDATA[UbuntuIreland]]></category>

		<guid isPermaLink="false">http://www.theirishpenguin.com/?p=72</guid>
		<description><![CDATA[Came across this exciting bit of news on the ol wireless just recently that rails is moving from SVN to Git. Exciting times indeed as more and more developers are realising the merits of distributed source control to manage an ever expanding code base. This Irish Penguin&#8217;s been in the fortunate position of working a [...]]]></description>
			<content:encoded><![CDATA[<p>Came across this exciting bit of news on the ol wireless just recently that <a href="http://weblog.rubyonrails.com/2008/4/2/rails-is-moving-from-svn-to-git">rails is moving from SVN to Git</a>. Exciting times indeed as more and more developers are realising the merits of distributed source control to manage an ever expanding code base. This Irish Penguin&#8217;s been in the fortunate position of working a lot with Mercurial, an alternative to Git, for the last few weeks and these types of tools are just a great way to work.</p>
<p>One of the big pluses is that your code and your repository (the history of all edits you&#8217;ve ever made to the code) is all in one directory which makes the process of source control really filesystem based. This is great when you&#8217;re learning and just experimenting as you become more familiar with your new favourite toy. If you want to try something out, you just copy the directory somewhere and if it all goes to pot then it&#8217;s just a quick copy command to restore it back to its original state!</p>
<p>If you&#8217;re a Ruby or Python dev one of the really nice things about Mercurial (also known as hg - after the chemical symbol) is that it&#8217;s done in Python, which means that it&#8217;s pretty easy to hack a bit of code together if you want to extend functionality. A whole Saturday was lost to the cause of hacking Mercurial in Dublin&#8217;s Central Hotel last weekend - as your host recovered from a bout of Extreme Coughing (there are more germs going round here at the moment than sheep in New Zealand!) over a pint of orange and a packet of crisps. Good fun! It was kind of weird though. As soon as urs truly had booted up the laptop, a bunch of folks grabbed seats to the back of the room muttering about Ubuntu cds and wifi. Sounds like Linux is all over Dublin like a rash. A very nice rash of course!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theirishpenguin.com/2008/04/07/mercurial-python-and-a-packet-of-crisps/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
