Month: October 2009

Load Alert Monitoring

http://nixcraft.com/shell-scripting/923-cpu-usage-shell-script-monitoring-cpu-usage.html http://itmission.org/Main/Load-alert-bash-script-for-linux-servers Here is the script if 15 minutes load goes >= 6.0. Code: —————————————————————– #!/bin/bash # Set up limit below NOTIFY=”6.0″ FTEXT=’load average:’ # 15 min F15M=”$(uptime | awk -F “$FTEXT” ‘{ print $2 }’ | cut -d, -f3)” # compare it with last 15 min load average RESULT=$(echo “$F15M > $NOTIFY” | bc)…


Communicate via shell

Ever wondered if thre is a way to seek help from a remotely logged in user while you are on the shell?? Here is a nice tool that can help you out. It is “kibitz”. We can see an example: Suppose a number of users are logged into the system. Lets consider the case of…


Renice

The “niceness” of a process is a numeric hint to the kernel about how the process should be treated in relation to other processes contending for the CPU. The strange name is derived from the fact that it determines how nice you are going to be to other users of the system. A high nice…


Limit Emails per Day for a domain in Cpanel Server

Itz easy to limit emails/per hour in cpanel server by go to WHM – Tweak settings and find the option “emails per hour for a domain” and set the limit. “0? means there is no limit. How can we set the limit for a domain for each day as an exception? For that, edit the…


How to prevent Iframe attack

In order to reduce the chance of an IFrame attack, add these lines into your .htaccess file: RewriteEngine On RewriteCond %{QUERY_STRING} ^.*(;|< |>|’|”|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|cast|set|declare|drop|update|md5|benchmark).* [NC] RewriteRule .* – [F] Yummy


RPM quick, quick and quick

You can easily install rpm file with rpm -ivh rpm -ivh file-package.name.rpm   To view rpm file contents rpm -qlp file-package.name.rpm   To get info about rpm package itself rpm -qip file-package.name.rpm   To extract or open rpm file in current directory: rpm2cpio file.rpm | cpio -idmv ls


How to Disable Ping

To disable ping echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all To enable ping echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all


Multiple SSL sites on a single IP address

Configure Apache to support multiple SSL sites on a single IP address * Date: October 19th, 2009 * Author: Vincent Danen With Apache 2.2.12 and support for the SNI (Server Name Indication) extension to the SSL protocol, you can configure name-based HTTPS sites, just as you can name-based HTTP sites. Vincent Danen introduces the new…


Change multiple domains ip Cpanel

Main >> IP Functions >> IP Migration Wizard Follow the wizard…


Kill Zombie process

ps -ef | grep mailnull | grep -v grep | awk ‘{print “kill -9?, $2}’ | sh