Thursday, January 30, 2014

Apache server shows Connection time out in browser after installation in CentOS

After installing httpd in CentOS, webpage will not load by default

This is because of the iptables

run below command to solve the issue

# /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

# service iptables restart
 
That should do the trick!!!

Thursday, June 6, 2013

Upgrade SVN in Ubuntu 12.04

Follow below steps to Upgrade svn from 1.6 to 1.7

# echo "deb http://opensource.wandisco.com/ubuntu lucid svn17" | sudo tee /etc/apt/sources.list.d/svn.list
# sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
# sudo apt-get update
# sudo apt-get install subversion

That should do the trick!!

Thursday, January 3, 2013

Append shell commands to history immediately

 When working with multiple terminals you can always face ssh timeout which will result in loss of command history of the particular session.

To prevent this, Add below line in "/etc/bash.bashrc" file

export PROMPT_COMMAND='history -a'

After logoff login, every time a shell command runs it will be immediately stored in history file.

That should do the trick!!!

Enable Timestamp in bash history for all users

Time Stamp in Linux history can save you from many tight corners.

To enable this, please add below line to "/etc/bash.bashrc" file

HISTTIMEFORMAT="%d-%h-%Y %T "

Logoff login will enable time stamp in history like below example

57  03-Jan-2013 07:15:22 history

That should do the trick!!!

Tuesday, July 3, 2012

Add Prefix or Suffix using Notepad++

Notepad++ is a great text document editor.

When a prefix or suffix need to be added to all lines in a text document, search and replace function of Notepad++ can be used.

Check out the image which shows how to do this.


In Find What enter "^(.+)$" without the quotes, in replace with column enter "<Prefix>\1" to add prefix or "\1<Suffix> to add suffix. Where <Prefix> and <Suffix> are the data you want to insert.

Also, make sure to keep the search mode in "Regular expression"

That should do the trick!!!

FTP Users with /bin/false shell not able to login to ftp site

It is common to have user shell under "/bin/false" to restrict ftp users from logging through SSH

It also prevents the user from logging in to ftp also. This can be solved by following below steps.

# vi /etc/pam.d/vsftpd

auth   required        pam_shells.so (Comment this line by adding a "#" in the front)

That should do the trick!!!

Friday, April 6, 2012

Unable to Add Printer in Windows XP

When trying to add a printer you receive a error "Unable to add printer. Operation could not be completed" Error and you receive error 126 in event log for these instance.

Solution:

In "Printers and Faxes" remove all printers and go to File menu, select Server Properties.

In Server Properties, open drivers tab and delete printer drivers

Stop Print Spooler Service.

Then go to %windir%\system32\spool\drivers\w32x86\3 directory

Backup the directory and remove all files and folders inside it

Start Print Spooler Service

Now you will be able to add printers.

If you  have problems with adobe PDF printer after following above steps, copy files related to adobe pdf from backup in the %windir%\system32\spool\drivers\w32x86\3 directory.

That should do the trick!!!