Monthly Archives: September 2015

create a sample project in git

This is a sample project created to learn basic git commands such as clone, commit, push, pull and merge. #Project Name: shop #Bare Repo Path: /home/repos/shop.git 1. Create a bare repo git init –bare /home/repos/shop.git #Get a clone by user ‘Anna’ mkdir /home/Anna/shop cd /home/Anna/shop git clone /home/repos/shop.git . #Create a file called index.php  and …

Read more

how to find current ssh port number in whm server

How to see the SSH port number if we have WHM with root access. Normally many hosting providers will change the default SSH port from 22 to any custom numbers. There is very easy method to find it if you have WHM root access.  You do not need to install any plugin to find it. …

Read more

how to save website sessions to ms sql database for asp.net websites

If you are planing to use a load balancer, websites sessions may create some problems if load balancer does not support session management. In this case you can save the sessions to a ms sql database and fix the issue.  It’s simple to save session to database. You will need to create a database using …

Read more

change all stored procedure ownership in ms sql database

When you migrated MS SQL database to new server there is change that you may see error like “Stored Procedure not found”. Mainly this comes due to a change in dbo. Please make sure that the stored procedure is owned by the correct database user. If the user is different  you can correct it by …

Read more

How to install SSL certificate on Centos Web Panel

When we install SSL certificate on Centos Web Panel (CWP) the SSL certificate may not work using default installations. You may need to do some edits in Centos Web Panel (CWP)  apache configuration files. To install Certificate go to the SSL manager Security–> SSL Manager Use the SSL Generator to generate Key, CSR  and Selfsigned …

Read more

innodb-error-log-file-ib-logfile0-is-of-different-size

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