I encountered, for some time now, problems when connecting over ssh from my mac to a linux machine.
These problems were related to backspace/delete key in both nano and zsh the solutions I found today are :

Following my last post, here’s another handy new thing to do in Leopard. I never used this in Tiger (MacOS X.4) because it was not practical (besides being possible), but I swear it was usable by the time.
Auto-mounting remote shared server (Samba, NFS, AFS) wherever I want, without being stuck with a dead Finder.app whenever I lost wifi network, I change room or my mac goes to sleep (yep I used to have some problems with this).
So now how to do this ? NetInfo is gone so where can I define my automount points, remember when I said NetInfo is dead for the best ?

-fstype=smbfs : specify the kind of filesystem to use, I only cover samba here.

://username:passwordremote_server_name_or_ip/shared_folder_name@ : this is the informations to connect to the remote server. Change username and password with yours, specify remote_server_name_or_ip to reflect the way you access the machine and set shared_folder_name to the name of the remote folder.

Notice just like /etc/hosts that Leopard seems to only detect a change if a line is added/removed, so anytime you make a change that does not change the line number in the file add a comment (#) at the beginning or end to force a reload.

Back in Tiger days, I used to love having aliases pointing to localhost or other servers saving me some typing and allowing me to use Apache vhosts locally. To achieve this without restarting the whole system, I used NetInfo to add a new Machine entry, this works great, no restart needed only NetInfo reload.

With Leopard, NetInfo is gone (for the best) and it has been replaced by a folder hierarchy full of flat .plist files. No more NetInfo Manager, but a new dscl command and a bunch of related one : dscacheutil (lookupd replacement), dseditgroup, dsmemberutil, etc.

For today, we’ll use dscl and dscacheutil, let’s create a new Host entry to map myvhost.loc to 127.0.0.1 (I like adding .loc to distinguish my added hosts, but you’re free to use anything else) :

Then to be sure it’s looked up correctly by software (in fact it’s only needed if you tried to access the myvhost.loc before adding it) :

sudo dscacheutil -flushcache

A little handy feature of the new dscacheutil when we’re at it :

sudo dscacheutil -cachedump -entries Host

This will list all entries cached by Leopard, it can comes in handy when trying to solve a name resolution problem.

And finally if you want to get ride of your entry later on :

sudo dscl localhost -delete /Local/Default/Hosts/myvhost.loc

[Update 2008/01/07]
Benjamin Stiglitz wrote a comment to say /etc/hosts is now automatically watched for changes on Leopard, so there’s no more need to play with dscl to add simple host. Thanks again Benjamin.

Here’s a quick tips for those of you using Leopard Spaces functionnality. If you want to move a window from one “space” to another simply drag the window to the right/left/top or bottom edge of the screen (depending to which “space” you want to put it in) just like if wanted to put it out of the screen and wait a second.

Spaces should automaticaly switch to the next “space” and the window still be under your cursor. Drop it there or reiterate to move it to another “space”.

I encountered a little problem today, I use macports version of coreutils which gives me access to gnu versions of some commands (for full list : sudo port contents coreutils | grep /bin). My problem is related to one of those I’m using in my bashrc to color my shell : dircolors (gdircolors in macports).

This little commands allows you to generate LS_COLORS values (as the name seems to imply, it’s used by ls command) from a config file (~/.dir_colors in my case). I confidently modified this file today and was welcomed by a nice csh: Unknown colorls variable `su'.
It turns out there are an incompatibility between LS_COLORS generated by current version of dircolors in coreutils and (t)csh : tcsh treat LS_COLORS as a magic environment variable, which means it is parsed for its own use in ls builtin command.

The culprits in my .dir_colors file was :

#SETUID 37;41 # file that is setuid (u+s)
#SETGID 30;43 # file that is setgid (g+s)
#STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
#OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
#STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable

As you can see a simple fix is to comment them out.

In fact I’m not sure why I see those errors poping up, as I’m using bash ans it’s now the default in MacOSX.

So, we now have all elements needed to use sshfs on MacOS X, YEAHH !!!
But wait… what can we do with sshfs ?

The big things about sshfs is it allows you to mount on your local machine a remote directory through ssh. On Mac it means you see the remote directory as an external mount point (on your desktop for example, just like an external hard drive).

Currently (at least on my configuration) the finder does not allow to copy file to the mounted filesystem as it does not recognize correctly the available free space, but it works beautifully with other apps (text editor, etc.) or in the console.

Installation is a little bit fastidious for now, but if you follow carefully the MacFuse installation How-To it should not be infeasible.

Over the time I tend to accumulate mail adresses and accounts. Not so long ago, I decided to switch from a multiple mail accounts to a single imap account where I aggregated all others.

I used to be an Apple Mail.app user, but this switch caused me some troubles. How to specify different (legitimate) sender addresses with only one account configured ? I thought it was impossible and so decided to switch to Mozilla Thunderbird which allows you to set different sender addresses by account.

But recently, I found it was possible in Mail.app and here’s how :

In your account configuration, enter a comma-separated list of adresses in the “Email Address” field.

Then, you’ll be able to choose which sender address should be used when writing a new mail.

For those of you interested in my configuration, I operate a simple linux box with Postfix, Courier-Imapd and Maildrop. Then I use Fetchmail to grab mails from my different accounts and put them in my imap setup.