Wednesday, November 26, 2008

MySQL and debian-sys-maint account

If for some reason your debian-sys-maint account is unset in MySQL, during MySQL start you will have connect to server error. You might need to set this account in the MySQL server itself.
cat /etc/mysql/debian.cnf to get the password value from the file.
Then connect to the DB
mysql -u root -p
and execute:
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD' WITH GRANT OPTION

Monday, November 10, 2008

Changing time on CentOS

just copy relevant timezone file from /usr/share/zoneinfo to /etc/localtime

like:
cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime

Tuesday, July 15, 2008

unix backup with tar and mt

Rewind tape drive:# mt -f /dev/st0 rewind
Backup directory /www and /home with tar command (z - compressed):
# tar -czf /dev/st0 /www /home

Find out what block you are at with mt command:
# mt -f /dev/st0 tell

Display list of files on tape drive:
# tar -tzf /dev/st0

Restore /www directory:
# cd /
# mt -f /dev/st0 rewind
# tar -xzf /dev/st0 www

Unload the tape:
# mt -f /dev/st0 offline

Display status information about the tape unit:
# mt -f /dev/st0 status

Erase the tape:
# mt -f /dev/st0 erase
You can go BACKWARD or FORWARD on tape with mt command itself:
(a) Go to end of data:
# mt -f /dev/nst0 eod

(b) Goto previous record:
# mt -f /dev/nst0 bsfm 1
(c) Forward record:
# mt -f /dev/nst0 fsf 1

Thursday, July 10, 2008

deleting message from postfix queue

To list the queue execute:
mailq
You can find the problematic messages id and the execute:

find /var/spool/postfix -name "messegeID" | xargs rm