This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Display bandwidth usage | |
# By [email protected] 2012/04/17 | |
if [ $# -lt 2 ]; | |
then echo "Error: wrong number of arguments"; | |
echo "Usage: $0 <username or site name> <traffic type> <month> <year> e.g. $0 stupi402 imap 4 2012" | |
echo "If no month and/or year are specified, script will display data for current month/year."; | |
echo "Also Please note that cPanel doesn't seem to save per-domain bandwidth for imap, ftp, pop and smtp." | |
exit 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use lib '/root/sysutils/modules'; | |
use XML::Simple; | |
use Data::Dumper; | |
use XMLAPIRequest; | |
chomp(my $hostname = `hostname`); | |
$xmlapi = XMLAPIRequest->new( | |
'HOSTNAME' => $hostname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Directory to store log files in | |
DST=/root/autotermination_logs | |
# Create DST if it doesn't exist | |
if [ ! -d "$DST" ]; then | |
mkdir -p $DST | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LIST=$1 | |
LOG=spf_add.log | |
date > $LOG | |
lecho() { | |
echo $@ 2>&1 | tee -a $LOG | |
} | |
backup_zones(){ | |
FILE=$(hostname)-$(date +%s)-zones.tgz | |
tar czf $FILE /var/named/*.db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /home/*/public_html/ -type f -iwholename "*/wp-includes/version.php" -exec grep -H "\$wp_version =" {} \; > wordpress.txt | |
find /home/*/public_html/ -type f \( -iwholename '*/libraries/joomla/version.php' -o -iwholename '*/libraries/cms/version.php' -o -iwholename '*/libraries/cms/version/version.php' \) -print -exec perl -e 'while (<>) { $release = $1 if m/ \$RELEASE\s+= .([\d.]+).;/; $dev = $1 if m/ \$DEV_LEVEL\s+= .(\d+).;/; } print qq($release.$dev\n);' {} \; > joomla.txt | |
find /home/*/public_html/ -type f -iwholename "*/modules/system/system.info" -exec grep -H "version = \"" {} \; > drupal.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
echo > /usr/local/src/temp_eximlog | |
echo > /usr/local/src/maliciousresults | |
echo > /usr/local/src/maliciousfiles | |
a=`date --date="3 hours ago" +%Y-%m-%d\ %H` | |
b=`date +%Y-%m-%d\ %H` | |
awk -v s="$a" -v e="$b" '$0~s,$0~e' /var/log/exim_mainlog >> /usr/local/src/temp_eximlog | |
cat /usr/local/src/temp_eximlog | awk '{print $3}' | grep /home | sort | uniq -c | sort -nr > scanmaillogdir.txt | |
for i in `cat /usr/local/src/scanmaillogdir.txt | cut -d= -f2` ; do | |
find $i -type f -name '*.php' -exec egrep -q 'yMxbgVDJ96|wUu2jGoB|$xYEzDu6r3EZT|$ZR2%tuMpYFr|$knmui74|x47LOBA|EWnBCG-hUfK|vC82XHO|rOqYibX4WA|ALaEJ!Pw|vHHEE8M|v08X2QH|vO5CQ7A|qjyxw29' {} \; -print >> /usr/local/src/maliciousfiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
read -p "Enter the IP address/domain : " prompt | |
konta=`find /usr/local/apache/logs -name "error_*" -mtime -1 | grep -v "gz"` | |
for i in $konta ; do | |
echo $i; | |
grep Security "$i" | grep $prompt > /usr/local/src/mod_security.txt; | |
total=`cat /usr/local/src/mod_security.txt | wc -l`; | |
#results=`cat $i | grep Security | grep $prompt` | |
#echo $results; | |
echo $total |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
echo > /usr/local/src/temp_eximlog | |
echo > /usr/local/src/maliciousresults | |
echo > /usr/local/src/maliciousfiles | |
a=`date --date="5 hours ago" +%Y-%m-%d\ %H` | |
b=`date +%Y-%m-%d\ %H` | |
awk -v s="$a" -v e="$b" '$0~s,$0~e' /var/log/exim_mainlog >> /usr/local/src/temp_eximlog | |
cat /usr/local/src/temp_eximlog | awk '{print $3}' | grep /home | sort | uniq -c | sort -nr > scanmaillogdir.txt | |
for i in `cat /usr/local/src/scanmaillogdir.txt | cut -d= -f2` ; do | |
find $i -type f -name '*.php' -exec egrep -q 'yMxbgVDJ96|wUu2jGoB|$xYEzDu6r3EZT|$ZR2%tuMpYFr|$knmui74|x47LOBA|EWnBCG-hUfK|vC82XHO|rOqYibX4WA|ALaEJ!Pw|vHHEE8M|v08X2QH|vO5CQ7A' {} \; -print >> /usr/local/src/maliciousfiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
echo > /usr/local/src/temp_eximlog | |
echo > /usr/local/src/maliciousresults | |
echo > /usr/local/src/maliciousfiles | |
a=`date --date="5 hours ago" +%Y-%m-%d\ %H` | |
b=`date +%Y-%m-%d\ %H` | |
awk -v s="$a" -v e="$b" '$0~s,$0~e' /var/log/exim_mainlog >> /usr/local/src/temp_eximlog | |
cat /usr/local/src/temp_eximlog | awk '{print $3}' | grep /home | sort | uniq -c | sort -nr > scanmaillogdir.txt | |
for i in `cat /usr/local/src/scanmaillogdir.txt | cut -d= -f2` ; do | |
find $i -type f -name '*.php' -exec egrep -q 'yMxbgVDJ96|wUu2jGoB|$xYEzDu6r3EZT|$ZR2%tuMpYFr|$knmui74|x47LOBA|EWnBCG-hUfK|vC82XHO|rOqYibX4WA|ALaEJ!Pw|vHHEE8M|v08X2QH|vO5CQ7A' {} \; -print >> /usr/local/src/maliciousfiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
hname=`hostname`; | |
echo > /usr/local/src/bw_limit.txt; | |
echo > /usr/local/src/bw_limit1.txt; | |
echo > /usr/local/src/cappedresults.txt; | |
find /usr/local/apache/conf/userdata/*/*/*/*/ -name "cp_bw_all_limit.conf" > /usr/local/src/bw_limit.txt | |
find /usr/local/apache/conf/userdata/*/*/*/ -maxdepth 1 -name "cp_bw_all_limit.conf" > /usr/local/src/bw_limit1.txt | |
echo "Hostname" ";" "Username" ";" "Domain Name" ";" "Bandwidth Limit" >> capped.csv | |
for i in `cat /usr/local/src/bw_limit.txt`; do | |
{ |