May 7, 2010

Linux – Advanced Commands

Linux General,

Show status of ethernet interface eth0: ethtool eth0 List addresses for interfaces: ip addr show (OR) ip a Set default gateway: ip route add default via 1.2.3.254 List routing table: ip route show Add (or del) ip and mask (255.255.255.0): ip addr add 1.2.3.4/24 brd + dev eth0 Text Manipulation: Replace string1 with string2: sed…

Read more
May 7, 2010

Linux – Ethernet bonding

Linux General,

Linux bond or team multiple network interfaces (NIC) into single interface We have two Dell servers that need setup with Intel Dual Gig NIC. My idea is to improve performance by pumping out more data from both NIC without using any other method. This box act as heavy duty ftp server. Each night I need…

Read more
May 7, 2010

Linux – Tweaks

Linux General,

Fork Bomb on Linux/Unix: Q. Explain following bash code or bash fork() bomb? : () { : | :& };: A. This is a bash function. It gets called recursively (recursive function). This is most horrible code for any Unix / Linux box. It is often used by sys admin to test user processes limitations…

Read more
March 24, 2010

How to identify CPU resource problem?

Linux/Windows Support,

vmstat command helps us to determine if a server is running short of CPU resources. First, let us determine the number of CPUs available Linux: $ grep -i processor /proc/cpuinfo | wc -l FreeBSD: $ sysctl -a ‘hw.ncpu’ Run vmstat command 10 times with an interval of 5 seconds $ vmstat 5 10 procs ———–memory———-…

Read more
March 16, 2010

Extract the contents of an RPM

Linux General,

Using rpm2cpio command, the contents of an RPM package can be extracted without having to install the package. For source RPMs too this command can be used. This is illustrated with an example as follows, where we extract the contents of RPM, google-chrome-beta_current_i386.rpm. $ rpm2cpio google-chrome-beta_current_i386.rpm | cpio -idv ./etc/cron.daily ./etc/cron.daily/google-chrome ./opt/google/chrome ./opt/google/chrome/chrome ./opt/google/chrome/chrome-sandbox ./opt/google/chrome/chrome.pak…

Read more
March 16, 2010

Nagios Installation and Configuration

Server Management,

Nagios Installation in Ubuntu Required Packages Install the following packages on  Ubuntu before continuing. Apache 2 PHP GCC compiler and development libraries GD development libraries If not installed, using apt-get the above packages can be installed as follows sudo apt-get install apache2 sudo apt-get install libapache2-mod-php5 sudo apt-get install build-essential sudo apt-get install libgd2-xpm-dev Create…

Read more
March 16, 2010

Nagios – An Introduction

Server Management,

What is Nagios? Nagios is a framework for setting up monitoring of hosts, services, and networks . What are the components of Nagios? nagios – the main server software and web scripts nagios-plugins – the common set of check scripts used to query services nagios-nrpe – Nagios Remote Plugin Executor nagios-nsca – Nagios Service Check…

Read more
March 16, 2010

Firewall – Reject or Drop a packet

Linux/Windows Support,

Firewall – Reject or Drop a packet While setting up firewall rules, the biggest question that arises while blocking a packet is, whether to reject or drop that packet. Reject a packet – Block the packet with an error response to the sender of the packet. Drop a packet – Block the packet without any…

Read more
March 16, 2010

HTTP Response Status Codes information

HTTP/WebServer,

The HTTP status codes are divided into categories based on the first digit in the code Code Category Type Code Category Type 1nn Informational 2nn Success 3nn Redirection 4nn Client Error 5nn Server Error 1nn – Informational Codes 100 Continue 101 Switching Protocols 2nn - Success Codes 200 OK 201 Created 202 Accepted 203 Non-Authoritative…

Read more
March 13, 2010

Difference between Buffer and Cache

Linux General,

Buffers are allocated by various processes to use as input queues, etc. Most of the time, buffers are some processes’ output, and they are file buffers. A simplistic explanation of buffers is that they allow processes to temporarily store input in memory until the process can deal with it. Difference between Buffer and Cache Cache…

Read more