Articles in the ‘Maintenance’ Category

Ignore folder in SVN

Thursday, October 6th, 2011

Use this:

DIRNAME
-CHILD1
-CHILD2

DIRNAME> svn propset svn:ignore CHILD1 .

attention! You have to be inside DIRNAME.

Convert MYSQL tables to INNODB script

Tuesday, July 12th, 2011

If you want to convert MYSQL tables to INNODB use the following script:

mysql -u root -p -e "SHOW TABLES IN DATABASE-NAME;" | tail -n +2 | xargs -I '{}' echo "ALTER TABLE {} ENGINE=INNODB;" > alter_table.sql
and then run:
perl -p -i -e 's/(search_[a-z_]+ ENGINE=)INNODB/\1MYISAM/g' alter_table.sql

Replace “DATABASE-NAME” with your database name. You also need root access (preferably).

How to test a SVN commit?

Thursday, June 18th, 2009

Do a dry-run with:


svn merge --dry-run -r BASE:HEAD .

How to install Subversion client on cPanel

Thursday, June 18th, 2009

You can do it in console with:

# yum install subversion

and then you may get this error:

Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion

To solve this do the following:
#wget ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/releases/7/Everything/i386/os/Fedora/perl-URI-1.35-3.noarch.rpm
# rpm -i perl-URI-1.35-3.noarch.rpm
# yum install subversion

That’s it subversion client is successfully installed on your server you can check it using following command.
#svn --version

How to create a .tar.gz archive?

Wednesday, June 17th, 2009

Go inside the director you want to create an archive of and write:

# tar -czf archive.tar.gz *

The * means all the files. You can use other filters if you wish.

How to shutdown a Linux server?

Friday, June 12th, 2009

There are several options available:

1. Immediate shutdown

# shutdown -h 0


2. Delayed shutdown

# shutdown +5 "Server is going DOWN in 5 minutes"


3. Scheduled shutdown

# shutdown 1:00 "SERVER DOWN"
# shutdown 13:00 "SERVER DOWN"

Calculate AWSTATS manually in Plesk

Friday, June 12th, 2009

In order to calculate manually the AWSTATS for a domain in Plesk use:


/usr/local/psa/admin/sbin/statistics –calculate-one –domain-name=example.com

How fast is SATA disk in Linux?

Friday, June 12th, 2009

To find out how fast is your HDD in linux use:


hdparm -tT /dev/sda

This measurement is essentially an indication of the throughput of the processor, cache, and memory of the system under test. Here is for loop to run test 3 time in a row:


for i in 1 2 3; do hdparm -tT /dev/sda; done

How to delete the .svn folders recursively?

Friday, June 12th, 2009

You can delete the .svn folders recursive by using the following command:


rm -rf `find . -type d -name .svn`