Kill all fastcgi processes

Sometimes I need to reset all php fastcgi processes especially when I change the php version for users in their php-wrapper pgrep php-cgi | xargs kill -9

Optimize MySQL all tables

I was contacted by a friend which has the website hosted on my server. His website was pretty slow despite the fact the server is very powerful. After some debugging I optimized his tables and the website is instant fast … Continue reading

JavaScript: easily do a continuous action on mouse hold

I simpliefied the code as much as possible var intervalHandler; $(‘#’+obj_id).mousedown(function() { intervalHandler = setInterval(function() { doTheWork(); }, 100); return false; }) $(‘#’+obj_id).mouseup(function() { clearInterval(intervalHandler); }); function doWork() { //I am working here }

System.Security.Crypthography.CryptographicException when installing sharepoint 2010 on windows 7

A more exact error is “An exception oftype System.Security.Crypthography.CryptographicException” and happened when I was trying to install SharePoint2010 on windows 7 x64 I tried to find a solution and fixed the problem by 1. give full control for NETWORK SERVICE … Continue reading

install php xdebug

I installed it for the latest stable version of php 5.3 (5.3.21). Feel free to change the version to your own needs # download the latest stable version from http://pecl.php.net/package/xdebug wget http://pecl.php.net/get/xdebug-2.2.1.tgz # unarchive tar -xf xdebug-2.2.1.tgz cd xdebug-2.2.1 # … Continue reading

Quickly check if under a DOS attack

Check how many connections an ip has to your server, ordered by the most connections netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n #check your tcp timeout time … Continue reading