I received an Outlook meeting invite in my email recently but because I use Thunderbird as my email reader I received the raw vCalendar data rather than a nicely formatted email with details of the meeting. After a quick google search I found a post on Daniel Tome's blog regarding Viewing Calendar Events in Mozilla Thunderbird.

I installed the add-on and restarted Thunderbird and now the raw vCalendar email was transformed into a nicely formatted meeting invite - you even get the option to accept or decline the meeting. Just remember to right-click on the green "Install Now" button to download the add-on otherwise you will install it into firefox.

I'm not going to repeat the many, many websites taking (and complaining) about Microsoft's proprietary e-mail attachment format called TNEF.

I'm assuming that if you are reading this then you have found that these fixes are not working for you (or not possible to enforce). I'll also assume that the LookOut Thunderbird Add-on by Aron Rubin is also not working correctly for you (this was my experience on Ubuntu Edgy Eft).

The best solution I could come up with was getting Thunderbird to run a script to unpack the winmail.dat extension into a folder on your Ubuntu desktop.

What I planned to do was override the db:migrate rake task to do the same as the default one bar the schema dump. My first attempt failed as it appears that rake will allow more than one task to have the same name, it runs then one after the other. The result of this was some strange migrations plus the delay due to dumping the schema!

I needed to delete the existing db:migrate task before adding my new one. You can't just call delete task on the Rake::Application class (there's no such method) so Matthew's suggestion was to add a delete_task method to the Rake::TaskManager module (that has access to the tasks) and then call this method before we define our new db:migrate task. The finished script is given below:

# add a delete_task method to the TaskManager and delete db:migrateRake::TaskManager.class_eval do def delete_task(task_name) @tasks.delete(task_name.to_s) end

Rake.application.delete_task("db:migrate")end

# define a new db:migrate that did the same as the old one bar the schema dumpnamespace :db do desc "Migrate the database through scripts in db/migrate. Target specific version with VERSION=x, don't run db:schema:dump at the end."

Have you ever wondered why rake db:migrate took so long to complete when you ran a simple migration script? The reason is that it's dumping your database's entire schema into db/schema.rb just like rake db:schema:dump does.

I had to get to the bottom of why this was happening and searching the internet was not providing any answers, so I took to searching the Rails codebase to see if I could find any clues.

If the 'schema_format' is set to':ruby' then run the rake task 'db:schema:dump' after we have finished running the migrations. But where is schema_format set? A look in config/environment.rb gave a clue:

# Use SQL instead of Active Record's schema dumper when creating the test database. # This is necessary if your schema can't be completely dumped by the schema dumper, # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql

This configuration value is commented out and indicates that if this is enabled then the schema dumps will be in SQL format rather than the more portable (and in my mind preferable) Ruby format.

base.rb in /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ gave the final clue:

# Specifies the format to use when dumping the database schema with Rails' # Rakefile. If :sql, the schema is dumped as (potentially database- # specific) SQL statements. If :ruby, the schema is dumped as an # ActiveRecord::Schema file which can be loaded into any database that # supports migrations. Use :ruby if you want to have different database # adapters for, e.g., your development and test environments. cattr_accessor :schema_format , :instance_writer => false @@schema_format = :ruby

So base.rb sets the schema_format variable to be ruby and therefore enables the automatic dumping of the schema after every migration.

DOS text files traditionally have CR/LF (carriage return/line feed) pairs as their new line delimiters while Unix text files traditionally have LFs (line feeds) to terminate each line.

Tofrodos comprises one program, "fromdos" alias "todos", which converts text files to and from these formats. Use "fromdos" to convert DOS text files to the Unix format, and "todos" to convert Unix text files to the DOS format.

This functionality is also available via the dos2unix/unix2dos symlinks.

To install it run:

sudo aptitude install tofrodos

And then use dos2unix and unix2dos to convert the file between the two different formats.