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.





Friday, March 20, 2015

BOOT Process Of Windows Server 2008

Here’s the brief description of Windows Server 2008 Boot process.
  1. System is powered ON
  2. The CMOS loads the BIOS and then runs POST
  3. Looks for the MBR on the bootable device
  4. Through the MBR the boot sector is located and the BOOTMGR is loaded
  5. BOOTMGR looks for active partition
  6. BOOTMGR reads the BCD file from the \boot directory on the active partition
  7. The BCD (boot configuration database) contains various configuration parameters( this information was previously stored in the boot.ini)
  8. BOOTMGR transfer control to the Windows Loader (winload.exe) or winresume.exe in case the system was hibernated.
  9. Winloader loads drivers that are set to start at boot and then transfers the control to the windows kernel.
STEP 1:
 The first step is to see what hardware is available and its condition by using the power-on self

test (POST) routine. Next, BIOS executes the initial program load (IPL), which locates the

boot device and, if the device is a hard disk, the master boot record (MBR) is read from

the first sector on the disk. Otherwise, the equivalent information is obtained from the

boot device. From this information, partition information is obtained, the boot sector is

read, and the Windows Boot Manager (Bootmgr.exe) is started. On the screen, you see the

memory check, the identification of hardware, and the search for a boot device.

STEP 2:
 Windows Boot Manager reads the boot configuration data (BCD) and, if there is

more than one boot partition, asks the user to choose a partition and its OS. If a choice is

not made before the timeout, the default partition and OS is loaded. If you are booting

Windows Server 2008, the Windows Boot Loader (Winload.exe) is started. If you have

more than one hardware profile, you are given the option of pressing the spacebar to

select the hardware profile you want to use, for example, if you have a laptop that you

sometimes use with a docking station. If you press the spacebar , you can choose the

hardware profile you want; otherwise, the default profile is used.

Thursday, March 19, 2015

Windows Server 2003 Booting Process

BIOS: performs Power On Self Test (POST)
BIOS: loads MBR from the boot device specified/selected by the BIOS
MBR: contains a small amount of code that reads the partition table, the first partition marked as active is determined to be the system volume
MBR: loads the boot sector from the system volume
BOOT SECTOR: reads the root directory of the system volume at loads NTLDR
NTLDR: reads BOOT.INI from the system volume to determine the boot drive (presenting a menu if more than 1 entry is defined)
NTLDR: loads and executes NTDETECT.COM from the system volume to perform BIOS hardware detection
NTLDR: loads NTOSKRNL.EXE, HAL.DLL, BOOTVID.DLL (and KDCOM.DLL for XP upwards) from the boot (Windows) volume
NTLDR: loads \WINDOWS\SYSTEM32\CONFIG\SYSTEM which becomes the system hive HKEY_LOCAL_MACHINE\System
NTLDR: loads drivers flagged as “boot” defined in the system hive, then passes control to NTOSKRNL.EXE
NTOSKRNL.EXE: brings up the loading splash screen and initializes the kernel subsystem
NTOSKRNL.EXE: starts the boot-start drivers and then loads & starts the system-start drivers
NTOSKRNL.EXE: creates the Session Manager process (SMSS.EXE)
SMSS.EXE: runs any programs specified in BootExecute (e.g. AUTOCHK, the native API version of CHKDSK)
SMSS.EXE: processes any delayed move/rename operations from hotfixes/service packs replacing in-use system files
SMSS.EXE: initializes the paging file(s) and the remaining registry hives
** before this step completes, bugchecks will not result in a memory dump as we need a working page file on the boot (Windows) volume **
SMSS.EXE: starts the kernel-mode portion of the Win32 subsystem (WIN32K.SYS)
SMSS.EXE: starts the user-mode portion of the Win32 subsystem (CSRSS.EXE)
SMSS.EXE: starts WINLOGON.EXE
WINLOGON.EXE: starts the Local Security Authority (LSASS.EXE)
WINLOGON.EXE: loads the Graphical User Identification and Authentication DLL (MSGINA.DLL by default)
WINLOGON.EXE: displays the logon window
WINLOGON.EXE: starts the services controller (SERVICES.EXE)
** at this point users can logon **
SERVICES.EXE: starts all services markes as automatic
———
NOTES:
The SYSTEM volume is the partition from which the boot process starts, containing the MBR, boot sector, NTLDR, NTDETECT.COM & BOOT.INI

The BOOT volume is the partition which contains the Windows folder – this can be a logical partition