home icon contact icon rss icon

Textmode

tools I use

Archive for Home

Multiple SMTP accounts using mSMTP and Mutt

Using sSMTP for a long time now, I had to say goodbye today. The reason is that I wanted to integrate multiple SMTP accounts, for example my GMail account, and sSMTP doesn’t support this.

I found mSMTP which looks very nice. It is lightweight like sSMTP and supports multiple accounts.

Below is my example configuration (stripped down to the basics) for msmtp and mutt.

This goes into msmtprc:


account default
host tachium.at
... tls fu ...
from cb@tachium.at
user cb@tachium.at
password XXX

account gmail
host smtp.gmail.com
from ch.blank@gmail.com
... tls fu ...
user ch.blank@gmail.com
password XXX
port 587 

As you can see the first account is the default one (if I do not select a specific account when invoking mSMTP).

For the account selection, use something like this in your muttrc:


set sendmail="/usr/bin/msmtp" 
set envelope_from=yes

macro generic "<esc>1" ":set from=cb@tachium.at" 
macro generic "<esc>2" ":set from=ch.blank@gmail.com" 

Now, if you send a mail mSMTP looks at the sender address and tries to find a corresponding ‘from’ entry in it’s configuration, or uses the default account if it cannot find one.

Note: You can select the account in different ways, eg. explicitly from the command line, the docs are a good starting point :)

Heroku - Instant, live Rails Applications

I tested Heroku today. Heroku is a project for online development and hosting of Ruby on Rails applications. All configuration, development and settings are controlled with a nice web interface.

The application is live and accessible right after you created it.

Easy Configuration

In the basic settings you can customize the name of the subdomain, as well as the visibility of your project (public or private).

Import/Export Features

One cool feature is that Heroku lets you import existing rails applications, simply by uploading a tarball, and of course, exporting is supported too.

For Backup purposes you can even create multiple Snapshots of your current project which are then stored serverside.

Collaboration

It is possible to add multiple collaborators to projects through their email addresses, this can be very handy as a quick development platform for small groups, training, presentations or discussion.

Online Development

The Edit Mode of your applications offers a nice interface divided into 3 sections:

  • Code View, has a fully functional, web-based editor that lets you edit the project files as well as basic filemanagement tasks and access to Generators, Rake tasks and even the Console.
  • Data view, provides an interface to the project database
  • Log view, well the logfiles :)

Although I think I won’t develop full applications in Heroku, I think it is very handy for a couple of tasks:

  • upload and share existing applications very quickly
  • present or discuss applications online (eg. for training purposes)
  • work with various people through a nice web interface

Heroku is definitely worth a try, check it out.

Ruby on Rails 2.0 released

Today Ruby on Rails 2.0 has finally been officially released, introducing a lot of new features and cleanups.

If you aren’t already familar with the changes, take a look at the official note and this article

Google releases Chart API

Google released their Chart API to the public, which let’s you build nice charts (like for example the ones in Google Finance) simply by including a specific image with the chart data as parameters.

An example:

Available charts are:

  • Line chart
  • Bar chart
  • Pie chart
  • Venn diagramm
  • Scatter plot

Check out the samples, I think this is very useful for representing data, since you don’t need an extra plugin, library or image generation tool.

Thank you, Google.

Update: It did not take long, there are two gems that wrap the API into a Ruby interface, and they have been merged by the authors into GChart, nice work!

Wmii Windowmanager

A week ago I switched from Fluxbox to the Wmii Windowmanager and I have to say it’s the best WM I ever had.

It currently looks like this:

Which looks basically like every other WM except that Wmii uses some Magic which makes it really dynamic. As you can see it is tiled and fully manageable without a mouse, but supports floating windows aswell.

The important terms Wmii consists of:

  • Clients, a single application window
  • Columns, (vertical) containing a set of clients
  • Tags, identifiers (like the tags you know form tag clouds) for clients
  • Views, a set of clients with a specific tag (like Workspaces)

The main thing thats different from the other Windowmanagers are tags. The point is that a client can have multiple tags and thus can be on multiple Views (which are basically workspaces) at the same time.

For example in the screenshot above I have views called bar and web, and I usually read my emails on bar. Sometimes I need to write about something contained on a webpage, so with Wmii I just have to give my mail window the additional tag web, and it appears on my web view too. Since it is on both views the layout on bar doesn’t change, and I can even use completely different dimensions of the same window on each view.

Another very cool thing is that each column can have one of 3 different modes to display its clients:

  • Equal size
  • Stacked, only one client fully visible, like Tabbing
  • Maximized, current client is maximized

Clients inside a column can be resized and moved between columns freely.

What makes Wmii even more dynamic is that it provides a virtual filesystem for the configuration and current state (like procfs), based on 9P. This enables you to script Wmii in almost any language.

Wmii contains an executable, wmiir, to interact with the core, and a shellscript for the basic configuration on startup.

There is also a ruby based implementation of the 9P2000 protocol, Ruby-ixp for Wmii, which is a bit faster than wmiir.

I found two Ruby projects that provide a nice interface for Wmii scripting in Ruby:

Note: The rumai page is currently in progress, and the script is about to be updated for the new Wmii release. Although ruby-wmii has a lot of features, rumai provides some additional, and really nice methods. So be sure to check out both.

Update: Since a lot of people are asking, I added my config files. Not sure if they are up to date, I changed some lines in standard-plugin, they are marked with the word CHANGE.

wmiirc-config standard-plugin