Move out WordPress installation from public_html/ folder

cd your public_html/ and create OLD_WP/ folder

mkdir OLD_WP/

This will move WordPress' files/folders into the OLD_WP/ folder

mv wp-* index.php .htaccess robots.txt *.sql license.txt readme.html sitemap.xml xmlrpc.php error_log cgi-bin -t OLD_WP/

Then move it to level up

mv OLD_WP/ ../
Read the rest

Move out Joomla installation from public_html/ folder

cd your public_html/ and create OLD_JOOMLA/ folder

mkdir OLD_JOOMLA/

This will move Joomla's files/folders into the OLD_JOOMLA/ folder

mv web.config.txt tmp/ templates/ robots.txt README.txt plugins/ modules/ media/ logs/ LICENSE.txt libraries/ layouts/ language/ index.php includes/ images/ htaccess.txt .htaccess error_log .htaccess  docs/ configuration.php
Read the rest

Softaculous. How to disable unwanted CMS using command line

Find out CMS IDs:

less /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/enduser/iscripts.php |egrep 'CumulusClips|VidiScript|ClipBucket|ownCloud' |grep array

Then disable them as following:

php /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/cli.php --disable_script --sid=131,170,368,437
Read the rest

Cpanel whmapi1 tool notes

Check bandwidth for a user:

whmapi1 showbw searchtype=user search=USERNAME year 2018 month 8

Change account's master domain:

whmapi1 modifyacct user=USERNAME domain=NEWDOMAINNAME

Change username:

whmapi1 modifyacct user=USERNAME newuser=NEWUSERNAME

Change package:

whmapi1 changepackage user=USERNAME pkg=NEWPKG

Show account's info:

whmapi1 accountsummary user USERNAME

Enable shell access:

whmapi1 modifyacct user=USERNAME HASSHELL=1
read -p "Username: " u; whmapi1 modifyacct user=$u HASSHELL=1

Update hostname:

whmapi1 sethostname hostname=HOSTNAME

Generate self signed SSL certificate:

whmapi1 generatessl domains=example.com
Read the rest

How to calculate IMAP/POP3 dovecot bandwidth

How to calculate IMAP dovecot bandwidth:

less /var/log/maillog |grep Aug |grep DOMAIN.COM |grep -Po 'out\=.+?,' |cut -d '=' -f2 |tr -d ,|awk '{s+=$1} END {print "total: ", s, " bytes transferred over IMAP"}'

total:  83107245783  bytes transferred over IMAP

echo "83107245783/1024/1024" |bc
79257M
~80G


How to calculate POP3 dovecot bandwidth:

less /var/log/maillog |grep DOMAIN.COM
Read the rest