Saturday, March 13, 2010

linux find command - to find file with some content

find files with password under folder /opt/activemq

sudo find /opt/activemq/ -exec grep -l  password {} \;


sudo find /opt/SWS_4/ -exec grep -l "sigTypeList" {} \;


find .  -name "*.log" | xargs grep "localhost post"


Tuesday, March 9, 2010

enable mysql slow query log in my.cnf

Step 1:  add following two line under mysqld
[mysqld]
log-slow-queries=/var/log/mysql-slow.log
long_query_time = 10

step 2: create an empty log file and chage the owner
  vim /var/log/mysql-slow.log
  chown mysql:mysql /var/log/mysql-slow.log

step 3: reboot mysql
  /etc/init.d/mysqld stop
  /etc/init.d/mysqld start