Tuesday, May 18, 2010

CentOS 5.5 USB Device Mounting Annoyance

What do you expect the next version of your favourite distribution to be? Better or worse. For me upgrading CentOS 5.2 to 5.5 became a worse experience. I was running CentOS 5.2 on my office workstation (Dell Optiplex 360) for long. Never really needed/worried to upgrade cos it was only a work station, I mean no play, only work. However, of late I wanted to pull in some multimedia stuff from rpmforge (that's not available in official CentOS repo). At the same time I thought of upgrading the system also. And I went ahead... Read below for the annoyances.

The fully upgraded system now has two kernels - kernel-2.6.18-92.el5 (original CentOS 5.2 kernel) and kernel-2.6.18-194.el5 (came with CentOS 5.5 upgradation), menu.lst points to the latest kernel as default boot options.

1. Annoyances with the new kernel: Running the new CentOS 5.5 kernel was fast, responsive... audio/video worked like a charm. But oddly enough I am unable to mount any USB drives (specially the ones with sdhc cards such as phones and cameras); lsusb does show make of the device and its id, but refuses to automount it. Even doesn't accept manual mounts.

2. Newly surfaced problem with the old kernel: After being unable to mount usb devices I rebooted the system to run the old kernel. To my surprise, the old kernel automounted all the usb drives that I threw at it. But, sadly, alsa sound server did not work the way it should. It was working fine before upgradation.

Solution: I wandered across dozens of forums for a solution and could not get any. Now I've to boot to the old kernel when I need to use USB drives, otherwise, the default 2.6.18-194.el5 kernel handles everything quite well.

Please comment to this post if you have a solution for this weird problem.

Sunday, May 16, 2010

Debian + Backports is Better than the Latest Ubuntu

Debian Stable has a bad reputation of being little obsolete. It's never able to catch up with time. For example, at the time of writing this post, Debian 5.0.4, Lenny is still sticking to the old Iceweasel 3, OpenOffice 2.4, 2.6.26 kernel line and some other vital packages, whereas the package versions are greatly updated in the so called popular Linux distributions such as Ubuntu, Fedora and OpenSuse. Some critics even say that this late-to-party nature of Debian is the reason for Ubuntu to show up in the Linux crowd.

But I don't buy to the view that Debian Stable is outdated. If you are running a server this much older packages and slow updates are a blessing. Moreover, you can catchup to the latest and greatest packages even on desktop. All you need is to add debian-backports to your /etc/apt/sources.list. A mix of Debian stable and Debian Backports will bring you all the popular packages. Here is the content of my sources.list

manmath@debian:~$ cat /etc/apt/sources.list
deb ftp://ftp.debian.org/debian/ lenny main contrib non-free
deb http://security.debian.org/ lenny/updates main contrib
deb http://www.debian-multimedia.org/ lenny main non-free
deb http://www.backports.org/debian lenny-backports main contrib non-free

With the above repo list I am able to run Debian stable and work on OpenOffice 3.2, Iceweasel 3.5, Pidgin 2.6.6, Kernel 2.6.32 and many other packages. Besides, Debian stable is supported by Google Chrome, Skype and a majority of other linux software vendors such as Softmaker and Codeweavers. The only caution you should take is to pick out single backports which fits your needs, and not to use all the packages from backports repo.

For example, if you need to install the latest iceweasel from backports just enter:

apt-get -t lenny-backports install iceweasel

I've always found Debian Stable+Backports to be more stable than the latest Ubuntu. What's more, with backports configured you can get the latest versions of popular packages.

Monday, April 26, 2010

Airtel GPRS Internet on Your Linux PC through USB Cable

Internet through GPRS is not a joyride, but you might need it during some bad times when your ISP is down, broadband cabling in your area is messed up, or you are on the move. In such circumstances you may pair your mobile phone with your pc and easily get connected to the Internet. Here are some details on how to get internet working on your pc using GPRS in your Airtel Mobile Phone.

First, you need to active GPRS on your Airtel mobile phone. Dial  *567*11# to activate gprs and dial *567*13# to get mobile internet. Usually Airtel (or any other mobile service provider) will send settings which you will have save/install on your mobile phone. After that you should recharge your prepaid Airtel mobile phone with Rs. 98/- (as of 27th April, 2010) to get unlimated GPRS internet access for one month.

Next, you need to install ppp and wvdial on your Linux PC. Then change your /etc/wvdial.conf file to read:

[Dialer Defaults]
Init1 = AT+CGDCONT=1,"IP","airtelgprs.com","",0,0
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
stupid mode = 1
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyACM0
ISDN = 0
Phone = *99#
Password = manmath
Username = manmath

(You might change the Username and Password the way you like, the above is just an example)

Additionally you should also consider adding the following few lines to your /etc/sysctl.conf as a root user. It will reduce packet transfer overhead considerably.

net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_sack = 1
net.ipv4.tcp_no_metrics_save = 1

That's it! Now connect your Airtel Mobile phone to your PC through USB cable, and as a root user (su or sudo, whatever appropriate in your case) enter wvdial in a terminal. And lo! You are connected to the web. If you want to connect to web as a non-root user, follow this link for further instructions.

You can also use Airtel SIM in your USB modem and connect to the Internet. For this you will have to use "Modem=/dev/ttyUSB0" in place of "Modem = /dev/ttyACM0" in your /etc/wvdial.conf

Wednesday, April 21, 2010

At Last RHEL 6 Beta Shows Up

Finally, Red Hat Enterprise Linux 6 Beta is here. The Beta is a big transition from RHEL 5 in terms of core packages, desktop environments and applications. “Red Hat Enterprise Linux 6 blurs the lines between virtual, physical, and cloud computing to address shifts taking place in the modern IT environment. Featuring updated core technology, from the kernel to the application infrastructure to the development toolchain, Red Hat Enterprise Linux 6 is designed to meet the needs of the coming generations of hardware and software technologies......” However, if you consider the package version status of the RHEL 6 final (when it comes) with contemporary distributions, it will still be little orthodox, as always.

The Red Hat Enterprise Linux 6 Beta is available on the following architectures: i386, AMD64/Intel64, System z, IBM Power (64-bit)." Read the release announcement and the press release for an overview of the most notable features.

Monday, April 19, 2010

Welcome PCLinuxOS 2010

Good news for all who are looking for a Mature "Just-Works" Desktop. PCLinuxOS 2010 bandwagon is released. This time Tex and the Gang has offered 7 releases:   Main KDE Desktop, KDE MiniMe Desktop, Gnome Desktop, Gnome ZenMini Desktop, LXDE Desktop, XFCE Desktop and Openbox Desktop.

PCLinuxOS 2010 Main KDE edition features Kernel 2.6.32.11-bfs kernel (for maximum desktop performance) and full KDE 4.4.2 Desktop. PCLinuxOS includes all of the latest popular applications such as Firefox 3.6.3, Thunderbird 3.0.4, Dropbox for online backup storage, Pidgin 2.6.6,  Kymoney, Ktorrent, Gimp, Digikam, Amarok, Smplayer and much much more. In addition there are over 12,000+ additional packages available from our software repository.

As always there is support for Nvidia and ATI fglrx drivers. Many new wireless cards and printers are supported as well. Plus 2010 release is able to play the popular multimedia. Other versions (Gnome, Zen, LXDE...) have got the respective latest desktop environments and applications.

Download PCLinuxOS 2010

Monday, April 12, 2010

How to Make GTK Apps Look like KDE on a KDE-only Desktop

KDE4 is eye-candy. But most of the distributions that bundle it are not that stable or usable. Here I don't talk about PCLinuxOS 2010 or Mepis 8.5. They have done a great job in their implementation of KDE 4. But there are a lot others.

Well, coming to the point.... Of late I planned to install a KDE-only Debian desktop on a custom-made system. It was meant for somebody very new to Linux. That's why I thought of good old KDE 3 and the most stable distro of our times - Debian Lenny. Lenny installed a fully-functional KDE desktop on that machine (PIV on Intel 945 mobo) quite well. Afterwards I made some tweaks on the system so that my friend could easy plug his ntfs external drive, web cam, use his stock DVDs, windows media files and so many other non-free stuff. Again after configuring debian-multimedia it was easy as always.

KDE 3.5.9 on Lenny worked like a charm - quite responsive while carrying a truck load of kde apps. But those gtk apps looked butt-ugly on a kde-only environment. Here is a screenshot of how a gtk app looks on a debian pure kde desktop.


As you see, the look of apps is not consistent. Thank God, there is gtk-qt-engine package in Lenny repo. I installed this package and configured in kcontrol (kde control center) as shown below. And Lo! Upon reboot I got consistent KDE look across kde and gtk.

If you are also a KDE-lover but can't do without some gtk apps gtk-qt-engine is the way to go.

Here is the screenshot of Avidemux after installing gtk-qt-engine.

Monday, March 15, 2010

Linux Desktop: Running WvDial without Root Permission

wvdial without root permission in linuxWvDial in combination with PPP is the best dialup internet solution for any Linux Desktop. There are a couple of ppp-frontends such as gnome-ppp and kppp for dialup internet access, but none are as versatile, configurable and intelligent as WvDial. However, the biggest turndown in WvDial is - it asks for root permission (except Mepis, Warren has done wonders to Mepis wherein you just have to enter wvdial, no need to be root at all). Everytime you need to do su or sudo wvdial and enter root password, it's a pain for no perceivable gain. Fortunately, you can get rid of it following a few simple tweaks.

1. Install ppp and wvdial using your distribution's repository. Let the package manager pull-in all the dependencies.
2. Generate/configure valid wvdial.conf file in /etc
For my idea net setter edge-enabled Huawei wireless modem I had to customize my wvdial.conf as mentioned below.

[Dialer Defaults]
Modem=/dev/ttyUSB0
Baud = 115200
Init 1 = AT+CGMM
Init 2 = AT+CMEE=1
Init 3 = ATE0
Init 4 = AT^HS=0,0
Init 5 = AT+CFUN?
Init 6 = AT+CLCK="SC",2
Init 7 = AT+CPIN?
Init 8 = AT+CLCK="SC",2
Modem Type = USB MODEM
Phone=*99#
Username = 9990146746
Password = 6746
New PPPD = yes
Dial Command=ATDT
Stupid Mode=1
ISDN=0

3. Open terminal, be a root user (su or sudo) and do:

adduser USERNAME dip
adduser USERNAME dialout

where USERNAME is your userlogin name.

4. Locate pppd (generally it's /usr/sbin/pppd) with root permission run the following commands in a terminal

chmod o+x pppd
chmod g+s pppd

5. Finally, change permissions of pap-secrets and chap-secrets

chown USERNAME /etc/ppp/pap-secrets
chown USERNAME /etc/ppp/chap-secrets

You're done!

Now open a terminal and run wvdial as a non-previleged (non-root) user.

running wvdial without root privilege

Tuesday, March 9, 2010

PCLinuxOS 2010 Rocks Even in the Beta Stage

PCLinuxOS 2010 Beta

The wait is over! Tex and the Rippers announced PCLinuxOS 2010 on 6th March, 2010. Final iso is very close.

PCLinuxOS-2010.beta1 has gathered all the goodies: latest 2.6.32.8 kernel with BFS scheduler, full ext4 support, KDE 4.4.1 SC and the latest applications. Besides, users having more than 4Gig of RAM can pull in a PAE kernel from the repo.

In many ways pclos 2010 is a big leap/rewrite for faster startup, better hardware detection/configuration and consistent/unified look across KDE/GTK2 themes. 2010 edition carries plymouth bootsplash and speedboot technology. Needless to say, it still bears the tex-stability and -usability, the halmarks of this distro.

I am using the beta for last 3 days and not experienced a bit of problem till now. You can use it too though the official suggestion is to use its final.

Please visit www.pclinuxos.com for more.Link
Some Download links:
http://distro.ibiblio.org/pub/linux/distributions/texstar/pclinuxos/live-cd/english/preview/pclinuxos-2010-beta1.iso
http://ftp.heanet.ie/pub/pclinuxos/live-cd/english/preview/pclinuxos-2010-beta1.iso
http://ftp.sh.cvut.cz/MIRRORS/pclinuxos/live-cd/english/preview/pclinuxos-2010-beta1.iso
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/pclinuxos/live-cd/english/preview/pclinuxos-2010-beta1.iso

Size: 693.91 mb
md5sum – c027f63d211304059b522433e2a48a16

Wednesday, February 17, 2010

Is RHEL5 the New XP of Linux World?

red hat enterprise linux 6 delays releaseIf you blamed Redmond for the late release of Vista (almost 6 years after XP) then think again, Red Hat Enterprise Linux 5 is the new XP of Linux World. And the same user-reaction is building towards it.

As per official documents Red Hat declares of following a 18-24 months release cycle. Red Hat Enterprise Linux 5 was released on 2007-03-14, and it's about 3 long years now, still there is no official announcement. The question here is how long will Red Hat possibly stick with 2.6.18 kernel line and the contemporary packages. The present status of Red Hat Desktop is a stable but obsolete distribution.

Of course, the server side story of big corporates is different. They would still stick to the standardized and stable base - RHEL5. Though Red Hat does not make it explicit, seems it only aims for servers in big corporates. Even its desktop offering is meant for biggies only. Had it at all aimed at a general desktop, we could have seen a major release sometime in 2009.

Linux desktop has made some great jumps over the past three years. There have been KMS, CFS, the new 2.6.31 desktop oriented kernel, virtualization and a lot more in terms of userspace and application program updates. Interestingly late-to-the-party Debain is catching up with these developments. But Red Hat...

1. Is Red Hat finding it difficult to maintain 4 releases at a time, that's why the delay in RHEL 6?
2. Has it changed its release plans (without making it public) and preferred a feature-based release to a time-based release.
3. Are the corporate clients too happy with RHEL 5 (like XP) and there would be no pleasant acceptance of a new release?
4. Or Red Hat aims only for Servers and RHEL 5.4 serves that purpose best and there is no need for a release?

Visitors, please post your comments on RHEL6 here.

Tuesday, February 16, 2010

Why Should You Compile Your Kernel and How

If you are running Mepis, Mint, PCLinuxOS or other desktop oriented distribution, and your installation detects all your devices and works perfectly fine, you don't need to waste your time compiling you own kernel. That's what I had mentioned earlier in this blog.

But sometimes you may require to add/remove some features, drivers or change some settings, then you should go for compiling your own. Take my case for example. A week ago, I had to setup a home desktop for a total noob (doesn't know L of Linux). He was just interested in running a system that works after some initial configuration. He is not supposed to do updates, any sort of fixing and he is connected to web on his desktop through broadband. After much thought I settled on installing a customized Debian Lenny that would just work without any hitch or instability.

And I set on to recompile a kernel totally meant for boosting desktop performance. I prepared a .config file shedding every bit of unnecessary components and some setting changes. They are:

1. Changed kernel to "Low Latency Preemptible for Desktop" (Debian kernel is optimized for server, you can't change it even if you choose a desktop install), it's a must for desktop kernels
2. Changed Processor type to "Core2Duo or Newer" (my friend has a core2 machine)
3. Removed support for almost hundreds of drivers for old/legacy and modern devices, except for those which are built into that desktop
4. Removed support for unnecessary block-devices, esoteric filesystems, etc.
5. Changed memory settings
6. Removed ipv6 support
7. Tweaked CPU scaling features

How Did I Compile it

First I installed the following packages

#apt-get install kernel-package ncurses-dev bzip2 module-init-tools initramfs-tools procps fakeroot zlib1g-dev libgtk2.0-dev libglib2.0-dev libglade2-dev

Checked the kernel version using the following command

#uname -r

Downloaded linux source matching the version of installed kernel from Debian repository. The reason behind it is that you can modify the .config file and the recompiled kernel will integrate well with the existing set of userspace packages and applications. Of course you can put a newer or older kernel source for recompiling. But then, you should be more cautious while creating a .config file through "make menuconfig".

Whether newer or older kernel source, try to pull that from your distribution repository. It's will suit better and it may bear some patches specific to your distribution.

Copied source to newly created folder

#cp /usr/src/linux-source-2.6.26.tar.bz2 ~/newkernel/

Extracted the source and moved to the sources directory

#tar xjf linux-source-2.6.26.tar.bz2
#cd linux-source-2.6.26

Then copied a working template for the kernel .config to this directory. You should do this unless you want to drastically change the kernel .config file.

#cp /boot/config-$(uname -r) ./.config

Checked processor (it'll be useful in choosing cpu type and settings)

#cat /proc/cpuinfo

Configured kernel options (Don't change settings aggressively if you don't know what you are doing)

#make menuconfig

Now cleaned the bed for real work

#make-kpkg clean

Then started the real compilation

#make-kpkg --rootcmd fakeroot --initrd --revision=dev.1 kernel_image kernel_headers

Note:
1.You can change “dev.1” with yours.
2.You may skip building “kernel_headers” if you don't need to build kernel modules


Then moved to the directory where I had freshly cooked kernel images.

#cd ..

Installed .deb package using the following command

#dpkg -i *.deb

After installation, I checked the menu.lst and /boot directory to ensure the initrd, vmlinuz files are properly created and linked in the grub menu.

Benefits of this compilation:
1. My custom kernel weighed just 8MB.
2. It takes 8-10sec less to boot
3. The desktop feels snappier than the default Lenny Desktop install
4. It takes much less memory and resources.
5. The boot screen is quite neat even in verbose mode.

The above procedure works well on Debian Lenny and Mepis 8. You might have to google the web for more appropriate help relevant to your particular distribution.

How about this