Thursday, May 6, 2010

Hidden Apache directory listing

If you are on an RPM installation of Apache (which i dont really recommend) you will find the apache configuration file probably here:

/etc/httpd/conf/httpd.conf

If you are using apache from the source tar balls ( like real men ) probably you will find the configuration file here:

/usr/local/apache/conf/httpd.conf

Using an editor like vi , edit the httpd.conf file and scroll until you find a line like this:

Options All Indexes FollowSymLinks MultiViews

To disable directory browsing carefully remove the line that says: Indexes and leave the line like this:

Options All FollowSymLinks MultiViews

Restart your apache webserver and thats it

reference http://www.felipecruz.com/blog_disable-directory-listing-browsing-apache.php

Tuesday, May 4, 2010

Setting Clock on Centos

what im doing to configure clock on centos

install ntp

yum install ntp

after finish run

ntpdate ntp.asia.pool.org

done!

Search using mysqlbinlog (troubleshoot)

simply go to or where your mysqlbinlog located :

after you find it run this command
mysqlbinlog mysql-bin.0000xx | grep nametosearch > namefile.txt

Dump using sed & mysqldump

Dump table mysql using sed

sed -n '/^-- Table structure for table \`nametable\`/,/^-- Table structure for table/p" namedb > namatable.sql

using mysqldump

mysqldump -c -u username -ppassword databasename tablename > /tmp/databasename.tablename.sql

restore DB / table

mysql -u username -ppassword databasename < /tmp/databasename.sql Dump table mysql using sed

sed -n '/^-- Table structure for table \`nametable\`/,/^-- Table structure for table/p" namedb > namatable.sql

using mysqldump

mysqldump -c -u username -ppassword databasename tablename > /tmp/databasename.tablename.sql

restore DB / table

mysql -u username -ppassword databasename < /tmp/databasename.sql

Mysqldump only the structure

run this command for mysql backup only the data structure

mysqldump -d -h localhost -u root -pmypassword databasename > dumpfile.sql