Monday, July 27, 2009

Desktop location

Sometimes upgrades cause the location of the desktop to be lost. I've only seen this happen under Gnome, but it could also affect KDE.

To reset the location edit ~/.config/user-dirs.dirs.
Here's a good one:

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Download"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

Thursday, July 2, 2009

apt-get public key

From time to time 'apt-get update' will say something like 'There is no public key available for the following key ID 1234'.

To fix do:
gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 1234
gpg --armor --export 1234 | apt-key add -

Wednesday, June 17, 2009

Reinstalling grub boot

If the boot record gets trashed and there's therefore a need to re-install it follow these steps:

1: Boot off a live CD
2: chroot /mnt/sysimage (or whatever)
3: Run grub
4: find /boot/grub/stage1 and take a note of where the boot file system is
5: root (hd0,x) (note the space and x is from step 4)
6: setup (hd0) (again note the space)
7: quit grub
8: reboot

Tuesday, April 21, 2009

Email from scripts and jobs sent as attachment.bin

On Fedora, output from scripts such as /etc/rc.local and cron jobs are encoded and attached as attachment.bin even if they seemingly are plain text.

The problem is with carriage returns. I tried using "dos2unix" but that may not remove them all. If that happens put this into the pipeline

command | tr -d '\r' | mail -s .....

Sunday, April 19, 2009

Passwordless login using SSH

To login to machine b from machine a:

On machine a run 'ssh-keygen -t rsa'
Hit return for the passphrase (leave it empty)
Copy id_rsa.pub to b:.ssh/a.key
Login to machine b
cd .ssh
cat a.key >> authorized_keys