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
To find out Innodb databases | |
================ | |
mysql -N mysql -e "SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE engine = 'innodb';" | awk '{print $1}' | sort | uniq > /usr/local/src/innodb_databases-08012016.txt | |
find /var/lib/mysql -name "*.ibd"|awk -F / '{print $5}'|sort -n|uniq > /usr/local/src/innodb_databases-08012016.txt | |
MySQL variables used are | |
-e, --execute=name Execute command and quit. (Disables --force and history file.) | |
-N, --skip-column-names Don't write column names in results. | |
================ |
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/sh | |
ionice -c3 find /home/*/fantastico_backups/ -name 'backup*' -mtime +15 -exec rm {} \; | |
ionice -c3 find /home/*/fantastico_backups/ -name '.backup*' -mtime +15 -exec rm {} \; | |
ionice -c3 find /home/*/tmp/Cpanel_Form_file.upload.* -mtime +0 -exec rm {} \; | |
ionice -c3 find /home/*/mail/*/*/.Trash/cur/* -type f -mtime +6 -exec rm {} \; | |
ionice -c3 find /home/*/mail/*/*/.Trash/new/* -type f -mtime +6 -exec rm {} \; | |
ionice -c3 find /home/*/mail/.Trash/cur/* -type f -mtime +6 -exec rm {} \; | |
ionice -c3 find /home/*/mail/.Trash/new/* -type f -mtime +6 -exec rm {} \; |
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
# Original Script Source: http://repo.arvixe.com/perk/perms.txt | |
#Run it as from the location /home/user/public_html ONLY: curl downloadURL | bash | |
#!/bin/bash | |
SC="Permissionairy" | |
VSN=".0991" | |
UN=$(pwd | cut -d / -f3) |
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
#If you are receiving complaints against your server for outgoing xmlrpc brute-force attack, then you can easily find-out culprit account by using below steps: | |
1) Run below command in 'Screen', it will dump all the monitored logs to /home/logs/tcpdump14022016 file. | |
tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' > /home/logs/tcpdump14022016 | |
2) Set up below crons on the server. You can either set up these crons in the server crons i.e at crontab -e or you can set it up at /etc/cron.d/filename, for e.g. as in below case filename is "dumplogs". | |
root@test[/etc/cron.d]# cat dumplogs | |
* * * * * root /home/logs/writelogs.sh | |
* * * * * root sleep 30; /home/logs/writelogs.sh |
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 > accountdetails; | |
#soho_accounts.txt must exists with list of cpanel usernames | |
for i in `cat soho_accounts.txt` ; do | |
{ | |
#read -p "Enter the Post Migration username : " prompt | |
echo "(===========================" >> accountdetails; | |
echo "----- Account Size -----" >> accountdetails; | |
echo "===========================" >> accountdetails; | |
du -sh /home/$i >> accountdetails; |
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
for i in `cut -d: -f1 /etc/trueuserdomains`;do echo "$i= `cut -d' ' -f1 /usr/local/apache/domlogs/$i|wc -l`" >> /usr/local/src/file;done |
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 | |
set -x | |
echo > /usr/local/src/customphpini.txt; | |
echo > /usr/local/src/commentphp.txt; | |
thetime=`date +"%Y-%m-%d-%S"`; | |
php -m > /usr/local/src/modules.txt | |
echo "================================" >> /usr/local/src/modules.txt | |
/usr/local/apache/bin/apachectl -M >> /usr/local/src/modules.txt | |
cp -ar /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf_$thetime; | |
cp -ar /usr/local/lib/php.ini /usr/local/lib/php.ini_$thetime; |
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 | |
set -x | |
echo > /usr/local/src/customphpini.txt; | |
echo > /usr/local/src/commentphp.txt; | |
echo > /usr/local/src/oldextensions.txt; | |
echo > /usr/local/src/newextension.txt; | |
oldextension=`php -i | grep -w "extension_dir =" | grep -v "sqlite" | awk '{print $3}'`; | |
ls -la $oldextension | awk '{print $9}' | grep -v "./" | grep -v "../" | grep -v '^$' > /usr/local/src/oldextensions.txt; | |
thetime=`date +"%Y-%m-%d-%S"`; | |
php -m > /usr/local/src/modules.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 | |
pprocess=`ps -ef | grep "spamemails.sh" | grep -v "grep" | wc -l`; | |
if [ "$pprocess" -le 2 ] | |
then | |
{ | |
sh /usr/local/src/newmalicious.sh >> /usr/local/src/permupdates.txt; | |
} | |
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
Ref Links: | |
============= | |
https://jvulinux.wordpress.com/2014/12/26/commands-to-check-spamming-in-postfix-mail-server/ | |
https://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html | |
============= | |
Commands to check spamming in POSTFIX mail server | |
1. To see the mail queue: |