How to know default webmail client that user uses for email box Horde or Roundcube on a cPanel server

To check the default webmail client that a user uses for their email box on a cPanel server, you can use the following command:

egrep "roundcube|horde" /home/*/.cpanel/nvdata/*_default_webmail_app

It will show a user, email box and default webmail app that set up by the user by default

 … Read the rest

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 change master domain for an account on cPanel server from command line

To change the master domain for an account on a cPanel server from the command line, you can use the cPanel API WHMAPI1. Here are the steps:

– Connect to the server via SSH using your preferred terminal emulator.
– Use the following command to change the master domain for the account:

whmapi1 modifyacct user=USERNAME newdomain=newdomain.com
Read the rest

How to create a file of specific size using Linux command line

Run for a second:

yes "some text" > testfile.txt

Reduce size:

truncate -s 50M testfile.txt

Create 50M file using fallocate command

fallocate -l 52428800 testfile.txt

To be more exact using inline arithmetic:

fallocate -l $((50*1024*1024)) > testfile.txt

Using head command

head -c 50MB /dev/urandom > testfile.txt
Read the rest