Archive for January, 2009

While I’m working, I always have a minimum of 3 or 4 open terminals: one for watching the logs, one for ssh and so on.
It’s not good to have a lot of windows open, and tab switching can be a pain, specially when you want to see what’s going on in one window while you type in another one.
So I’ve found recently Terminator.
Taken from terminator’s home page:

The goal of this project is to produce a useful tool for arranging terminals.
It is inspired by programs such as gnome-multi-term, quadkonsole, etc. in that the main focus is arranging terminals in grids (tabs is the most common default method, which Terminator also supports).

Much of the behaviour of Terminator is based on GNOME Terminal, and we are adding more features from that as time goes by, but we also want to extend out in different directions with useful features for sysadmins and other users. If you have any suggestions, please file wishlist bugs! (see below for the address)

Features:

* Arrange terminals in a grid
* Tabs
* Drag and drop re-ordering of terminals
* Lots of keyboard shortcuts
* Config file to override gnome-terminal settings
* Simultaneous typing to arbitrary groups of terminals

My screen.

My screen.

You can put your default configurations in the file ~/.config/terminator/config
Mine configurations are this:

#/home/mauricio/.config/terminator/config
enable_real_transparency=True
force_no_bell=True
scrollbar_position=disabled
titlebars=False
handle_size=1

This increased a lot my productivity. Unfortunately I haven’t found anything like Terminator for Mac.

Update (26/01): I’m using IDs on the feeds now, as I was getting duplicated feed entries. I followed this post written by Carlos Brando.

I had some trouble recently with atom feeds. I made it work with almost all the readers around there, but it took some time until I found why it wasn’t working with Google Reader.
So, I’ll try to save some people time here.

First, you need a action for creating the feeds (could be the index action too, you just need to add the format.atom line):

# app/controllers/stories_controller.rb
def feed
    @project = Project.find(params[:project_id])
    @type = @project.types.find(params[:type_id])
    @stories = @type.stories(:order => 'updated_at desc')
 
    respond_to do |format|
      format.atom
    end
  end

Now, you need a builder for that action:

# app/views/stories/feed.atom.builder
atom_feed do |feed|
  feed.title("#{@project.name}->#{@type.name}")
  feed.updated(@stories.first.updated_at.strftime("%Y-%m-%dT%H:%M:%SZ"))
 
  for story in @stories
    next if story.updated_at.blank?
    feed.entry([@project, @type, story]) do |entry|
      entry.title(story.headline)
      entry.content(story.text, :type => 'html')
      entry.updated(story.updated_at.strftime("%Y-%m-%dT%H:%M:%SZ")) # needed to work with Google Reader.
      entry.author do |author|
        author.name(story.author)
      end
    end
  end
end

And finally, a route to the feed:

map.connect '/projects/:project_id/types/:type_id/feed', :controller => 'stories', :action => 'feed', :format => 'atom'

Now you can check if it’s valid with the Feed Validator.

The problem why it wasn’t working with Google Reader was that I forgot the entry.updated line. Also, you need to format the time as it is above, so it’ll follow the rules for dates in the atom specification and will work with Google Reader.