user-avatar
Today is Saturday
November 23, 2024

Tag: tech

December 7, 2009

svn commit error

by viggy — Categories: tech — Tags: , , , Leave a comment

I wanted to commit to a repository but whenever i tried the “svn commit” command. I was getting the following error.
svn: Server sent unexpected return value (500 Internal Server Error) in response to MKACTIVITY request for’ ‘
Well I did not understand what the error was till i checked the svn info.
The error was because I had checked out the code using http protocol and hence I had not been authorized to commit. So what I did was checkout the code again using https protocol.
However my senior told me that the right way is to do “svn switch”.

svn switch NEW_URL

December 1, 2009

Get all your Gmail Contacts in Thunderbird Address Book

by viggy — Categories: tech — Tags: , , , , Leave a comment

Thanks to this post, I found a addon of thunderbird which synchronizes all your contacts of gmail with thunderbird address book.

Here is the link for the addon

https://addons.mozilla.org/en-US/thunderbird/addon/7307

November 12, 2009

a shell script to check if a ipaddress is taken using ping

by viggy — Categories: tech — Tags: , , , Leave a comment

With the help of Abhas Bhaiyya, I could write this shell script which checks if an ipaddress can be pinged.

#!/bin/sh

if [ `ping -c1 192.168.31.31 >/dev/null; echo $?` -eq 1 ]
then
echo “not able to ping”
fi

/dev/null is used here so that the output of the ping command is not compared with 1.
$? gives out the return code of the command.

November 12, 2009

how to get the last argument from the last command in the shell

by viggy — Categories: tech — Tags: , , , , Leave a comment

‘!$’ is the right answer.

For example: $vim test.pl
$chmod +x !$
$./!$

So what is happening above is
first vim test.pl opens a file.
then after you have written a perl script, you would like to make it executable. There is no need for you to specify the file name again. You can just use !$.
In the third command again to execute the file, there is no need to mention the file name again. You just use !$ again.

November 10, 2009

Postal to the rescue.

by viggy — Categories: tech — Tags: , , , Leave a comment

Postal is used to benchmark SMTP servers.
I am using it so that I can send mails continously to my test server and hence check if it is working properly. Hence this saves me from the pain of composing mails everytime I do some changes in the server and check if the changes I made is what I intended.

All I have to do is execute one command given below.

postal -m 100 -f test -t 5 192.168.31.100 users_mail

users_mail has the list of all the users in my test server.

November 9, 2009

Using sed

by viggy — Categories: tech — Tags: , , Leave a comment

How to use sed command to remove lines from a file which match a particular pattern.

sed ‘//d’ file-name > tmp

This command will delete all the lines from the file which match the pattern and then store the contents in the ‘tmp’ file.

How to use sed command to substitute strings which match a pattern and then replace it with another string?

sed -e ‘s///’

This command is to match a string and replace it with another string. The new contents of the will be stored in

How to use a pattern matched in sed command also in the replaced string?

Use & to substitute the matched string.

November 3, 2009

one line perl command to get the @INC array

by viggy — Categories: perl, programming, tech — Tags: , Leave a comment

Below is a one line command to display all the entry in @INC array which contains the paths where perl programs looks for perl modules.

perl -e ‘foreach $_ (@INC){ print $_,”n”};’

November 3, 2009

To allow forwarding of a port in the server

by viggy — Categories: tech — Tags: , , , Leave a comment

Well I needed to forward port 587 in my server so that Thunderbird installed in my local desktop could send mails through gmail account.
Here is how I did it.

iptables -I FORWARD -p tcp –dport 587 -j ACCEPT

What the above command does exactly is writes a (-I) inserts a new rule in the FORWARD chain which (-j) ACCEPTs all packets following (-p) tcp protocol and (–dport) destination port 587

October 29, 2009

Fatal error : Call to undefined function: ldap_connect()

by viggy — Categories: drupal, tech, web — Tags: , , , , Leave a comment

I got this error when I was trying to get my drupal installation authenticate using the local ldap directory. Initially, I had thought that I was getting error because of my ldap settings. Then I enabled error reporting on my site, that is when this error was displayed to me.

This error is caused, I suppose due to the missing package php5-ldap in the system. After I installed this package using apt-get and restarted apache2, LDAP authentication wroked fine.

October 29, 2009

The White Screen of Death (Completely Blank Page) in drupal

by viggy — Categories: drupal, tech, web — Tags: , , , , Leave a comment

Occasionally a site user or developer will navigate to a page and suddenly the page content disappears, and is completely blank. No content. No errors. Nothing. This often, but not always, happens after updating a module, theme, or Drupal core. This is what is referred to by most members of the Drupal community as the White Screen of Death or WSOD. There are several reasons why this might occur, and therefore several possible solutions to the issue.

For how to solve this problem, look here.