Wednesday, February 24, 2010

Send test mail from command line with Sendmail

In shell run this command:

( echo subject: test; echo ) | sendmail -v -oi YOUR-EMAIL@ADDRESS.COM

MySQL - debian-sys-maint account

Find your debian-sys-maint password in /etc/mysql/debian.cnf.

Then use this command in Mysql shell:

GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' \
IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

Replace PASSWORD with your debian-sys-maint password.

Backup and restore debian/ubuntu package selection

If you are running Debian and have lost track of which packages you are running, it could be useful to get a backup of your currently installed packages. You can get a list by running:

dpkg --get-selections > debianlist.txt

This will put the entire list in debianlist.txt. You could then install the same packages on a different computer with:

dpkg --set-selections < debianlist.txt

You should bear in mind that you would also need to copy over configuration files from /etc when copying your system to a new computer.

To actually install the selections, use:

apt-get -u dselect-upgrade

Source: http://www.tuxradar.com/content/linux-tips-every-geek-should-know

Tuesday, February 16, 2010

Convert a ssh-keygen to putty format using puttygen

First install putty-tools:

apt-get install putty-tools


then use this command to convert ssh-key:

puttygen YOUR-KEY -o OUTPUTFILE.PPK