How to generate Self-Signed SSL on cPanel server using command line

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

How to specify which IP address to use for curl or wget commands

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

How to get Drupal modules/plugins list using drush

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

How to fix Unknown collation utf8mb4_unicode_520_ci error while importing data from an sql dump

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