Archive for March, 2013

Loadcheck script

================================================================= #!/bin/bash # # LoadCheck # Raj #——————————————————————– # #—–General-Configs———————————————— #general log name logn=$(date +”%m-%d-%H:%M.log”) #Path to the directory that will hold all logs logp=”/loadscripts/logs” #Path to file that is created for the email report loge=”/loadscripts/lastlog” #Script path – not needed – for later use scriptp= #—–Hard-Drive—————————————————— #Do we want to minitor hard drive usages? […]

Leave a comment

Usefull Scripts

script_to_chk_load_in_all_containers for x in $(vzlist -a | awk ‘{print $1}’) ; do  vzlist -a | grep $x  && vzctl exec $x w ;echo -e \n;done Determine the number of established and time_wait TCP connections on the server —————————————- netstat -an | grep tcp | egrep -i ‘established|time_wait’ | wc -l —————————————- How do you list […]

Leave a comment

cPanel Backup Script

#!/bin/bash ls /var/cpanel/users | grep ‘^a’ > a.txt cat ./a.txt | while read CPUSER; do echo “Now processing ${CPUSER} …” /scripts/pkgacct ${CPUSER} done The below script should help to force backups for particular domains on server .  Line  “ls /var/cpanel/users | grep ‘^a’ > a.txt ” copies account names starting with alphabet a to a […]

Leave a comment

How to migrate a website from addon domain(or subdomain) to main domain or vice versa

How to migrate a website from addon domain( or subdomain) to main domain or vice versa =================================================== 1. Download all emails under the account to be migrated using a mail client like outlook express 2. Download files backup & database backup of addon domain(or subdomain or main domain) with the help of a developer 3. […]

8 Comments

Scripting

Replacing it with IT ========================= s—substitute command sed ‘s/it/IT/’ /root/test Please chek if you can do IT Replacing /usr/local/bin /common/bin ========================= sed ‘s/\/usr\/local\/bin/\/common\/bin/’  /root/secondone /common/bin sed ‘s:/usr/local/bin:/common/bin:’ /root/secondone /common/bin # sed ‘s_/usr/local/bin_/common/bin_’ /root/secondone /common/bin # sed ‘s|/usr/local/bin|/common/bin|’ /root/secondone /common/bin Deleting line conatining Good from file d–delet sed ‘/Good /d ‘ /root/thirdone Have a great day […]

Leave a comment

How to enable domain keys and SPF records in cPanel server?

Domain keys: DomainKeys is an e-mail authentication system designed to verify the DNS domain of an e-mail sender and the message integrity. Using the following command we can enable domain keys for domains in cPanel server. === /usr/local/cpanel/bin/domain_keys_installer username where, username is the username of the domain. === Command to install Domain keys for all […]

Leave a comment

Helpful Urls for linux support

How do I Find Out Linux CPU Utilization? http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html Linux System Monitoring Tools Every SysAdmin Should Know   http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html Emergency DOS or DDOS stopping script for Linux   http://www.hackersgarage.com/emergency-dos-or-ddos-stopping-script-for-linux.html How to stop Small DDOS attacks (Some basic security advice)   http://rockdio.org/blogdio/how-to-stop-small-ddos-attacks-some-basic-security-advice/ Usefull Documentation regarding the Linux Support http://wiki.bashexperts.com/ http://wiki.bashexperts.com/steps-to-investigate-hacked-linux-server/

Leave a comment