Sunday, May 29, 2011

Linux Configure Tata Indicom Photon+ Mobile Broadband

EC1260 HSIA USB modem support download speed of upto 3.1Mbps and upload speed of upto 1.8Mbps.
The driver for this modem is provided with Linux kernel 2.6.20 or above. In other words any modern Linux distribution will able to use this modem out of box. The following instructions are tested on:
  1. Debian Linux 5.x
  2. Ubuntu Linux 9.10
  3. Fedora Linux 12 / Redhat & friends

Step #1: Get Required Software

=> wvdial - Text based PPP dialer with built-in intelligence.
OR
=> gnome-ppp - GUI based modem Internet c
onnection tool for the GNOME Desktop.

Linux Drivers For EC1260 CDMA HSIA USB modem

The following drivers are used by Linux:
  • usbserial - USB serial driver (modem driver).
  • usb-storage - USB pen driver.

Install Required Software

You can install any one of the above program from the CD/DVD or via the Internet (connect using Ethernet or any other medium). Once connected install the wvdial package under Debian / Ubuntu Linux, run:
# apt-get install wvdial gnome-ppp
If you are using Redhat / Fedora / CentOS Linux, enter:
# yum install wvdial

Step #2: Stop Services

Turn off other networking interface (such as vmware or virtual box networking):
# /etc/init.d/vmware stop
# ifconfig eth0 down

Make sure you remove other usb storage devices such as pen or external hard disk and remove usb-storage driver:
# rmmod usb_storage
Above will make sure you get correct routing table (you can turn on all other services once connected).
Note if you know how to set static routing using route command skip the step # 2.

Step #3: Install Modem

Insert the USB modem and monitor your /var/log/messages file, enter:
# tail -f /var/log/messages
Sample outputs:
Dec  4 10:08:30 vivek-desktop kernel: [ 3957.760015] usb 4-2: new full speed USB device using uhci_hcd and address 4
Dec 4 10:08:30 vivek-desktop kernel: [ 3957.932103] usb 4-2: configuration #1 chosen from 1 choice
Dec 4 10:08:30 vivek-desktop kernel: [ 3957.959732] Initializing USB Mass Storage driver...
Dec 4 10:08:30 vivek-desktop kernel: [ 3957.961031] scsi15 : SCSI emulation for USB Mass Storage devices
Dec 4 10:08:30 vivek-desktop kernel: [ 3957.961146] usbcore: registered new interface driver usb-storage
Dec 4 10:08:30 vivek-desktop kernel: [ 3957.961150] USB Mass Storage support registered.
Dec 4 10:08:30 vivek-desktop kernel: [ 3958.240046] usb 4-2: USB disconnect, address 4
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.520015] usb 4-2: new full speed USB device using uhci_hcd and address 5
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.703066] usb 4-2: configuration #1 chosen from 1 choice
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.717371] scsi19 : SCSI emulation for USB Mass Storage devices
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727347] USB Serial support registered for GSM modem (1-port)
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727388] option 4-2:1.0: GSM modem (1-port) converter detected
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727481] usb 4-2: GSM modem (1-port) converter now attached to ttyUSB0
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727495] option 4-2:1.1: GSM modem (1-port) converter detected
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727550] usb 4-2: GSM modem (1-port) converter now attached to ttyUSB1
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727563] option 4-2:1.2: GSM modem (1-port) converter detected
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727617] usb 4-2: GSM modem (1-port) converter now attached to ttyUSB2
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727639] usbcore: registered new interface driver option
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727642] option: v0.7.2:USB Driver for GSM modems
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.714729] scsi 19:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 0
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.717721] scsi 19:0:0:1: Direct-Access HUAWEI SD Storage 2.31 PQ: 0 ANSI: 2
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.746710] sr3: scsi-1 drive
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.746951] sr 19:0:0:0: Attached scsi generic sg6 type 5
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.747085] sd 19:0:0:1: Attached scsi generic sg7 type 0
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.807173] sd 19:0:0:1: [sdd] Attached SCSI removable disk
Type the following command to display information about USB buses in the system and the devices connected to them, enter:
# lsusb
Sample outputs:
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 003: ID 12d1:140b Huawei Technologies Co., Ltd.
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Step #4: wvdial Configuration

