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

Magento 2 useful commands

Enter Magento 2 folder

cd /home/username/public_html/

Reindex

php bin/magento indexer:reindex

Flush Cache

php bin/magento cache:flush

Magento version

php bin/magento --version

Disable a module

php bin/magento module:disable Magento_SOMEMODULE

Uninstall Magento

php bin/magento setup:uninstall

 

 

 

Source: https://www.measureddesigns.com/magento-2-useful-commands/… Read the rest

ClientExec how to reset password via mysql command line

PhpMyAdmin solution:

--  Login to your phpmyadmin.
--  To the left select the ClientExec Database created.
--  Click the "user_customuserfields" table.
--  Search for the userid 100
--  There will be a row with a value that starts with sha256: - Edit this row and delete the entire entry, example:
sha256:1000:gvoyL9UXv+lUXbdp+0+2cmJ3GpIZD7w:kWuARQ6K4HWNaopY9eQry4Wqga5MSRD5 ( DELETE THIS )
--  From the tables populated on the left, select the "users" table.
Read the rest

How to show a real multisite WordPress super admin users via MySQL command line

For multisite WordPress version run the following commands:

mysql
use database_name;
SELECT * FROM wp_sitemeta where meta_key='site_admins';

This will also allow you to know which users can access plugins for management… Read the rest

How to run a shell command as another user without Shell Access enabling

It needs if you don't want to waste time to enable Shell Access for specific user to run some command from his shell

sudo -H -u someuser bash -c 'uptime'

Example of using:

cd ~someuser/www
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
Read the rest

How to install WP-CLI

WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, set up multisite installs and much more, without using a web browser

cd
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod 755 wp-cli.phar
mv wp-cli.phar wp
mkdir wp_cli
mv wp wp_cli
echo "alias wp='~/wp_cli/wp'" >> ~/.bashrc
Read the rest