How to check bandwidth usage for user on cPanel serve from command line
To see user’s bandwidth for certatin period run next:
whmapi1 showbw searchtype=user search=Username year 2022 month 2
Enjoy!… Read the rest
Notes
To see user’s bandwidth for certatin period run next:
whmapi1 showbw searchtype=user search=Username year 2022 month 2
Enjoy!… Read the rest
Run the following to change your master domain:
whmapi1 modifyacct user=USERNAME domain=NEWDOMAIN.COM
Enjoy!… Read the rest
Run and put your domain:
read -p "Domain: " domain; username=`/scripts/whoowns $domain`; email=`grep @ /var/cpanel/users/$username |tail -n1 |cut -d '=' -f2|sed -e 's/@/\%40/'`; whmapi1 generatessl domains=$domain countryName=US stateOrProvinceName=Texas localityName=Houston organizationName="The Justice League of GG" emailAddress=$email pass=`openssl rand -base64 15` keysize=2048 skip_certificate=0
Now use WHM to install it
Enjoy!… Read the rest
Useful when you try to send a request from cPanel shell from your Dedicated IP address
For curl you need to use –interface to specify IP address
Example:
curl --interface 11.22.33.44 http://alltime.pp.ua/
For wget you need to use –bind-address to set IP from which you need to send a request
wget --bind-address=192.0.2.116 http://alltime.pp.ua/… Read the rest
You may use whmapi1 tool to reach this from command line
whmapi1 resetzone domain=domain.com
This will remove all custom settings and other garbage if any… Read the rest
To show all installed and enabled modules
drush pm-list --type=Module --status=enabled
To show all installed and enabled modules without system modules
drush pm-list --type=Module --no-core --status=enabled
To show disabled modules
drush pm-list --type=Module --no-core --status=disabled… Read the rest
Ensure you have kernel optimization tunes as the following disabled
sysctl -a |grep net.ipv4.tcp_tw_
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
To temporary disable without reboot:
sysctl -w net.ipv4.tcp_tw_recycle=0 sysctl -w net.ipv4.tcp_tw_reuse=0
Login an account as an user:
su user
Enter Moodle root folder and run as the following:
php admin/cli/purge_caches.php
Source: https://docs.moodle.org/310/en/Administration_via_command_line#Purge_caches… Read the rest
Error:
ERROR 1273 (HY000) at line 849: Unknown collation: ‘utf8mb4_unicode_520_ci’
To fix simply replace utf8mb4_unicode_520_ci to utf8mb4_unicode_ci inside your SQL dump
Example:
sed -i 's/utf8mb4_unicode_520_ci/utf8mb4_unicode_ci/g' yoursqldumphere.sql
or
replace 'utf8mb4_unicode_520_ci' 'utf8mb4_unicode_ci' -- yoursqldumphere.sql… Read the rest