Putty and tree – how to avoid weird characters (squares)

Character encoding is always a problem when communicating between Windows and Linux. And using the “tree” command is affected by this problem if you are connected to a Linux box using Putty on a Windows box. You will certainly get weird characters, probably squares.

For those who are not sure about what tree is. It is a command-line tool to list contents of directories in a tree-like format.

A solution to this problem is to force using plain ASCII characters:

tree --charset=ASCII

You can also have an alias for this command, so that every time you type “tree“, it will force tree to use the ASCII charset automatically.

alias tree='tree --charset=ASCII'

And this is an example of what you will get as an output:

/tmp
|-- claws-mail-1000
|-- keyring-x803mg
|   |-- control
|   |-- pkcs11
|   `-- ssh
|-- orbit-gdm [error opening dir]
`-- virtual-user

How to work around “prerequisite RT 0 not found” on Ubuntu

You installed Request Tracker 3.8 on Ubuntu 10.04 using apt-get, aptitude, or synaptic, and then you needed RT::Authen::ExternalAuth.

What you naturally did is:

sudo cpan -i RT::Authen::ExternalAuth

But you will get the following error:

prerequisite RT 0 not found

This is because you did not install request-tracker through CPAN.

An easy solution for this is to force the installation using the “-f” flag:

sudo cpan -fi RT::Authen::ExternalAuth