Tag archive for ‘shell script’

Remote Server Rsync Backup Replication Shell Script

You need to setup password less login using ssh keys; refer to following tutorials: + Howto Linux / UNIX setup SSH with DSA public key authentication (password less login) + SSH Public key based authentication – Howto #!/bin/bash # Remote Server Rsync backup Replication Shell Script # ————————————————————————- # Copyright (c) 2005 nixCraft project # [...]

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

NAS Backup Server Disk Monitoring Shell Script

A shell script to monitor server disk space and send an email alert to admin. This is useful if you are using rented dedicated / vps server and backup data to NAS everyday. This script will monitor disk space and it will send you an email. Make sure you setup your email id, NAS space [...]

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

Shell Script To Build And Install PHP Security Model Suhosin

#!/bin/bash # A simple shell to build and install suhosin as module for PHP under # CentOS, Fedora and RHEL / Redhat Enterprise Linux servers. # —————————————————————————- # Written by Vivek Gite <http://www.cyberciti.biz/> # (c) 2009 nixCraft under GNU GPL v2.0+ # —————————————————————————- # Home page: http://www.hardened-php.net # Last updated: 15/June/2010 # —————————————————————————- VERSION=”-${2:-0.9.31}” URL=”http://download.suhosin.org/suhosin${VERSION}.tgz” [...]

How To Use Gmail Account To Relay Email From a Shell Prompt

Usually, you do not need to setup an email server under Linux desktop operating system. Most GUI email clients (such as Thunderbird) supports Gmail POP3 and IMAP configurations. But, how do you send mail via the standard or /usr/bin/mail user agents or a shell script? Programs such as sendmail / postfix / exim can be [...]

To find cppop attack

tail -1000 /var/log/maillog | grep host= | cut -d= -f2| cut -d” ” -f1|sort -n |uniq -c |sort -n Incoming search terms:cppop security (1)

Script to find how many mails sent from an account

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

Listing all E-Mail accounts on a system

If you need to get a full list of all created end-User E-Mail Accounts, you can use a script to do so: #!/bin/sh cd /etc/virtual for i in `cat domains`; do { if [ ! -s $i/passwd ]; then continue; fi for u in `cat $i/passwd | cut -d: -f1`; do { echo “$u@$i”; }; [...]

Top memory consuming processes

ps aux | head -1;ps aux –no-headers| sort -rn +3 | head

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