Tag archive for ‘number’

When To Use Indexes In MySQL

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. [...]

PureFtp + Not able to list more than 2000 files

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 [...]

Delete Frozen Emails

Howto check number of emails in the mail queue: exim -bpc To check the email ID, sender and receiver of the each email: exim -bp | more To delete frozen emails from the mail queue, execute: exim -bp | grep ‘frozen’ | awk ‘{print $3}’ | xargs exim -Mrm similarly, to delete emails sent using [...]

Quick check for a ddos via number of connections

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 [...]

Apache Optimization

MaxClients ————— The number of worker processes is limited by the parameter MaxClients. MaxClients = Total RAM dedicated to the web server / Max child process size. The default value of  MaxClients is 150. If we have a server with 1gb of ram and  child process take an average size of 20 mb. We can [...]

Linux : How to run a command when boots up?

Other distribution provided the file called /etc/rc.local but Debian does not use rc.local to customize the boot process. You can use simple method as follows to customize it. (A) Execute command at system startup Let us assume you would like to run command called i) Create a script called mystartup.sh in /etc/init.d/ directory(login as root) [...]

Linux Iptables Limit the number of incoming tcp connection / syn-flood attacks

A SYN flood is a form of denial-of-service attack in which an attacker sends a succession of SYN requests to a target’s system. This is a well known type of attack and is generally not effective against modern networks. It works if a server allocates resources after receiving a SYN, but before it has received [...]

Shell script to find the number of files present in the current directory without using WC command

#!/bin/bash # Shell script to find the number of files present in the current # directory without using WC command. # NOTE/TIP: # If allowed to use WC command then it should be as follows: # ls | wc -l # ————————————————————————- # Copyright (c) 2005 nixCraft project # This script is licensed under GNU [...]

Security Comparison: Windows vs Linux

Much ado has been made about whether or not Linux is truly more secure than Windows. This article provides some tips and hints about the same. We compared Windows vs. Linux by examining the following metrics in the 40 most recent patches/vulnerabilities listed for Microsoft Windows Server 2003 vs. Red Hat Enterprise Linux AS v.3: [...]

Bash Shell Count Number of Characters In a String or Word

How do I count and print particular character (say D or digit 7) in a string or variable under Bash UNIX / Linux shell? You can use UNIX / Linux command such as sed, grep, wc or bash shell itself to count number of characters in a string or word or shell variable. grep Command [...]