How to check if nameserver is registered from command prompt

In order to check if a nameserver is registered, you can use the nslookup command on a command prompt. Here are the steps:

– Open a command prompt on your computer.
– Type the following command:

nslookup <nameserver>

Replace <nameserver> with the domain name of the nameserver that you want to check.… Read the rest

How to remove Mailman list from command line

Find rmlist binary file under  /usr/local/cpanel/3rdparty/mailman/bin folder

For more info run:

root@chi101 [/usr/local/cpanel/3rdparty/mailman/bin]# ./rmlist --help

Usage:
rmlist [-a] [-h] listname

Where:
–archives
-a
Remove the list’s archives too, or if the list has already been
deleted, remove any residual archives.

–help
-h
Print this help message and exit.

Read the rest

How to update WHM’s Basic WebHost Manager from command line

You need to update the following file:

/etc/wwwacct.conf

Output example:

NS yournameservhere.com
CONTACTEMAIL
HOMEDIR /home
ETHDEV eth0
NS4
SCRIPTALIAS y
NSTTL 86400
ADDR6
TTL 14400
HOST yourhostnamehere.com
LOGSTYLE combined
CONTACTPAGER
DEFMOD paper_lantern
ADDR 11.22.33.44
NS2 yournameservhere2.com
DEFWEBMAILTHEME paper_lantern
HOMEMATCH home
NS3 yournameservhere3.com

Read the rest

How to deal with “ea-php72” is not an EA4 SCL PHP error

Go to your WHM –> Home –> Software –> MultiPHP Manager

You should be able to resolve this by changing the domains to use an available version of PHP, or by installing the missing PHP versions.

You need to either install missed PHP version or set it to inherit

Command line solution:

Find main domain of account in issue and run:

whmapi1 php_set_vhost_versions version=inherit vhost=domainname.com
Read the rest

How to create a post using wp-cli

Install wp-cli and run something like the following:

wp post create --post_type=page --post_status=publish --post_title='Home' 
wp post create --post_type=page --post_status=publish --post_title='About'
wp post create --post_type=page --post_status=publish --post_title='News'
wp post create --post_type=page --post_status=publish --post_title='Contact'
Read the rest

How to get list of users using Drush cli

Please try to use one of the following

drush users:list
drush user-list
drush uinf $(drush sqlq "SELECT GROUP_CONCAT(name) FROM users_field_data")
drush uinf $(drush sqlq "SELECT GROUP_CONCAT(uid) FROM users")
drush uinf $(drush sqlq "SELECT GROUP_CONCAT(name) FROM users")

Don’t forget about mysql prefix if any

cat sites/default/settings.php
Read the rest

How to remove WordPress spam users using WP-CLI

If you have a huge amount of spam users in your database you need to check this post https://alltime.pp.ua/blog/how-to-remove-wordpress-spam-users-using-mysql-command-line/ as the way below will take ‘forever’ 🙂

Supposed you’ve decided to leave just ‘administrator’

Using command below you found a pattern

wp user list

So, now run to remove them:

wp user delete $(wp user list --role=author --field=ID)
wp user delete $(wp user list --role=customer --field=ID)
wp user delete $(wp user list --role=subscriber --field=ID)

You should be asked and if you are sure just type ‘y

–reassign parameter not passed.… Read the rest