Friday, July 31, 2009

Pass Password to SSH Command

Install sshpass (Debian Package).

run ssh command as follow:

sshpass -p [yourpassword] ssh [yourusername]@[host]

Thursday, July 23, 2009

Find Windows XP Administrator Password

First reboot your windows with a Linux-Live CD such as ubuntu.

Take two files SAM and SYSTEM under folder WINDOWS\SYSTEM32\CONFIG.

With Rainbow Tables (for example OPHCRACK) you can find very fast the Password.

This HOW-TO tells you how to install OPHCRACK in Ubuntu:

HOW-TO INSTALL OPHCRACK ON Ubuntu

Ubuntu - Install all dependecies for a package

Run this command:

apt-get build-dep PACKAGE_NAME

Wednesday, July 15, 2009

Search and Replace in bash

#!/bin/bash
origvar="This is the original string";
replvar=${origvar//original/changed};
replvar=${replvar//string/result.};
echo "replvar==\"${replvar}\".";
echo "this should now state \"This is the changed result.\".";

Import Domain from Plesk 7 to Plesk 9

run in Plesk 7 this command:

/usr/local/psa/bin/pleskbackup -v domains DOMAIN.NAME /tmp/FILENAME

copy FILENAME to plesk 9 (for example tmp directory).

Add same Customer and domain in plesk 9.

Convert the Backup:

/usr/local/psa/bin/pre9-backup-convert -v convert -d /var/lib/psa/dumps/ /tmp/FILENAME

this command makes a XML file under /var/lib/psa/dumps/domains/DOMAIN.NAME

import the domain:

/usr/local/psa/bin/pleskrestore --restore /var/lib/psa/dumps/domains/DOMAIN.NAME/converted_DOMAIN.NAME_info_xxxxxxxxxx.xml -level domains

Wednesday, July 8, 2009

How to switch from Qmail to Postfix and vice versa?

You may run the following command to switch MTA to Postfix:

Code:

/usr/local/psa/admin/sbin/autoinstaller --select-release-current --install-component postfix
and for switching to Qmail:

Code:

/usr/local/psa/admin/sbin/autoinstaller --select-release-current --install-component qmail