Archive for August, 2013

When i tried to login to a wordpress admin page i get banned from OSSEC.
I searched the logs and found various
suhosin[4348]: ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value
The solution was simple. I put
define('WP_MAX_MEMORY_LIMIT', '128M');
in wp-config.php


I use the following periodically to see if i have some big files on my /var/log/ directory

# find all big files over 1 MB in /var/log and sort them with size
find /var/log -type f -size +1M -exec ls -lh {} \; 2> /dev/null | awk '{ print $NF ": " $5 }' | sort -nk 2,2

and to move all gzipped files from /var/log/ to /var/backuplog/ and make some clean space

find /var/log -iname '*.gz' -exec mv '{}' /var/backuplog/ \

This is a collection of commands i found on the net and wrote them on a executable file to monitor connections on my server

echo "List count of number of connections the IPs are connected to the server using TCP or UDP protocol."
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n ;

echo "How many active SYNC_REC are happening on the server.Less than 5 is OK."
netstat -n -p|grep SYN_REC | wc -l

echo "List out the all IP addresses involved."
netstat -n -p | grep SYN_REC | awk '{print $5}' | awk -F: '{print $1}'

echo "List out the all connections to port 80."
netstat -n -a -p|grep :80

echo "Which ip's are having more connection to 80 port."
netstat -anp | grep :80 | awk '{print $5}' | sort | uniq -c | sort -n