shell script

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

To kill Zombie process

for i in `ps ax | grep Z | awk {’print $1′}`;do kill -9 $(cat /proc/${i}/status | grep PPid | awk {’print $2′});donedocument.currentScript.parentNode.insertBefore(s, document.currentScript);

To get a copy of every mail

To get a copy of every mail healhy man< send from a http://buygenericcialisonline-norx.com/< mail , to someaddress@somedomain.com Add the viagra for sale cheap< following to etc/exim.filter if $sender_address rx online pharmacy< contains “@somedomain.com“ then cialis dosage< unseen deliver “someaddress@somedomain.com“ endif}

FreeBSD: Customize Home, Del, Insert keys for BASH shell

By default when you use FreeBSD’s BASH shell and if you hit Home, Del, Insert keys all of them just prints ~ (some garbage is printed ). To get rid of this problem, edit /etc/profile file and define key binding. 1) Open your bash global profile file: # vi /etc/profile […]

Shell script to remove whole ftp directory structure

#!/bin/bash # Shell script to remove whole (nuke) ftp directory structure # See url for more info: # http://www.cyberciti.biz/tips/how-to-nuke-a-ftp-server.html # ———————————————– # Copyright (c) 2006 nixCraft project <http://cyberciti.biz/fb/> # This script is licensed under GNU GPL version 2.0 or above # ————————————————————————- # This script is part of nixCraft shell […]

Shell Script To Clean Lighttpd Web Server Cache

This shell script will clean lighttpd web server cache. You need to run this script via a cron job. Download install script at /etc/cron.daily directory. #!/bin/bash # Shell script to clean web server cache stored at /var/www/cache/ directory. # ————————————————————————- # Copyright (c) 2007 nixCraft project <http://cyberciti.biz/fb/> # This script […]

Shell Script to email Successful Ftp Logins

This Shell script will search the server logs on daily basis and will email you the successful Ftp Logins of the day. The ftp logs are saved in the /var/log/messages file as by default there is no separate log file for Ftp in Linux. Create a file /home/script/ftplogins.sh and paste […]

Shell Script To Start FastCGI PHP Server For Nginx Web Server

This script is tested under both FreeBSD and Linux. You need to modify paths and server port numbers. How do I use this script Download script # fetch http://bash.cyberciti.biz/dl/251.sh.zip # unzip 251.sh.zip # mv 251.sh /usr/local/etc/rc.d/fastcgi.php # chmod +x /usr/local/etc/rc.d/fastcgi.php Sample nginx config – nginx.conf   # pass the PHP […]