Stupid sed tricks

I just learned that you can use any character, not just the slash (/), for a delimitter when substituting with sed. Most unique characters should work.

This is especially useful when editing streams of file paths.

Here's an example that modifies the path in a playlist:

cat list.m3u | sed 's+/home/aolsen/+~/+'

The +'s worked well as a delimitter here and eliminate the need to quote the /'s

This also works in vi.

Ruby on Rails Resources

I've spent a few weeks now looking at the Ruby on Rails open-source web framework.

Ruby in itself has existed for about 10 years. It is an intuitive language that is pretty easy to learn. It's often possible to guess at how something new should work and be right.

Ruby on Rails is a web framework that's written in Ruby. There have been many attempts to clone Rails in other languages like Perl, Lisp, Python, and PHP.

I've followed a couple of the tutorials and have just started working on a couple new applications using RoR. I'm posting the resources and tutorials I've been using here so that those of you who are so inclined may follow along and give this interesting language a look.

Official Ruby and Ruby on Rails links:
Ruby on Rails:
Rails Wiki:

Getting Ruby on Rails:
Installing Ruby, Gems, and Rails
Be sure to follow the link in step 2 to get GemRails installed.
Many of the tutorials explain how to the the built in web server in Rails, so you won't need to bother with the apache configuration until you're concerned about performance.

Installing Rails on Tiger
Some of you will find this useful.

How to make a todo list program with Rails 0.9
This is the first tutorial that I followed. It's pretty simple and glosses over a lot of the specifics of the language, but you can get a good feel for how it all hooks together, and the general processes for building an application. Shouldn't take more than an hour if you're paying attention.
How to make a todo list program with Rails
Another version of the same tutorial. I'm not sure if there are differences in the content.

Rolling with Ruby on Rails
Very windows centered complete with windows installation and GUI tools, but still worth a read. I didn't follow this tutorial, but I did read through it, skipping the boring bits about windows.

Wiki Tutorial
This is the wiki tutorial, and is a work in progress. It's a quick tutorial, but isn't as detailed as I'd like.

A Ruby On Rails tutorial for many-to-many relationships
So far I've just glanced through this tutorial, but it appears to explain quite a bit how many to many relationships work in Ruby. Something you'll need for any sort of real world application.

AJAX and Rails:
Ajax on Rails
An onlamp article about AJAX on Rails.

Ajax Discussion
Discussion on the Rails wiki about AJAX.

How to build an AJAX-ed spellchecker with Ruby On Rails
Looks like a lot of fun.

Resources for "Ruby on Rails"
railz0r3d!! Adventures in Ruby on Rails.
Ruby on Rails Weblog

That's it for tonight. I'll add more articles as I find good resources and eventually I'll write a tutorial myself.

Manual Firefox 1.5b1 install on Fedora Core 4

This should work on other similar systems.

su or login as root first.

# wget

# cd /usr/lib
# tar xzvf ~/firefox-1.5b1.tar.gz
# mv firefox firefox-1.5b1
# which firefox
# cd /usr/bin/
# mv firefox old.firefox
# ln -s /usr/lib/firefox-1.5b1/firefox .

That should do it, and shouldn't affect any of your launchers or file associations.

[update]  It appears that you may need the compat libs for this to work.  If you use a package manager, search for 'compat' and you should find something like compat-libstdc++ or libstdc++-compat.  If you install them FF should be happy.