Daily Archives: September 16, 2015


This error comes and mysql server is rebooted dues to a power failure of any unplanned shutdown. If you try to start mysql service you will get the same error in mysql error log. The solution is to go to the mysql data directory and move the logs ( ib_logfile0, ib_logfile1 etc) file to a temporary location. …

Read more

Convert MyISAM Tables to InnoDB

If you want to convert all MyISAM tables to InnoDB, following Script will do the smae. #!/bin/bash DBNAME=””; DBUSER=””; DBPASS=””; for t in $(mysql -u$DBUSER -p$DBPASS –batch –column-names=false -e “show tables” $DBNAME); do echo “Converting table $t”; mysql -u$DBUSER -p$DBPASS -e “alter table ${t} type=InnoDB” $DBNAME; echo “Repair table $t”; mysql -u$DBUSER -p$DBPASS -e “repair …

Read more

Kill process on MS SQL

#FIND ALL PROCESSES SELECT getdate() as “RunTime”, st.text, qp.query_plan, a.* FROM sys.dm_exec_requests a CROSS APPLY sys.dm_exec_sql_text(a.sql_handle) as st CROSS APPLY sys.dm_exec_query_plan(a.plan_handle) as qp order by CPU_time desc #ABOVE QUERY WILL LIST ALL ITEMS WITH DATABASE ID AND TO FIND THE DATABSE NAME USE BELOW ONE SELECT name as Database_Name, database_id as Database_ID FROM sys.databases; #KILL …

Read more

Create Swap Memory on Centos

Check for Swap Space swapon -s Create and Enable the Swap File sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k ( create 512 K Swap ) sudo mkswap /swapfile The results display: Setting up swapspace version 1, size = 536866 kB Finish up by activating the swap file: sudo swapon /swapfile sudo nano /etc/fstab Paste in the …

Read more

Few Commands to Monitor Apache Connections

#Print connections to Apache and number of connections per IP # #Quick Count# netstat -anpt|grep httpd | wc -l ( All connections  count ) netstat -anpt|grep httpd|grep ESTABLISHED | wc -l ( Established count only ) #Detailed report# #List all connectiosn owned by Apache ( Dead connections as well )\ netstat -anpt|grep httpd  #Now we …

Read more

Alert when file is modified in Linux

This is one of the script I used many years ago. There are many other methods now, but just thought of adding it. I had a server where few files were modified by malware. I applied all security measures and in order to alert me in case file is modified again, I created below shell …

Read more

Add Secondary IP in Linux and Permanently Save

I am going to add the ip 1 on to to eth0 as eth0:1 cp /etc/sysconfig/network-scripts/ifcfg-eth0  /etc/sysconfig/network-scripts/ifcfg-eth0:1 Edit the file with new IP, device name and subnet.

Upgrade Webmail in Cpanel

You can try below command to upgrade webmail in cpanel/whm servers. /usr/local/cpanel/bin/update-squirrelmail /usr/local/cpanel/bin/update-roundcube I am not sure how to upgrade Horde. I will add once I get it .