Find and replace string in file recursively in a directory

Simple command I don't want to forget that find a string and replace it with another using sed.

Backup all mysql database every hour using mysqlhotcopy

My previous script using mysqldump was slowing down Apache, it became unresponsive for a few seconds, so I wrote this one using mysqlhotcopy. It's much faster and doesn't slow down my webserver.

Howto block DDOS attacks with PSAD and simple iptables rules

I will show you howto install PSAD to block DDOS attacks (distributed denial of service) and port scan on a webserver. Here I will use Ubuntu 8.04 LTS server but it should be very similar on other distro.

PSAD scan iptables log file to generate the attack block. The problem is that when you log ALL packets as shown in other PSAD tutorials, it will slow down considerably your server if it's busy and generate huge huge log files (growing at a rate of 1meg per second or more). With simple iptables rules, we will only log traffic that look suspicious (5 new connections in 5 seconds for example).

IP Geolocation now on dedicated domain http://www.iplocationtools.com/

Since our geolocation database and API became very popular recently, I decided to put all the tools on a new domain :

iplocationtools.com

Also, the forums are now with PHPBB which is much much better than drupal forums module on blogama.org ;)

Feel free to post your comments about the new site in the iplocationtools forums, negative or positive!

Online fraud detection API

I created a small API for an e-store I manage (Portafixe.com) that calculate the distance between the shipping/billing location and the IP location for fraud prevention. Now i'm making it available to the public for free.

April IP geolocation database released, new stucture

The April release is now available.

For previous users of the database there is some changes in the database structure. These mods are from suggestions from users in the forum :

Simple bash script to monitor your webserver remotely on different ports version 2

Simple bash script to monitor one or multiple webserver on different ports. I'm sure there is over 100 available programs doing this but I wanted something with small memory usage. Also, I only wanted to be notified once, notifications are receive by SMS on my cell. With the software I was using before, I was getting notified every minute until I could reach a computer and fix the problem or stop monitoring which was quite annoying.

New IP geolocation database released

March IP geolocation database released today.

Howto block DDOS attacks on Ubuntu

I will show you howto install PSAD on Ubuntu 8.04 LTS server to block DDOS attacks (distributed denial of service) and port scan.

PSAD scan iptables log file to generate the attack block. The problem is that when you log ALL packets as shown in other PSAD tutorials, it will slow down considerably your server if it's busy and generate huge huge log files (growing at a rate of 1meg per second or more). With simple iptables rules, we will only log traffic that look suspicious (5 new connection in 5 second for example).

Howto install GlusterFS on Centos

In this tutorial I will show you how to install GlusterFS in a scalable way to create a storage cluster, starting with 2 servers on Centos 5.2. Files will be replicated and splitted accross all servers which is some sort of RAID 10 (raid 1 with < 4 servers). With 4 servers that have each 100GB hard drive, total storage will be 200GB and if one server fails, the data will still be intact and files on the failed server will be replicated on another working server.