Monday, March 30, 2015

Basic Linux Commands -Part 2

<< Previous Part 1


 alias :  Create an alias

aliases allow a string to be substituted for a word when it is used as the first word of a simple command.
Syntax :                                                                         Key :
     alias [-p] [name[=value] ...]                                            -p   Print the current values
     unalias [-a] [name ... ]                                                   -a   Remove All aliases

 aspell  :   Spellcheck a file

Syntax :
      aspell check [options] filename
Key :
   -mode=mode
       The mode to use when checking files.
       The available modes are none, url, email, sgml, tex, texinfo, nroff
   –dont-backup
       Don't create a backup file.
   -lang=name
   -l name
       The language the document is written in. The default depends on the current locale.
   -encoding=name
       Encoding the document is expected to be in. The default depends on the current locale.
   -master=name
   -d name
       The main dictionary to use.

 bg :    Send job to background

Syntax :
      bg [PID...]
Key :
 If PID is specified, the jobs with the specified group ids are put in the background

 fg :      Send job to foreground

Syntax :
      fg [PID...]
Key :
 If PID is specified, the job with the specified group id is put in the foreground.

 jobs :   Print currently running jobs and their status.

Syntax :
      jobs [OPTIONS] [PID]
Keys :
   -c      --command       Print the command name for each process in jobs
   -g      --group            Only print the group id of each job
   -h      --help               Display a help message and exit
   -l       --last               Only the last job to be started is printed
   -p     --pid                Print the process id for each process in all jobs
 

 suspend :   Suspend the execution of shell until receives a SIGCONT signal.

Syntax :
      suspend [-f]
Key :
   -f   Do not complain if this is a login shell; just suspend anyway.

Friday, March 27, 2015

cPanel’s Manually Updated Hostname Alert

If you have recently updated your cPanel servers to 11.46, you may have received something that looks like the following alert.

WHM has detected a manual hostname change.
To fix this problem, we recommend that you perform the following action:
Update your hostname in WHM’s (http://new.hostname.com:2087/scripts2/changehostname) interface (Home » Networking Setup » Change Hostname).


If you did, then that means that your hostname was updated outside of WHM after cPanel was installed on that server. The fix is simple.

First log into SSH and run the below command:

root@host [~]# /usr/local/cpanel/scripts/check_valid_server_hostname
ERROR: WHM has detected a manual hostname change.


If your server is a WHM webserver, you need only navigate to WHM >> Change Hostname



Once that’s done, you can test that your server will no longer send an alert by running the hostname validation script manually:

root@host [~]# /usr/local/cpanel/scripts/check_valid_server_hostname 
OK

After the change you have made it’s confirmed that issue is fixed. Please always make sure you have a valid A record for your hostname.