Tag archive for ‘Script’

How to add Domainkeys for a domain on a cPanel server?

“DomainKeys” is an anti-spam software application that uses a public key, cryptography to authenticate the sender’s domain. cPanel offers a installer script “domain_keys_installer” using which the DomainKeys can be created and added automatically for a domain. By default the DomainKeys is not added when the account is created on the server, it has to be [...]

Shell script to find all programs and scripts with setuid bit set on

#!/bin/bash # Shell script to find all programs and scripts with setuid bit set on. # If your system ever cracked (aka hacked) then system has this kind of binary # installed; besides the normal setuuid scripts/programs # # *TIP* # User directory /home and webroots such as /www canbe mounted with # nosuid option. [...]

Script to find how many mails sent from an account

grep xxx@xxx.com /var/log/exim_mainlog | grep “<=” | awk {’print $3′} | wc -l

reconfigure CPAN module preferences

The first time you use the Perl module CPAN, a script is executed in order to properly configure several options (like the location of tar, gzip and unzip files, the cache size for the build directory, etc). If you want to modify these configuration options at a later time, you can do it in 2 [...]

Script for cropping down the domlogs

Script for cropping down the domlogs #!/bin/bash for domain in /usr/local/apache/domlogs/*; do # Find the domain having more than 100 Mb log file size if [ 3000 -lt `du $domain | awk {'print $1'} 2> /dev/null` ] then { echo $domain; echo “splitting the file into sizes of 50 Mb each…”; /usr/local/cpanel/bin/cpuwatch 7.0 split -b [...]

Five minutes to a secure Linux system

You must be thinking that I’m kidding. Nope I’m not. Let me explain. After installing Linux the first thing you should do is turn off all services and deny all incoming traffic till you configured the box securely. But why…? A default installation could run many nonessential services. These services can turn into security risks. [...]

Script utility to read a file line line and separate line in fields

Script utility to read a file line line version 2. This is simpler version of readline script, it also demonstrate how to process text data file line by line and then separate line in fields, so that you can process it according to your need. #!/bin/bash # # Shell script utility to read a file [...]

How Do I Run a Firewall Script As Soon As eth0 Interface Brings Up?

I use ADSL at home via ISP modem. As soon as my eth0 comes up I would like to have my firewall script get executed and setup the iptables firewall rules for me. Earlier, I used to type the command /root/fs.dsl.start via the sudo command. However, while reading the man page of interfaces command I [...]

Shell script to backup a Mysql database and save it on a remote server using Ftp

The following shell script will dump the mysql database and will save the .sql file on a remote location using Ftp. This script will create a backup file including the current date so you can have multiple copies of the backups of the same database under one directory. Create a file called mysqlbkup.sh # vi [...]

Script for restarting apache at load 10

#!/bin/bash loadavg=$(uptime | awk -F “.” ‘{ print $1 }’ | awk -F “:” ‘{ print $5 }’) if [ "$loadavg" -ge "10" ]; then pkill -9 httpd sleep 3 /scripts/restartsrv_httpd fi Incoming search terms:restart apache if load high shell script (1)restarting high load apache server (1)

Enter your email address:

Liên Kết Website

web design | Shared linux windows problems | Dedicated server | website chất lượng cao | hosting chất lượng cao | Tutorial video collection | Troubleshooting Tips and Tutorial