View gist:fef83b5949057187c1723597247155b6
#Author : Arunlal A
echo -n "Enter databse user name: "
skill -9 -u $THEUSER ; for i in `mysqladmin processlist | grep $THEUSER | awk '{print $2}'` ; do mysqladmin kill $i ; done ; echo "$THEUSER has been killed!"
View gist:7a5f697d3f71f243372b6526fccc810a
#Author : Arunlal A
echo "Staring database backup process..."
for db in `echo 'show databases;' |mysql |grep -Ev "Database|information_schema|performance_schema"`; do mysqldump $db | gzip > /backup/$db.sql.gz ;done
echo "Done! Check /backup/ directory for your SQL files."
View gist:8c6cbae2266dc03a5d600700b0d2d6f5
echo "This script is useful for only commonly using CMSs like WP, Joomla, Drupal, Magento, Drupal etc with known configuration location. If nothing listing and you are getting db conntction error check configuration manually.. Thanks by Arunlal"
echo "" > details.txt
echo "Please enter the cPanel username: "
read username
grep -irl ${username}_ /home/$username/*{wp-config,configuration,config,,db-config,,configure,mysql.class,Settings}.php /home/$username/*/{wp-config,configuration,config,,db-config,,configure,mysql.class,Settings}.php /home/$username/*/*/{wp-config,configuration,config,,db-config,,configure,mysql.class,Settings}.php 2>/dev/null grep -v -E "mail|error_log|sql|html|var">> ${username}confs.txt
var=`cat ${username}confs.txt`
if [ -n "$var" ]; then
for i in `cat ${username}confs.txt`; do echo $i >> details.txt; grep -E "DB_USER|user|username|DB_PASSWORD|secret|password" $i |grep -v -E "cookies|generate"