Home » Programing

Script to find how many mails sent from an account

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

Shell Script List All Top IP Address Accessing Apache / Lighttpd Web Server

#!/bin/bash # Shell Script To List All Top Hitting IP Address to your webserver. # This may be useful to catch spammers and scrappers. # ———————————————————————- # This script is licensed under GNU GPL version 2.0 or above # ———————————————————————- # where to store final report? DEST=/var/www/reports/ips # domain name DOM=$1 # log file location [...]

Shell script to create list of backup files in ~/.mybackup file. Use with mybackup shell script

#!/bin/bash # mybackupadd – Add file to ~/.mybackup file, then backup and email all # file as tar.gz to your email a/c. # # Usage : ./mybackupadd ~/public_html/ # # Copyright (C) 2004 nixCraft project # Email : http://cyberciti.biz/fb/ # Date : Aug-2004 # ————————————————————————- # This program is free software; you can redistribute it [...]

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

Shell Script to read source file and copy it to target file

#!/bin/bash # Shell to read source file and copy it to target file. If the file # is copied successfully then give message ‘File copied successfully’ # else give message ‘problem copying file’ # ————————————————————————- # Copyright (c) 2005 nixCraft project <http://cyberciti.biz/fb/> # This script is licensed under GNU GPL version 2.0 or above # [...]

URL File-Access is Disabled in the Server Configuration

Warning: include() [function.include]: URL file-access is disabled in the server configuration is an error obtained by using the include command. Lucky for webmasters, this error is easily fixed via several different methods. Why This Error Occurs If you’re seeing this error, we are willing to bet that you are using the include statement as seen [...]

Top memory consuming processes

ps aux | head -1;ps aux –no-headers| sort -rn +3 | head Incoming search terms:ps aux | sort -n 3 | tail -10 (1)ps aux | sort -r -n 3 (1)

Hardening PHP from php.ini

PHP’s default configuration file, php.ini (usually found in /etc/php.ini on most Linux systems) contains a host of functionality that can be used to help secure your web applications. Unfortunately many PHP users and administrators are unfamiliar with the various options that are available with php.ini and leave the file in it’s stock configuration. By utilizing [...]

Vbulltin PHP Xcache Displaying Same Forum Data For Both Boards Error and Solution

Q. I’ve followed your Xcache php 5.x opcode cacher installation under RHEL 5 for my vbulltin board. I see good boosting in performance. Now I’ve installed 2nd VB forum on the same server and I see all sub-forums hosted from 1st forum. So I had to disable Xcache. I want Xcache for both board on same host. How [...]

Connect PHP with Oracle database

I spent the last four days looking for the correct way to Connect Apache server (PHP) with Oracle database, unfortunatly I didn’t find any complete article.So in this blog, I’m giving my expernce to connect ‘em 2geth 1. Install Apache server: I make this step in a seprated blog page, plz check it from this [...]