Tag Archives: config

Emacs with Tramp using zsh

First off, I recommend reading the relevant parts of the user manual, you might find the answer there.

Now, to the issue.

I installed tramp and added this to ~/.emacs:

(require 'tramp)
(setq tramp-default-method "scp")

Nothing special here, except it didn’t work. (The message was something like “waiting 60s for local shell”. Of course, I didn’t write it down, and it got lost in the browsing cache.)

So I turned on more verbose debugging, in ~/.emacs also:

(setq tramp-debug-buffer t)
(setq tramp-verbose 10)

The “logs”, mind you, are written into buffers: *debug/scp remotehost* are the messages and *tramp/scp remotehost* is the medium-rare (as compared to raw) data received.

If you open the latter and see characters like ^]]C4 or ^M, then it might be due to the shell prompt setting on the remote host. The manual advises wisely as to what should be considered.

One solution found floating on the internets is checking for the terminal type. Add this to the remote host’s .zshenv:


if [ "$TERM" = "dumb" ]
then
unsetopt zle
unsetopt prompt_cr
unsetopt prompt_subst
# unfunction precmd # these two are not
# unfunction preexec # working for me
PS1='$ '
fi

Also, make sure you’re not re-setting it somewhere else later, say .zshrc. A check should be enough even if you do:

if [ "$TERM" != "dumb" ]; then
# Set prompts
PROMPT='%m%# '
RPROMPT='[%C]'
fi

Analog Devices AD1984A (snd-hda-intel) on HP 6730s, Arch Linux

Here’s a great table for all your snd-hda-intel needs: Ubuntu Wiki audio_intel_da.

SpamAssassin and Exim on Arch Linux: some config trouble

I had this happen – SA wasn’t reading user_prefs out of a proper home dir:

[12071] info: spamd: creating default_prefs: //.spamassassin/user_prefs
[12071] dbg: config: using "/.spamassassin" for user state dir
[12071] dbg: config: mkdir /.spamassassin failed: mkdir /.spamassassin: Permission denied at /usr/share/perl5/vendor_perl/Mail/SpamAssassin.pm line 1577
[12071] dbg: config: Permission denied
[12071] warn: config: cannot write to //.spamassassin/user_prefs: No such file or directory
[12071] info: spamd: failed to create readable default_prefs: //.spamassassin/user_prefs
[12071] dbg: config: read_scoreonly_config: cannot open "//.spamassassin/user_prefs": No such file or directory

I thought this was due to the way spamassassin was invoked, so I tried specifying the user and homedir explicitly. It didn’t work. I tried creating a ‘spamd’ user, a homedir, changing the invocation to that:

sudo spamd -c --max-children 3 --username spamd -H "/var/lib/spamassassin/" -s stderr -D

Didn’t help.

Then I RTFMed some. That reminded me of writing something about user ‘nobody’ in exim.conf. That’s the user for which spam filtering is invoked; so if you allow per-user configuration, it doesn’t really matter that you specify “/var/lib/spamassassin” as a homedir, that’s just for the parent spamd process. For every child, the directory will be changed; for ‘nobody’ it’s ‘/’.

So I changed that line to have ‘spamd’ instead, and voila!

[12071] info: spamd: creating default_prefs: /var/lib/spamassassin/.spamassassin/user_prefs
[12071] dbg: config: using "/var/lib/spamassassin/.spamassassin" for user state dir
[12071] warn: config: created user preferences file: /var/lib/spamassassin/.spamassassin/user_prefs
[12071] dbg: conf: finish parsing

csh: Cannot open /etc/termcap

Upon logging into my remote server with ssh, I started getting:

csh: Cannot open /etc/termcap.
csh: using dumb terminal settings.

There is no rxvt-unicode entry in /etc/termcap. You should specify one, but if you’re lazy, you can just

setenv TERM xterm

in your ~/.cshrc.

P.S. Nah, this doesn’t help. You have to put that line in /etc/csh.cshrc (via).