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 | |
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
#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
# 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
#!/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
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/bash | |
for i in `cat /usr/local/src/innodb_databases-08012016.txt`; do | |
echo $i; | |
echo "/var/lib/mysql/$i" | |
#ls -la /home/mysqlbackup/$i.sql | |
mv /var/lib/mysql/$i /home/sachinn/mysqlrestore; | |
mysqladmin create $i; | |
mysql $i < /home/mysqldump-08012016/$i.sql; | |
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 | |
for i in `cat /usr/local/src/innodb_databases-08012016.txt`; do | |
mysqldump -ER $i > /home/mysqldump-08012016/$i.sql; | |
done | |
//Before executing above script, file innodb_databases-08012016.txt which contains list of all the innodb databases must be present | |
on the location. To get the list of all innodb databases, use below commands | |
To find out Innodb databases |
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
How to configure a static IP address on CentOS 7/ RHEL 7 | |
==================== | |
http://ask.xmodulo.com/configure-static-ip-address-centos7.html | |
==================== | |
How to install MySQL Server 5.6 on CentOS 7 / RHEL 7 | |
========== | |
http://sharadchhetri.com/2014/07/31/how-to-install-mysql-server-5-6-on-centos-7-rhel-7/ | |
https://www.linode.com/docs/databases/mysql/how-to-install-mysql-on-centos-7 |
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
Refer: http://www.inmotionhosting.com/support/website/server-usage/identify-and-block-bad-robots-from-website | |
How to identify bad bot for a domain | |
============ | |
cd /home/xyystgkp/access-logs | |
cat justforflorida.com | awk -F\" '{print $6}' | sort | uniq -c | sort -n | |
>> | |
36 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 | |
71 Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html) | |
95 WordPress/3.5.1; http://justforflorida.com/florida |