Archive for the 'Quick Tips' Category

Installing DB2 9.5 on Ubuntu 7.10

Antonio Cangiano November 11th, 2007

The official IBM site now has DB2 Express-C 9.5 available for download. Like its previous versions it’s entirely free, so why don’t you give it a try?

When running db2setup, after extracting the archive you downloaded, you may be disappointed to see that on Ubuntu 7.10 the setup program gives you the following error right out of the box:

ERROR:
 The required library file libstdc++.so.5 is not found on the system.
ERROR:
 The required library file libaio.so.1 is not found on the system.
 Check the following web site for the up-to-date system requirements
 of IBM DB2 9.5
 http://www.ibm.com/software/data/db2/udb/sysreqs.html
 http://www.software.ibm.com/data/db2/linux/validate
/home/antonio/Desktop/exp/db2/linux/install/../bin/db2usrinf:
error while loading shared libraries: libstdc++.so.5:
cannot open shared object file: No such file or directory
[: 609: 0: unexpected operator
/home/antonio/Desktop/exp/db2/linux/install/../bin/db2langdir:
error while loading shared libraries: libstdc++.so.5:
cannot open shared object file: No such file or directory
/home/antonio/Desktop/exp/db2/linux/install/../bin/db2langdir:
error while loading shared libraries: libstdc++.so.5:
cannot open shared object file: No such file or directory
DBI1055E The message file db2install.cat cannot be found.

Explanation:  The message file required by this
script is missing from the system; it may have been
deleted or the database products may have been loaded
incorrectly.

User Response:  Verify that the product option containing
the message file is installed correctly.  If there are
verification errors; reinstall the product option.


Here is a handy tip, just in case you get stuck with this error. You can install the prerequisites and run the DB2 setup program simply by executing the three commands below (in order).

sudo apt-get install libstdc++5
sudo apt-get install libaio-dev
sudo ./db2setup


I hope this quick tip saves you some time and a headache.

Redirecting Atom feeds from Typo and Wordpress to FeedBurner

Antonio Cangiano July 24th, 2007

With the recent switch from Typo to Wordpress I had to address the issue of handling my existing and new feeds. On top of that I decided that it was the right moment to switch to FeedBurner, so I had to handle the redirect for both Typo and Wordpress at the same time. If you prefer Atom 1.0 over RSS 2.0 (you should), this brief post will tell you how to migrate to FeedBurner and Atom.

Where is your Atom feed?

When you join FeedBurner, you may want to create 2 feeds, one for your posts and another one for the comments. When you do so ensure to provide FeedBurner with your Atom 1.0 feeds for both of them. Typo and Wordpress use RSS as their default feed format (auto-discovered), so you may wonder where the Atom feeds are located. Use the following:

  • Typo: http://yourdomain.com/xml/atom/feed.xml and http://yourdomain.com/xml/comments/atoms/comments/feed.xml
  • Wordpress: http://yourdomain.com/wp-atom.php and http://yourdomain.com/comments/feed/atom/

If you already have feeds at FeedBurner, you can always edit them in order to add the Atom URLs. This will provide your readers with an Atom feed served directly from FeedBurner, but you are still left with a problem. Existing subscribers, those who arrive to your blog and find links to the RSS feed, and readers who know the URL of Typo/Wordpress Atom feed, will bypass FeedBurner. One of the main reasons for using FeedBurner in the first place is to access statistics about your readership, so you want all your subscribers to use FeedBurner.

Using Typo

mod_rewrite comes to the rescue and with a few changes to your main .htaccess file, both RSS and Atom feeds will redirect to FeedBurner. If you are using Typo, your users are subscribing to one of the following feeds:

  • http://yourdomain.com/xml/atom/feed.xml
  • http://yourdomain.com/xml/rss/feed.xml
  • http://yourdomain.com/xml/rss20/feed.xml

You will then need to insert in your .htaccess located in the public_html directory, the following:

RewriteCond %{HTTP_USER_AGENT} !^FeedBurner.*$
RewriteRule ^xml/(atom|rss|rss20)/feed.xml$ http://feeds.feedburner.com/YourSite [R=301,L]



Using Wordpress

With Wordpress the whole process is simplified by using a plugin called FeedBurner FeedSmith. Once you have installed it (by copying it over the wp-content/plugin directory) and activated it from the Plugins page, you will have to fill in the details of your feeds (available at the Options -> FeedBurner page) as shown in the figure below.

FeedBurner option page

This plugin is handy because it does all the dirty work for you, but should you want to handle this from .htaccess, you can do so by just adapting the technique used above for Typo.

Switching from Typo to Wordpress

If you are switching from Typo to Wordpress and decide to adopt FeedBurner, you can combine the two above so that both existing and new users obtain the right feeds for your articles and comments. It is however unlikely that you want to create a feed at FeedBurner for each category and tag existing in your blog. It is very likely that you are going to adopt a different URL structure in Wordpress from Typo’s default, and therefore a few extra redirects are in order. The following example assumes that you went from Typo to Wordpress, and that you configured FeedBurner FeedSmith:

# Redirects Typo tags to Wordpress Categories
RewriteRule ^articles/tag/(.*)$ /category/$1 [R=301,L]
# Redirects Typo permalinks for articles and pages
RewriteRule ^pages|articles/(.*)$ /$1 [R=301,L]
# Redirects Posts and Articles to FeedBurner
RewriteRule ^xml/atom|rss|rss20/feed.xml$ http://feeds.feedburner.com/YourSite [R=301,L]
RewriteRule ^xml/atom|rss|rss20/comments/feed.xml$ http://feeds.feedburner.com/CommentsYourSite [R=301,L]
# Redirects Typo feeds for tags and categories to Wordpress category feeds
RewriteRule ^xml/atom|rss|rss20/category|tag/(.*)/feed.xml$ /category/$1/feed [R=301,L]


As you can see the first two lines of code (excluding comments) take care of redirecting the existing links to articles, pages and tags. The following two lines redirect the old Typo feeds to FeedBurner, and finally the last line redirects the feeds for the tags and categories in Typo to their respective category feed in Wordpress.

Ruby and Rails books, Textmate and FastRi

Antonio Cangiano July 4th, 2007

  • Ruby and Rails books keep popping up on the (virtual and real) shelves, which means that it may be slightly puzzling for newcomers to decide which books to spend their hard earned cash on. In the spirit of providing guidance in this process, I’ve prepared the Recommended Books for Ruby and Rails page. The recommendations are organized by skill level and should provide the reader with a nice logical sequence of increasingly more challenging reading material, making the task of identifying valid books easier for the new developer or student.
  • The more I become acquainted with Textmate, the more I’m impressed by such a nice little editor. I’ve had next to no time to play with it, and yet I’ve already added new functionalities to some of the existing bundles. In particular, I’ve committed a patch that extends the Textile bundle features, and I’ve become the maintainer of that bundle, with SVN access. Textmate bundles are very easy to customize and extend, and this flexibility is really appreciated from a development standpoint.
  • ri is an indispensable tool for the Ruby programmer, however you may have noticed that it’s a bit sluggish. If you haven’t done it already, do yourself a big favor and install the FastRi gem. FastRi provides various enhancements and advanced functionalities over the standard ri tool. But even when it’s used simply as a replacement for ri locally, it is significantly faster, and in my opinion more practical. Also, if you look for String#o for example, ri provides you with all the methods of the class String, that contain the letter ‘o’. While FastRi outputs only the methods starting with the letter ‘o’, which is what you actually want in most cases. Install with: $ sudo gem install fastri and $sudo fastri-server -b . Then use it in this way (qri is used for stand-alone mode, fri to connect to a remote server): $ qri String#scan.

« Prev - Next »