Archive for September, 2009

Update OpenVZ containers

If you manage several OpenVZ containers, here is a simple bash script to keep the OpenVZ containers upto date.
Read the rest of this entry

To backup partition table:

sfdisk -d /dev/sda > sda.table

To restore the partition table:

sfdisk /dev/sda < sda.table

To clone partition table:

sfdisk -d /dev/sda | sfdisk /dev/sdb

Converting bin/cue to iso

You might come across a disc image in the BIN/CUE format. BIN/CUE files can be directly burned to CD via K3B, however if you want to convert to an iso, a command line application called bchunk can be used.

# yum --enablerepo=extras install bchunk
# bchunk image.bin image.cue image.iso

Changing Timezones

# rm /etc/localtime
# ln -s /usr/share/zoneinfo/Asian/SaiGon /etc/localtime
# hwclock --systohc

extract plesk backup files

Package mpack is required in order to extract the backup contents.

# apt-get install mpack
# zcat /path/to/backup_file > backup_file.mime
# munpack backup_file.mime

The result is a set of tar and sql files that contain domains’ directories and databases. Untar the directory as needed.

For example, to restore the httpdocs folder for the DOMAIN.TLD domain:

# tar xvf <DOMAIN.TLD>.htdocs