The wvdialconf command detects your modem, its maximum baud rate, and a good initialization string and generates or updates the wvdial configuration file based on this information. Type the following command:
# wvdialconf
Sample outputs:
Editing `/etc/wvdial.conf'.

Scanning your serial ports for a modem.

ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
ttyS1<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS1<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS1<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
Modem Port Scan<*1>: S2 S3
WvModem<*1>: Cannot get information for serial port.
ttyUSB0<*1>: ATQ0 V1 E1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB0<*1>: Modem Identifier: ATI -- Manufacturer: +GMI: HUAWEI TECHNOLOGIES CO., LTD
ttyUSB0<*1>: Speed 9600: AT -- OK
ttyUSB0<*1>: Max speed is 9600; that should be safe.
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
WvModem<*1>: Cannot get information for serial port.
ttyUSB1<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
WvModem<*1>: Cannot get information for serial port.
ttyUSB2<*1>: ATQ0 V1 E1 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB2<*1>: Modem Identifier: ATI -- Manufacturer: +GMI: HUAWEI TECHNOLOGIES CO., LTD
ttyUSB2<*1>: Speed 9600: AT -- OK
ttyUSB2<*1>: Max speed is 9600; that should be safe.
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
ttyUSB2: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
Here is sample updated /etc/wvdial.conf file:
[Dialer Defaults]
Modem = /dev/ttyUSB2
Phone = #777
Username = internet
Password = internet
New PPPD = yes
stupid Mode = 1

How Do I Connect To The Internet?

Simply type the wvdial command, enter:
# wvdial
Sample outputs:

Fig.01: Configuring Photon+ Huawei EC 1260 in Linux (connected via ppp)
Fig.01: Configuring Photon+ Huawei EC 1260 in Linux (connected via ppp)

Test The Internet Connection

Send ping request, enter:
ping google.co.in
ping cyberciti.biz

If you cannot ping ...

Edit /etc/resolv.conf, enter:
# vi /etc/resolv.conf
Update it as follows:
nameserver 202.54.12.164
nameserver 202.43.29.5
Save and close the file. Test it again:
# ping google.com
Once connected you can start your vmware or bring back eth0 connections. Make sure routing setup correctly for other network device:
# route -n
To disconnect the Internet session (wvdia dialar) simply hit [CTRL]+[C] or run killall command:
# killall wvdial

Saturday, May 21, 2011

Debian Linux Configure Wireless Networking With WPA2

I've Atheros AR5001 wifi a/b/g card detected and supported natively under Linux. How do I configure my wireless card with WPA2 networking using /etc/network/interfaces file?

Wi-Fi Protected Access II (WPA2 i.e. IEEE 802.11i) is security protocols for wireless communication. It introduces CCMP, a new AES-based encryption mode with strong security in mind. Under Debian Linux you need to install wpasupplicant to support for WPA and WPA2 networks. Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands as root user:

Step #1: Install wpasupplicant

To install wpasupplicant simply type the following command as root user:
# apt-get install wireless-tools
OR
# apt-get install wpasupplicant

Step #2: Verify WiFi / Wireless Card Is Detected

Use the lspci command to verify that card is detected:
# lspci
# lspci | grep -i wlan
# lspci | grep -i wireless
# lspci | grep -i wifi
# lspci -nn | grep Network

Sample outputs:
0c:00.0 Network controller: Intel Corporation Ultimate N WiFi Link 5300
This page explains the lspci command to find out Wireless driver chipset information under Linux. Or you can go to Linux wireless LAN support page and make sure your card is listed as supported device under Linux. You can also see your wireless interface name using the following command:
# ifconfig -a
OR
# dmesg | grep -i wlan
# dmesg | grep -i wireless

Step #3: Configure WPA2

Edit /etc/network/interfaces file, enter:
# vi /etc/network/interfaces
Setup wlan0 with the SSID and PSK as follows:
 
auto wlan0
iface wlan0 inet dhcp
wpa-ssid YOUR-SSID-HERE
wpa-psk YOUR-PASSWORD-HERE
 
Make sure you use strong pass-phrase. Save and close the file. You can now connect to the interface, enter:
# ifup wlan0
# ifconfig wlan0
# ping router-ip-here
# ping google.com

OR you can restart the networking service using any one of the following method:
# /etc/init.d/networking restart
OR
# service networking restart

Get Info About Your Network

To see more info about wifi, enter:
# iwconfig wlan0

Scan Your Wireless Network

Type the following command:
# iwlist wlan0 scan

Sample /etc/network/interface Config File

 
# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.1
 
# The wireless network interface with dhcp
auto wlan0
iface wlan0 inet dhcp
wpa-ssid nixcraft
wpa-key-mgmt WPA-PSK
wpa-group TKIP CCMP
wpa-psk YOYR-PASSWORD-HERE
 

Troubleshooting wpa_supplicant

See wpa_supplicant log file /var/log/wpa_supplicant.*.log using the tail, more, or grep command:
# tail -f /var/log/wpa_supplicant.wlan0.log
# grep 'something' /var/log/wpa_supplicant.wlan0.log

A Note About GUI Configuration Tool

You can use NetworkManager - a graphical interfaces for GNOME and KDE. If you are using NetworkManager, avoid using Debian's /etc/network/interfaces file. See this page for more information about Gnome / KDE wireless network config tool.

Recommended readings:

Anytime you need assistance with Linux wifi configuration option, turn to the following man page first. It will give you detailed information, parameters and switches for wifi configurations. For example, man 5 interfaces opens the man page for the interfaces network configuration file:
$ man 5 interfaces
$ man 8 wpa_supplicant
$ man 8 iwconfig
$ man 8 iwlist

Howto: Upgrade Linux Kernel

How do I upgrade my Linux kernel? I would like to upgrade kernel without compiling from source code i.e. binary upgrade. How do I perform the actual upgrade of the kernel in Linux?

You need to compile kernel only if:
=> You need custom made kernel for specific task such as embedded kernel.
=> Apply third party security patches.
=> You need to apply specific patch to Linux

Upgrade of the kernel in Red Hat enterprise Linux version <= 4.x

If your system is registered with Red Hat Network (RHN), then you can use the up2date command as follows:
# up2date -f kernel
For SMP kernel (multi core or multiple CPU) use command:
# up2date -f kernel-smp

Upgrade of the kernel in Fedora Linux / CentOS / RHEL 5

Use yum command to upgrade kernel:
# yum update kernel
If you have downloaded RPM file use rpm command:
# rpm -ivh kernel*

Upgrade of the kernel in Debian or Ubuntu Linux

Use apt-get command. First find your kernel version:
$ uname -r
Next find available kernel images:
$ apt-cache search linux-image
Now install kernel by explicitly specifying version number:
# apt-get install linux-image-x.x.x-xx
OR
$ sudo apt-get install linux-image-x.x.x-xx

Linux: TMOUT To Automatically Log Users Out

How do I auto Logout my shell user in Linux after certain minutes of inactivity?

Linux bash shell allows you to define the TMOUT environment variable. Set TMOUT to automatically log users out after a period of inactivity. The value is defined in seconds. For example,

 
export TMOUT=120
 
The above command will implement a 2 minute idle time-out for the default /bin/bash shell. You can edit your ~/.bash_profile or /etc/profile file as follows to define a 5 minute idle time out:
 
# set a 5 min timeout policy for bash shell
TMOUT=300
readonly TMOUT
export TMOUT
 
Save and close the file. The readonly command is used to make variables and functions readonly i.e. you user cannot change the value of variable called TMOUT.

How Do I Disable TMOUT?

To disable auto-logout, just set the TMOUT to zero or unset it as follows:
$ export TMOUT=0

or
$ unset TMOUT

Please note that readonly variable can only be disabled by root in /etc/profile or ~/.bash_profile.

HowTo: Upgrade Red Hat Enterprise Linux 6 to to v6.1

RHEL version 6.1 has been released with new features and improvements. How do I upgrade my HP server running RHEL v6.0 to v6.1 using RHN?

You can upgrade the system using the yum command itself. Make a backup - it cannot be stressed enough how important it is to make a backup of your system before you do this. Most of the actions listed in this post are written with the assumption that they will be executed by the root user running the bash or any other modern shell.
# uname -r
Sample outputs:
2.6.32-71.29.1.el6.x86_64
You can see current RHEL release details using cat command as follows:
# cat /etc/redhat-release
Sample outputs:
Red Hat Enterprise Linux Server release 6.0 (Santiago)
To upgrade RHEL to v6.1, enter:
# yum -y update
Sample outputs:
Dependency Installed:
abrt-plugin-mailx.x86_64 0:1.1.16-3.el6 gnutls-utils.x86_64 0:2.8.5-4.el6
libcacard.x86_64 0:0.1.2-2.el6 radvd.x86_64 0:1.6-1.el6

Updated:
Red_Hat_Enterprise_Linux-Release_Notes-6-en-US.noarch 0:1-26.el6
abrt.x86_64 0:1.1.16-3.el6
abrt-addon-ccpp.x86_64 0:1.1.16-3.el6
abrt-addon-kerneloops.x86_64 0:1.1.16-3.el6
abrt-addon-python.x86_64 0:1.1.16-3.el6
abrt-cli.x86_64 0:1.1.16-3.el6
abrt-libs.x86_64 0:1.1.16-3.el6
abrt-plugin-logger.x86_64 0:1.1.16-3.el6
abrt-plugin-rhtsupport.x86_64 0:1.1.16-3.el6
abrt-plugin-sosreport.x86_64 0:1.1.16-3.el6
at.x86_64 0:3.1.10-43.el6
audit.x86_64 0:2.1-5.el6
audit-libs.x86_64 0:2.1-5.el6
audit-libs-python.x86_64 0:2.1-5.el6
augeas-libs.x86_64 0:0.7.2-6.el6
authconfig.x86_64 0:6.1.12-5.el6
avahi-libs.x86_64 0:0.6.25-11.el6
bash.x86_64 0:4.1.2-8.el6
bfa-firmware.noarch 0:2.3.2.3-1.el6
bind-devel.x86_64 32:9.7.3-2.el6
bind-libs.x86_64 32:9.7.3-2.el6
bind-utils.x86_64 32:9.7.3-2.el6
binutils.x86_64 0:2.20.51.0.2-5.20.el6
blktrace.x86_64 0:1.0.1-4.el6
busybox.x86_64 1:1.15.1-11.el6
coreutils.x86_64 0:8.4-13.el6
coreutils-libs.x86_64 0:8.4-13.el6
cpp.x86_64 0:4.4.5-6.el6
cracklib.x86_64 0:2.8.16-4.el6
cracklib-dicts.x86_64 0:2.8.16-4.el6
crda.x86_64 0:1.1.1_2010.11.22-1.el6
cronie.x86_64 0:1.4.4-7.el6
cronie-anacron.x86_64 0:1.4.4-7.el6
cryptsetup-luks.x86_64 0:1.2.0-3.el6
cryptsetup-luks-libs.x86_64 0:1.2.0-3.el6
cups-libs.x86_64 1:1.4.2-39.el6
curl.x86_64 0:7.19.7-26.el6
device-mapper.x86_64 0:1.02.62-3.el6
device-mapper-event.x86_64 0:1.02.62-3.el6
device-mapper-event-libs.x86_64 0:1.02.62-3.el6
device-mapper-libs.x86_64 0:1.02.62-3.el6
dhclient.x86_64 12:4.1.1-19.P1.el6
dracut.noarch 0:004-53.el6
dracut-kernel.noarch 0:004-53.el6
e2fsprogs.x86_64 0:1.41.12-7.el6
e2fsprogs-libs.x86_64 0:1.41.12-7.el6
ebtables.x86_64 0:2.0.9-6.el6
efibootmgr.x86_64 0:0.5.4-9.el6
elfutils.x86_64 0:0.152-1.el6
elfutils-libelf.x86_64 0:0.152-1.el6
elfutils-libs.x86_64 0:0.152-1.el6
file.x86_64 0:5.04-6.el6
file-libs.x86_64 0:5.04-6.el6
fipscheck.x86_64 0:1.2.0-5.el6
fipscheck-lib.x86_64 0:1.2.0-5.el6
gcc.x86_64 0:4.4.5-6.el6
glib2.x86_64 0:2.22.5-6.el6
glibc.x86_64 0:2.12-1.25.el6
glibc-common.x86_64 0:2.12-1.25.el6
glibc-devel.x86_64 0:2.12-1.25.el6
glibc-headers.x86_64 0:2.12-1.25.el6
glibc-static.x86_64 0:2.12-1.25.el6
gpxe-roms-qemu.noarch 0:0.9.7-6.7.el6
grub.x86_64 1:0.97-70.el6
gtk2.x86_64 0:2.18.9-6.el6
hal.x86_64 0:0.5.14-11.el6
hal-libs.x86_64 0:0.5.14-11.el6
httpd.x86_64 0:2.2.15-9.el6
httpd-devel.x86_64 0:2.2.15-9.el6
httpd-manual.noarch 0:2.2.15-9.el6
httpd-tools.x86_64 0:2.2.15-9.el6
hwdata.noarch 0:0.233-7.1.el6
initscripts.x86_64 0:9.03.23-1.el6
ipmitool.x86_64 0:1.8.11-7.el6
iproute.x86_64 0:2.6.32-16.el6
iptables.x86_64 0:1.4.7-4.el6
iptables-ipv6.x86_64 0:1.4.7-4.el6
iputils.x86_64 0:20071127-16.el6
irqbalance.x86_64 2:0.55-29.el6
iscsi-initiator-utils.x86_64 0:6.2.0.872-21.el6
iwl6000-firmware.noarch 0:9.221.4.1-1.el6
iwl6050-firmware.noarch 0:41.28.5.1-2.el6
kernel-firmware.noarch 0:2.6.32-131.0.15.el6
kernel-headers.x86_64 0:2.6.32-131.0.15.el6
kexec-tools.x86_64 0:2.0.0-188.el6
kpartx.x86_64 0:0.4.9-41.el6
krb5-devel.x86_64 0:1.9-9.el6
krb5-libs.x86_64 0:1.9-9.el6
libblkid.x86_64 0:2.17.2-12.el6
libcgroup.x86_64 0:0.37-2.el6
libcom_err.x86_64 0:1.41.12-7.el6
libcom_err-devel.x86_64 0:1.41.12-7.el6
libcurl.x86_64 0:7.19.7-26.el6
libdrm.x86_64 0:2.4.23-1.el6
libgcc.x86_64 0:4.4.5-6.el6
libgomp.x86_64 0:4.4.5-6.el6
libgssglue.x86_64 0:0.1-11.el6
libgudev1.x86_64 0:147-2.35.el6
libnl.x86_64 0:1.1-14.el6
libpciaccess.x86_64 0:0.10.9-4.el6
libselinux.x86_64 0:2.0.94-5.el6
libselinux-devel.x86_64 0:2.0.94-5.el6
libselinux-python.x86_64 0:2.0.94-5.el6
libselinux-utils.x86_64 0:2.0.94-5.el6
libss.x86_64 0:1.41.12-7.el6
libstdc++.x86_64 0:4.4.5-6.el6
libtirpc.x86_64 0:0.2.1-3.el6
libudev.x86_64 0:147-2.35.el6
libuuid.x86_64 0:2.17.2-12.el6
libvirt.x86_64 0:0.8.7-18.el6
libvirt-client.x86_64 0:0.8.7-18.el6
libvirt-python.x86_64 0:0.8.7-18.el6
lvm2.x86_64 0:2.02.83-3.el6
lvm2-libs.x86_64 0:2.02.83-3.el6
man-pages.noarch 0:3.22-17.el6
man-pages-overrides.noarch 0:2.5-1.el6
mdadm.x86_64 0:3.2.1-1.el6
microcode_ctl.x86_64 1:1.17-4.el6
mod_ssl.x86_64 1:2.2.15-9.el6
net-snmp-libs.x86_64 1:5.5-31.el6
net-tools.x86_64 0:1.60-105.el6
netcf-libs.x86_64 0:0.1.7-1.el6
nfs-utils.x86_64 1:1.2.3-7.el6
nfs-utils-lib.x86_64 0:1.1.5-3.el6
nspr.x86_64 0:4.8.7-1.el6
nss.x86_64 0:3.12.9-9.el6
nss-softokn.x86_64 0:3.12.9-3.el6
nss-softokn-freebl.x86_64 0:3.12.9-3.el6
nss-sysinit.x86_64 0:3.12.9-9.el6
nss-util.x86_64 0:3.12.9-1.el6
openldap.x86_64 0:2.4.23-15.el6
openldap-devel.x86_64 0:2.4.23-15.el6
openssh.x86_64 0:5.3p1-52.el6
openssh-clients.x86_64 0:5.3p1-52.el6
openssh-server.x86_64 0:5.3p1-52.el6
openssl.x86_64 0:1.0.0-10.el6
openssl-devel.x86_64 0:1.0.0-10.el6
pam.x86_64 0:1.1.1-8.el6
parted.x86_64 0:2.1-13.el6
perl.x86_64 4:5.10.1-119.el6
perl-ExtUtils-MakeMaker.x86_64 0:6.55-119.el6
perl-ExtUtils-ParseXS.x86_64 1:2.2003.0-119.el6
perl-Module-Pluggable.x86_64 1:3.90-119.el6
perl-Pod-Escapes.x86_64 1:1.04-119.el6
perl-Pod-Simple.x86_64 1:3.13-119.el6
perl-Test-Harness.x86_64 0:3.17-119.el6
perl-devel.x86_64 4:5.10.1-119.el6
perl-libs.x86_64 4:5.10.1-119.el6
perl-version.x86_64 3:0.77-119.el6
php.x86_64 0:5.3.3-3.el6
php-cli.x86_64 0:5.3.3-3.el6
php-common.x86_64 0:5.3.3-3.el6
php-devel.x86_64 0:5.3.3-3.el6
php-gd.x86_64 0:5.3.3-3.el6
php-imap.x86_64 0:5.3.3-3.el6
php-mbstring.x86_64 0:5.3.3-3.el6
php-mysql.x86_64 0:5.3.3-3.el6
php-pdo.x86_64 0:5.3.3-3.el6
php-pecl-memcache.x86_64 0:3.0.5-3.el6
php-xmlrpc.x86_64 0:5.3.3-3.el6
plymouth.x86_64 0:0.8.3-22.el6
plymouth-core-libs.x86_64 0:0.8.3-22.el6
plymouth-scripts.x86_64 0:0.8.3-22.el6
prelink.x86_64 0:0.4.4-1.el6
procps.x86_64 0:3.2.8-17.el6
python.x86_64 0:2.6.6-20.el6
python-ethtool.x86_64 0:0.6-1.el6
python-libs.x86_64 0:2.6.6-20.el6
python-pycurl.x86_64 0:7.19.0-8.el6
python-tools.x86_64 0:2.6.6-20.el6
python-urlgrabber.noarch 0:3.9.1-8.el6
python-virtinst.noarch 0:0.500.5-3.el6
qemu-img.x86_64 2:0.12.1.2-2.160.el6
qemu-kvm.x86_64 2:0.12.1.2-2.160.el6
ql2400-firmware.noarch 0:5.03.16-1.el6
ql2500-firmware.noarch 0:5.03.16-1.el6
quota.x86_64 1:3.17-16.el6
redhat-release-server.x86_64 0:6Server-6.1.0.2.el6
rhn-check.noarch 0:1.0.0-61.el6
rhn-client-tools.noarch 0:1.0.0-61.el6
rhn-setup.noarch 0:1.0.0-61.el6
rhnlib.noarch 0:2.5.22-10.el6
rpm.x86_64 0:4.8.0-16.el6
rpm-libs.x86_64 0:4.8.0-16.el6
rpm-python.x86_64 0:4.8.0-16.el6
rsyslog.x86_64 0:4.6.2-3.el6
seabios.x86_64 0:0.6.1.2-3.el6
selinux-policy.noarch 0:3.7.19-93.el6
selinux-policy-targeted.noarch 0:3.7.19-93.el6
setup.noarch 0:2.8.14-12.el6
shadow-utils.x86_64 2:4.1.4.2-9.el6
smartmontools.x86_64 1:5.39.1-3.el6
sos.noarch 0:2.2-8.el6
strace.x86_64 0:4.5.19-1.10.el6
sudo.x86_64 0:1.7.4p5-5.el6
sysstat.x86_64 0:9.0.4-18.el6
systemtap-runtime.x86_64 0:1.4-6.el6
sysvinit-tools.x86_64 0:2.87-4.dsf.el6
tcsh.x86_64 0:6.17-12.el6
tkinter.x86_64 0:2.6.6-20.el6
udev.x86_64 0:147-2.35.el6
upstart.x86_64 0:0.6.5-10.el6
util-linux-ng.x86_64 0:2.17.2-12.el6
vgabios.noarch 0:0.6b-3.6.el6
vim-common.x86_64 2:7.2.411-1.6.el6
vim-enhanced.x86_64 2:7.2.411-1.6.el6
vim-minimal.x86_64 2:7.2.411-1.6.el6
virt-manager.noarch 0:0.8.6-4.el6
virt-top.x86_64 0:1.0.4-3.8.el6
virt-viewer.x86_64 0:0.2.1-3.el6
virtio-win.noarch 0:1.2.0-1.el6
vte.x86_64 0:0.25.1-6.el6
yum.noarch 0:3.2.29-17.el6
yum-metadata-parser.x86_64 0:1.1.2-16.el6
yum-plugin-priorities.noarch 0:1.1.30-6.el6
yum-utils.noarch 0:1.1.30-6.el6

Replaced:
cairo-spice.x86_64 0:1.8.7.1-4.el6
ffmpeg-spice-libs.x86_64 0:0.4.9-0.15.5spice.20080908.el6
pixman-spice.x86_64 0:0.13.3-5.el6

Complete!
(Note: yum command output is truncated)
Reboot the server:
# reboot
Verify that everything is working and new version is loaded:
# uname -a
Sample outputs:
2.6.32-131.0.15.el6.x86_64
Verify ports are open:
# netstat -tulpn
# tail -f /var/log/messages
# tail -f /path/to/log/file
# cat /etc/redhat-release

Sample outputs:
Red Hat Enterprise Linux Server release 6.1 (Santiago)

How to Add a new yum repository to install software under CentOS / Redhat Linux

CentOS / Fedora Core / RHEL 5 uses yum for software management. Yum allows you to add a new repository as a source to install binary software.

Understanding yum repository

yum repository configured using /etc/yum.conf file. Additional configuration files are also read from the directories set by the reposdir option (default is /etc/yum.repos.d and /etc/yum/repos.d.

RPMforge repository

Usually repository carries extra and useful packages. RPMforge is one of such repository. You can easily configure RPMforge repository for RHEL5 just by running following single RPM command:
# rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
For 64 bit RHEL 5 Linux, enter:
# rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Now you can install software from RPMforge.

How do I install 3rd party repository manually?

Let us say you would like to install 3rd party repository from foo.nixcraft.com. Create a file called foo:
# cd /etc/yum.repos.d
# vi foo

Append following code:
[foo]
name=Foo for RHEL/ CentOS $releasever - $basearch
baseurl=http://foo.nixcraft.com/centos/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://foo.nixcraft.com/RPM-GPG-KEY.txt

Save and close the file.
Where,
  • [foo] : Repository name i.e. The [main] section must exist for yum to do anything.
  • name=Foo for RHEL/ CentOS $releasever - $basearch : A human readable string describing the repository name
  • baseurl=http://foo.nixcraft.com/centos/$releasever/$basearch/ : Must be a URL to the directory where the yum repository’s ‘repodata’ directory lives
  • enabled=1 : Enabled or disabled repo. To disable the repository temporarily, set the enabled to 0
  • gpgcheck=1 : Security feature, use GPG key
  • gpgkey=http://foo.nixcraft.com/RPM-GPG-KEY.txt : GPL file location
Also you need to import the gpg key for the repository as follows:
# rpm --import http://foo.nixcraft.com/RPM-GPG-KEY.txt
Now you are ready to install software from foo repository. For further information refer to yum.conf man page:
$ man yum.conf
$ man yum

Hope this tip will help you to configure repository as and when required

VSFTPD cap_set_proc and dead but subsys locked errors and solution

VSFTPD is the one of the easiest and secure FTP server out there. However today it bumps back with two errors.

#1: 500 OOPS: cap_set_proc error

After successful user login vsftpd will display an error:
$ ftp ftpserver.xyz.com
Output:
Connected to ftpserver.xyz.com.
220 (vsFTPd 2.0.5)
Name (localhost:vivek): vivek
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
500 OOPS: cap_set_proc
ftp: bind: Address already in use
cap_set_proc is POSIX capability manipulation on processes function (related to filesystems but I am not sure). After searching bit I found the solution. You need to load the standard Linux capabilities security module:
# modprobe capability

#2: vsftpd dead but subsys locked error

This is another error - one of my clients was receiving while starting vsftpd. There was already ftp server running and address 21 was bind to this ftp server. So vsftpd dead but subsys locked error was generated. xinetd was configured to run wu-ftpd (quite old ftp software). Solution was simple I had removed the wu-ftpd.