Technology Weblog

Archive for the ‘linux’ Category

Repair Corrupt RPM databases

March 12, 2009

Sometimes RPM databases become corrupt. You will no longer be able to install/upgrade/remove programs using YUM or RPM command. Even RPM quey simply gets hung. This is the case when you need to repair RPM databases. You can use the simple script to do it. cp -pr /var/lib/rpm{,`data +%F`.bk} rm -f /var/lib/rpm/__db* rpm -vv –rebuilddb […]

Happy New Year 2009

January 1, 2009

Happy New Year to all !!!

Disabling the annoying system beep in Linux !

July 28, 2008

System beeps every time you press the backspace key one too many times, or just using emacs, can be quite disturbing. To shut them off: Just open your .bashrc file. vi ~/.bashrc and add the following xset b off xset b 0 0 0

Preventing man page contents from getting cleared

June 19, 2008

man pages are great help for learing new commands in *nix systems. There will be hardly any unix user who have not used it . When learning about new commands or options of commands using man pages it is a annoyance that man page contents get cleared on quiting man. We can change this behiavior […]

Cool trick to navigate directories using cd !

March 4, 2008

Everyone using Linux will like to use it to navigate easily between directories. Add the following code into .bashrc file. Now you can navigate foward and backward using cd ] and cd [ . Cool ! __COUNT=0 __BACK=0 cd () { if [ “${1}” = “[” ]; then if [ “${__BACK}” -lt “${__COUNT}” ]; then […]

Howto reset root password for a linux machine

February 21, 2008

Consider the case you forgot the root password of your Linux machine. Don’t panic ! You can reset it easily entering single user mode . Following are the run levels in linux. Runlevel 0: Halt System – To shutdown the system Runlevel 1: Single user mode Runlevel 2: Basic multi user mode without NFS Runlevel […]

Running PHP4 and PHP5 concurrently.

January 18, 2008

Running PHP4 and PHP5 There are many times when we need PHP4 and PHP5 to run concurrently on the server.In such cases we can Install one as apache module and other as CGI Install PHP4 or PHP5 as apache module. Lets install PHP5 as apache module Download PHP5 untar it and move to its directory. […]

Quick Keyword search using Firefox !

January 13, 2008

Most of the websites have site specific search (eg: We can use the keyword option in Firefox for quickly searching such websites. 1. Visit the website we need to search using Firefox.( For example or any site having search option ) 2. Right click within the search box. 3. Select “Add a Keyword […]

Enabling spell checking for bash

December 27, 2007

shopt is a built-in command that controls shell behavior. In order to customize our shell environment we add the shopt commands to our .bashrc file. shopt -s cdspell This will correct the typing mistakes for cd command. eg: We need to go to directory testing/default. But by mistake type # cd tesring/default testing/default Since we […]

Perl commandline search and replace

December 22, 2007

There are many times when we need to search and replace certain words from files. Doing it manually will be very time consuming. One way to do it is using VI ( my favorite editor !) search n’ replace. The better option is using perl command line search and replace option. The syntax is the […]