Skip to main content

Posts

LINUX BOOT PROCESS

Linux booting process Step 1: Power Supply & SMPS ========================== * SMPS convert AC to DC . Convert High or Low voltage to perfect voltage and inform this power good signal to Motherboard * On receiveing this power good signal, Mother stops sending reset signal to CPU, which means the power level is good and computer can boot Step 2: Bootstrapping ===================== * Something has to be programmed so that the CPU knows where to search for instruction * This is an address location in last region of ROM (FFFF:0000h) and it contains JUMP instruction. * JUMP command is to jump in to another memory address location where the bios program is located. Step 3: The Role of BIOS in booting process ============================== ============= * The computer know how to bring itself up, when you press star button, because of the instruction that are fed to BIOS( basic input output  system) it performs its most important function POST (Power on self test) * POST...

Multiple variable using array in for loop; cPanel user IP address change

I always wonder how to assign multiple variables in for loop. Suppose I want to change the IP address of some users listed. [root@server4 ~]# cat test1 user1 user2 user3 user4 user5 [root@server4 ~]# cat test2 190.10.20.1 20.1.1.2 30.12.13.13 13.23.23.12 32.12.12.1 test1 are my users and test2 contains IP address that I want to assign [root@server4 ~]# xargs < test1 user1 user2 user3 user4 user5 [root@server4 ~]# xargs < test2 190.10.20.1 20.1.1.2 30.12.13.13 13.23.23.12 32.12.12.1 Now I am going define array [root@server4 ~]# a=(user1 user2 user3 user4 user5) [root@server4 ~]# b=(190.10.20.1 20.1.1.2 30.12.13.13 13.23.23.12 32.12.12.1) [root@server4 ~]# c=${#a[@]}  #length of array Lets see if it works [root@server4 ~]# for ((i=0;i<c;i++));do echo "${a[i]} ${b[i]}"; done user1 190.10.20.1 user2 20.1.1.2 user3 30.12.13.13 user4 13.23.23.12 user5 32.12.12.1 what if we implement ...

Adding new php module through EA

Adding a new module(mhash added here) through EA wget  http://mhash.sourceforge.net/  select and download unbunzip2 downloaded file ./configure --prefix=/opt/mhash make make install vi /etc/ld.so.conf.d/mhash.conf /opt/mhash/lib add this touch and add --with-mhash=/opt/mhash in /var/cpanel/easy/apache/rawopts/all_php5 /scripts/easyapache --build

MYSQL TO MARIA DB SWITCH

What is MariaDB ? MariaDB is a binary drop in replacement of the same MySQL version (for example MySQL 5.1 -> MariaDB 5.1, MariaDB 5.2 & MariaDB 5.3 are compatible. MySQL 5.5 will be compatible with MariaDB 5.5). What this means is that: * Data and table definition files (.frm) files are binary compatible. * All client APIs, protocols and structs are identical. * All filenames, binaries, paths, ports, sockets, and etc… should be the same. * All MySQL connectors (PHP, Perl, Python, Java, .NET, MyODBC, Ruby, MySQL C connector etc) work unchanged with MariaDB. * The mysql-client package also works with MariaDB server. * The shared client library is binary compatible with MySQL’s client library. *There are some installation issues with PHP5 that you should be aware of ( REF:https://mariadb.com/kb/en/installation-issues-with-php5 ). #mysqldump --all-databases --routines --triggers > /home/db_dump/alldb.sql # service mysql stop # cp -r /var/lib/mysql/my...

MOUNT AND UMOUNT

To mount all file system mentioned in the /etc/fstab use mount -a The mountpoint can be binded to a new directory. So that you would be able to access the contents of a filesystem via more than one mountpoints at the same time. mount -B /mydir /mnt Mount allows you to access the contents of a mount point from a new mount point. Its nothing but move a mounted tree to another place. mount -M /mydir /mnt mount -n this wont update the data in /etc/mtab Lazy umount  umount -l  /mydir Forcefully umount -f /mydir to see the process holding the directory fuser -cu /mydir Mount an ISO image to a directory # mount -t iso9660 -o loop pdf_collections.iso /mnt # cd /mnt # ls perl/ php/ mysql/

FSCK file system check commands

How to perform fsck  It is simple. Umount the partition and issue the below command e2fsck -y /dev/hda1 Run fsck on all file system e2fsck -A -y Exclude the root with option R e2fsck -AR -y Specify the file system type using t fsck -AR -t ext2 -y Donot execute fsck on mounted partitions e2fsck -M /dev/hda1

INODE,METADATA,SUPERBLOCK

INODE A data structure that stores the below information about a file ---------------------------------- Size of file Device ID User ID of the file Group ID of the file The file mode information and access privileges for owner, group and others File protection flags The timestamps for file creation, modification etc link counter to determine the number of hard links Pointers to the blocks storing file’s contents ------------------------------------------------ Inode doesnot store the file name and it is stored seperately, greatest advantage is hardlink can be created for different file name sharing same inode. Meta data =========== Its data about a data. Suppose you own a vehicle there are registration and other details of the vehicle that is not the part of it. Metadata gives info like File name Owner Creation date Location on storage medium SUPER BLOCK ============ Metadata describes the structure of the file system. Most comm...