A quick and usefull command for checking if a server is under ddos is: netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n That will list the IPs taking the most amount of connections to a server. It is important to remember that the [...]
April 2nd, 2013 |
admin |
This comes up in discussions almost every new project I work on, because it’s a very important thing to consider when designing a database. When deciding when and how to create an index in your MySQL database, it’s important to consider how the data is being used. Let’s say you have a database of employees. [...]
March 2nd, 2013 |
admin |
Step 1: Now we will remove all software groups, to get Centos to a minimum Step 1.1: Run grouplist to see what software groups that are installed: yum grouplist Step 1.2: Remove all groups that are installed EXCEPT “Yum Utilities” yum groupremove “GroupName” Step 2: Lets disable unneeded services: chkconfig anacron off chkconfig atd off [...]
February 5th, 2013 |
admin |
The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them. Command Syntax find /path/to/files* -mtime [...]
December 8th, 2012 |
admin |
To change the SSH port number login as root, and edit /etc/ssh/sshd_config Find the line that says Port 22 and change 22 to any number between 1024->65535 (above 30000 is best) and save the file. Once done, run: /etc/init.d/sshd restart Now start a new SSH session (don’t close your existing one), to make sure that [...]
December 5th, 2012 |
admin |
You may notice an error message “Unable to create PHostingManager object:Unable to set current ip address: IP address is missing” in Plesk when trying to manage a domain from Domains >> domainname.tld. The error appears when an IP assigned to a domain is not assigned to the ‘Owner’ of the domain. To fix the issue, [...]
October 31st, 2012 |
admin |
How to block an IP using iptables? iptables -A INPUT -s xx.xx.xx.xx -j DROP How to block an IP for a specific port: iptables -A INPUT -p tcp -s xx.xx.xx.xx –dport PORT -j DROP How to allow access to an IP? iptables -A INPUT -s xx.xx.xx.xx -j ACCEPT How to allow access to an IP [...]
October 18th, 2012 |
admin |
The MaxClients directive sets the limit on the number of simultaneous requests that can be supported. No more than this number of child server processes will be created. To configure more than 256 clients, you must edit the HARD_SERVER_LIMIT entry in httpd.h and recompile. In our case we want this variable to be as small [...]
October 18th, 2012 |
admin |
With Apache, one easy way to do this is to generate a link that contains a build/version number or date in the path, e.g: /css/{build-number-or-date}/file.css In Apache, in your configuration file (e.g. .htaccess if that is all you have access to) you can set the Expires header and rewrite your url to the real location. [...]
September 20th, 2012 |
admin |
Problem: Not able to list more than 2000 files in a directory using Ftp. Solution: The pure-ftp by default limit maximum number of # files to be displayed to 2000. So edit your pureftpd configuration file which is at /etc/pure-ftpd.conf and change the line LimitRecursion 2000 8 to LimitRecursion 5000 8 Save the file and [...]