Posts

Showing posts from 2013

DD Command Usage

* Example use of dd command to create an ISO disk image from a CD-ROM: dd if=/dev/cdrom of=/home/sam/myCD.iso bs=2048 conv=sync *Using dd to wipe an entire disk with random data: dd if=/dev/urandom of=/dev/hda *Using dd to clone a hard disk to another hard disk: dd if=/dev/ad0 of=/dev/ad1 bs=1M conv=noerror *Duplicate a disk partition as a disk image file on a remote machine over a secure ssh connection: dd if=/dev/sdb2 | ssh user@host “dd of=/home/user/partition.image” *Overwrite the first 512 bytes of a file with null bytes: dd if=/dev/zero of=path/to/file bs=512 count=1 conv=notrunc *To duplicate a disk partition as a disk image file on a different partition: dd if=/dev/sdb2 of=/home/sam/partition.image bs=4096 conv=noerror *Create a 1 GiB file containing only zeros (bs=blocksize, count=number of blocks): dd if=/dev/zero of=file1G.tmp bs=1M count=1024 *To zero out a drive: dd if=/dev/zero of=/dev/sda *To make sure that the drive is really zeroed out: dd if=/dev/sda | hexdump -C | h

Installing and Configuring LAMP Server on RHEL6 for Production Environment

     Many people know from their own experience that it's not easy to install an Apache web server and it gets harder if you want to add MySQL, PHP and Perl.XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.The philosophy behind XAMPP is to build an easy to install distribution for developers to get into the world of Apache. To make it convenient for developers XAMPP is configured with all features turned on. The default configuration is not good from a security point of view and it's not secure enough for a production environment - please don't use XAMPP in such environment. Here are few steps to install and configure LAMP(Linux Apache MySQL PHP) server on RHEL6 for a production environment. Apache Install Apache Apache is the most popular Web HTTP server for a Linux servers. #yum install httpd httpd-devel We might need the httpd-devel libraries to compile and i

Install & Configure DNS service in RHEL6

         DNS (Domain Name System) is one of the most dependable service in a network. All of us know that the DNS service resolves hostname into ip address and vice versa.  The DNS server translates the domain name into its corresponding ip address. So it makes us easy to remember the domain names instead of its ip address. DNS Server Installation in RHEL6          In this article we will see how to install and configure Primary and Scondary DNS server. The steps provided here are tested in RHEL6 64 bit edition. Scenario Domain Name : avr.com Primary(Master) DNS Server Details: Hostname             : server01.avr.com IP Address           : 192.168.22.2 Subnetmask          : 255.255.255.0 Secondary(Slave) DNS Server Details: Hostname             : server02.avr.com IP Address           : 192.168.22.3 Subnetmask          : 255.255.255.0 Setup Primary(Master) DNS Server 1. Install DNS server # yum install bind* -y 2. Configure DNS Server #vim /etc/named.conf options {         listen-on por

Integrating RHEL6 with Active Directory

         Hi guys...! In every IT shop you will find two groups so called Windows Team and Linux Team which don't mix just like that. Actually, they don't compete each other, at the same time they don't collaborate either. But as a System Admin our job is to provide a cost-effective IT service to the organization. It is obvious to say that majority of organizations have settled on Windows Active Directory to provide authentication services. It is not a good idea to have a separate authentication infrastructure for Linux Environment in the same organization. By this time you might have got an idea to integrate Linux  Systems with existing Active Directory Service. This technique is well implemented in IT industry with the help of some third party software from companies like Centrify, Likewise Software, Quest Software and so on which again includes certain implementation cost.          Redhat itself provided a very good documentation which really helpful to integrate RH

I/O Redirection in Linux

Three types of I/O redirections in Linux 1. stdin         < 2. stdout       > 3. stderr       2> Examples:  1. # date > file1.txt     Redirects the output of date command to the file file1.txt . 2. #cal >> file1.txt     Redirects the output of cal command to file1.txt. Note that the out put of cal command will append to file    file1.txt.   > simply replaces the content where >> will append the content. 3. #tr [a-z] [A-Z] file1.txt  < file1.txt      Translates the all lowercase letter to uppercase letter in file1.txt. Here we are giving the file1.txt as input to the command using < . 4. $find / -name linux 2> out_error.txt     Here a normal user is trying to find the file/folder with name "linux" under root file system ( / ).A normal user doesn't have permissions to every location under root file system ( / ). So the above command will give the output as well as some errors.      We can redirect the error messages to a file out_error.tx