Thursday, 22 December 2011

Project-OPen: "PostgreSQL is already present in this computer"/"Warning: the user postgres is already present in this computer! The installer cannot continue!"

I am trying my hands on Project-open a free open source tool for projects, time-sheets and HR maintenance.

I installed Ver 3.5 in Windows XP Machine did something and forgot it. After some days when i tried to use it the administrative password entirely skipped my mind. So i uninstalled it and again when i tried installing i faced these two errors.

 "Warning :PostgreSQL is already present in this computer ! The installer cannot continue"

"Warning: the user postgres is already present in this computer! The installer cannot continue!"

To Remove First error:

1) I used Control Panel-> Add remove program to remove project-open. I also used CCleaner to clean registry but the same error keeps coming. I used Revo uninstaller also but it showed no reference to PostgresSQL.

So i started searching registry -> Regedit-> search for "postgres" . I found four reference to postgres in windows registry.
2) HKEY_Users
3) Somewhere inside Windows
4) Somewhere in Current Version -> Profile List.

I deleted all and i got rid of first error but second started coming.

2)  To Remove second error i searched Google and found that we need to remove user from

My computer-> Manage-> Local Users and groups->Users-> delete "postgres" user

Also thorugh command promt u can delete the user by giving following command in command promp:

net user postgres /delete

After this i was able to install Project-open again.

Its there in project-open documentation also :-) got when i solved the problem :-)

Monday, 19 December 2011

Difference Between Ping and Exteded Ping ? Linux Ping Command, Windows Ping command and Cisco Ping command !!

Ping command is First step of networks. Networking means to connect many devices in same or other domain. To test the connectivity we need to use this " Ping " Command. Depending on Operating system there is slight difference in using the command, but the end result is same. We need to verify the other device is alive or not and can be accessed from the network.

The full form of Ping is (Packet InterNet Groper).

Windows Ping Command


Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
            [-r count] [-s count] [[-j host-list] | [-k host-list]]
            [-w timeout] target_name

    -t             Ping the specified host until stopped.
                   To see statistics and continue - type Control-Break
                   To stop - type Control-C.

    -a             Resolve addresses to hostnames.

    -n count       Number of echo requests to send ( Default 4)

   -l size        Send buffer size (The default is 32. The maximum size is 65,527)

     -f             Set Don't Fragment flag in packet.

    -i TTL         Time To Live.(For Windows XP hosts, this is typically 128. The maximum TTL is 255.

    -v TOS         Type Of Service.(The default is 0. TOS is specified as a decimal value from 0 to 255. )

    -r count       Record route for count hops ( The Count must be a minimum of 1 and a maximum of 9. )

   -s count       Timestamp for count hops.(The Count must be a minimum of 1 and a maximum of 4. )

    -j host-list   Loose source route along host-list.( The maximum number of addresses or names in the host list is 9. )
    -k host-list   Strict source route along host-list.(The maximum number of addresses or names in the host list is 9)
    -w timeout     Timeout in milliseconds to wait for each reply.(The default time-out is 4000 (4 seconds))

Linux Ping Command

[root@localhost ~]# ping
Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]
            [-p pattern] [-s packetsize] [-t ttl] [-I interface or address]
            [-M mtu discovery hint] [-S sndbuf]
            [ -T timestamp option ] [ -Q tos ] [hop1 ...] destination
[root@localhost ~]#


Audible ping.
Adaptive ping. Interpacket interval adapts to round-trip time, so that effectively not more than one (or more, if preload is set) unanswered probes present in the network. Minimal interval is 200msec for not super-user. On networks with low rtt this mode is essentially equivalent to flood mode.
Allow pinging a broadcast address.
Do not allow ping to change source address of probes. The address is bound to one selected when ping starts.
-c count
Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires.
Set the SO_DEBUG option on the socket being used.
-F flow label
Allocate and set 20 bit flow label on echo request packets. (Only ping6). If value is zero, kernel allocates random flow label.
Flood ping.
-i interval
Wait interval seconds between sending each packet. The default is to wait for one second between each packet normally, or not to wait in flood mode. Only super-user may set interval to values less 0.2 seconds.
-I interface address
Set source address to specified interface address. Argument may be numeric IP address or name of device. When pinging IPv6 link-local address this option is required.
-l preload
If preload is specified, ping sends that many packets not waiting for reply. Only the super-user may select preload more than 3.
Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address.
Numeric output only. No attempt will be made to lookup symbolic names for host addresses.
-p pattern
You may specify up to 16 ``pad'' bytes to fill out the packet you send. This is useful for diagnosing data-dependent problems in a network. For example, -p ff will cause the sent packet to be filled with all ones.
-Q tos
Set Quality of Service -related bits in ICMP datagrams. tos can be either decimal or hex number. Traditionally (RFC1349), these have been interpreted as: 0 for reserved (currently being redefined as congestion control), 1-4 for Type of Service and 5-7 for Precedence. Possible settings for Type of Service are: minimal cost: 0x02, reliability: 0x04, throughput: 0x08, low delay: 0x10. Multiple TOS bits should not be set simultaneously. Possible settings for special Precedence range from priority (0x20) to net control (0xe0). You must be root (CAP_NET_ADMIN capability) to use Critical or higher precedence value. You cannot set bit 0x01 (reserved) unless ECN has been enabled in the kernel. In RFC2474, these fields has been redefined as 8-bit Differentiated Services (DS), consisting of: bits 0-1 of separate data (ECN will be used, here), and bits 2-7 of Differentiated Services Codepoint (DSCP).
Quiet output. Nothing is displayed except the summary lines at startup time and when finished.
Record route. Includes the RECORD_ROUTE option in the ECHO_REQUEST packet and displays the route buffer on returned packets. Note that the IP header is only large enough for nine such routes. Many hosts ignore or discard this option.
Bypass the normal routing tables and send directly to a host on an attached interface. If the host is not on a directly-attached network, an error is returned. This option can be used to ping a local host through an interface that has no route through it provided the option -I is also used.
-s packetsize
Specifies the number of data bytes to be sent. The default is 56, which translates into 64 ICMP data bytes when combined with the 8 bytes of ICMP header data.
-S sndbuf
Set socket sndbuf. If not specified, it is selected to buffer not more than one packet.
-t ttl
Set the IP Time to Live.
-T timestamp option
Set special IP timestamp options. timestamp option may be either tsonly (only timestamps), tsandaddr (timestamps and addresses) or tsprespec host1 [host2 [host3 [host4]]] (timestamp prespecified hops).
-M hint
Select Path MTU Discovery strategy. hint may be either do (prohibit fragmentation, even local one), want (do PMTU discovery, fragment locally when packet size is large), or dont (do not set DF flag).
Print full user-to-user latency (the old behaviour). Normally ping prints network round trip time, which can be different f.e. due to DNS failures.
Verbose output.
Show version and exit.
-w deadline
Specify a timeout, in seconds, before ping exits regardless of how many packets have been sent or received. In this case ping does not stop after count packet are sent, it waits either for deadline expire or until count probes are answered or for some error notification from network.
-W timeout
Time to wait for a response, in seconds. The option affects only timeout in absense of any responses, otherwise ping waits for two RTTs.

Cisco Extended Ping Command

Router# ping
Protocol [ip]:
Target IP address: 
Repeat count [5]: 
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: 
Source address or interface: 
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:

Protocol [ip]: Prompts for a supported protocol. Enter appletalk, clns, ip, novell, apollo, vines, decnet, or xns. The default is ip.

Target IP address:Prompts for the IP address or host name.The default is none.

Repeat count [5]:Number of ping packets that are sent to the destination address. The default is 5.

Datagram size [100]:Size of the ping packet (in bytes). Default: 100 bytes.

Timeout in seconds [2]:  Timeout interval. Default: 2 (seconds).

Extended commands [n]: Specifies whether or not a series of additional commands appears. The default is no.

Source address or interface: The interface or IP address of the router to use as a source address for the probes.

Type of service [0]: Specifies the Type of Service (ToS). The default is 0.

Set DF bit in IP header? [no]: Specifies whether or not the Don't Fragment (DF) bit is to be set on the ping packet. If yes is specified, the Don't Fragment option does not allow this packet to be fragmented when it has to go through a segment with a smaller maximum transmission unit (MTU), and you will receive an error message from the device that wanted to fragment the packet. The default is no.

Validate reply data? [no]: Specifies whether or not to validate the reply data. The default is no.

Data pattern [0xABCD] Specifies the data pattern. Different data patterns are used to troubleshoot framing errors and clocking problems on serial lines. The default is [0xABCD].

Loose, Strict, Record, Timestamp, Verbose[none]: IP header options. This prompt offers more than one option to be selected. They are:

    Verbose is automatically selected along with any other option.

    Record is a very useful option because it displays the address(es) of the hops (up to nine) the packet goes through.

    Loose allows you to influence the path by specifying the address(es) of the hop(s) you want the packet to go through.

    Strict is used to specify the hop(s) that you want the packet to go through, but no other hop(s) are allowed to be visited.

    Timestamp is used to measure roundtrip time to particular hosts.

The default is none.

Sweep range of sizes [n]:Allows you to vary the sizes of the echo packets that are sent. The default is no.


Each exclaimation point (!) denotes receipt of a reply. A period (.) denotes that the network server timed out while waiting for a reply.

Success rate is 100 percent

Percentage of packets successfully echoed back to the router. Anything less than 80 percent is usually considered problematic.

round-trip min/avg/max = 1/2/4 ms
Round-trip travel time intervals for the protocol echo packets, including minimum/average/maximum (in milliseconds).

Important Points on Ping Command

1) Extended Ping works only on Cisco's platform.

2) To ping to broadcast address use Linux Ping use -b option.

3) Using Cisco Extended Ping or Linux Ping the source address can be changed.

4) Use -f option of Linux for flood ping.

5) QoS can be set using any of above ping command of OS.

6) TTL  value can be set by using Windows Ping command (- i option ) or Linux Ping command ( -t ).

7)  Linux Ping command can be used for PATH MTU discovery using option -M.

8) HostList can be given in windows ping command.

9) User-to-User Latency can be taken using Linux Ping Command -U option.

10) Timestamp for IP can be set using Linux command -T.

11) Using Linux -p command we can specify up to 16 ``pad'' bytes to fill out the packets sent.

Send me feedback/comments on

"Keep Learning , Keep sharing"

What is Time to Live ( TTL ) value in IP? TTL Value how it is used ? Tutorial on TTL ( Time to Live)

TTL is one of the most basic field on networking. Every person who has some passion to know about networks should know about this field.

The TTL is a 8 bit field present in IP header it is defined in RFC 791.

 Time to Live:  8 bits

This field indicates the maximum time the datagram is allowed to remain in the internet system.  If this field contains the value zero, then the datagram must be destroyed.  This field is modified in internet header processing.  The time is measured in units of seconds, but since every module that processes a datagram must decrease the TTL by at least one even if it process the datagram in less than a second, the TTL must be thought of only as an upper bound on the time a datagram may exist.  The intention is to cause undeliverable datagrams to be discarded, and to bound the maximum datagram lifetime.

Few Important things about TTL ( Time to Live)

1) Time to Live is measured in seconds. Its the time not the counter.the value of 1 means 1 second.

2) The two main uses of TTL : 
  •   To discard the TCP Segment or to limit the life of TCP segment ( TCP RFC 793)
  •   To prevent Routing Loop or to terminate the routing loops 
3)  It is set by the sender to the maximum time the data-gram is allowed to be active in the system.

4) This Field is decreased by every router in the path to destination network.

5) The Router should accept the data-gram even if the TTL value is "0" 

6) Only when the Router has to forward the datagram to next hop and the TTL value is found to be "zero" the router should drop the packet.

7) The router can not originate a packet with TTL value as "0"

Now answer following questions :

1) Why there is no protocol like Spanning tree protocol in Layer 3?

2) How to prevent loops in Layer 3 ?

3) Lets say we have Host PC1 at my place in India and Host PC2 at Alaska USA. Both have public IP and in between we have 500 different router. Please give a command to test the connectivity of both the PC's.

4) What is default TTL value for windows XP machine and Linux Fedora machine ?

Send your answers to Its very simple questions but i have asked them all and got wrong answers every time i ask it in interviews :-)

"Keep Learning , Keep sharing "

Thursday, 15 December 2011

How to schedule daily back of TestLink ( Test Management Tool )

We use Test Link Test Management Tool for all our Test cases management, Assignment of testcases and see the status of testing of any project.

Once the PC had crashed on which the server was running. Luckily it was some hardware problem and we were able to recover everything.  It made us think of taking daily backups, in case if something happens again.

Human nature is really very funny, we live like we are going to be here on Earth for long and we do everything , once somebody dies the realities  comes to our mind but stays there for one or two days and again we are back to normal "immortal" thinking.

Well this small piece of philosophy is because we never thought of taking backups until it was required.

So we started taking backup daily by writing a small piece of code :

1) Create backup.bat file 
Save below code in backup.bat file

REM [at] echo off

for /f "tokens=1" %%i in ('date /t') do set DATE_DOW=%%i

for /f "tokens=2" %%i in ('date /t') do set DATE_DAY=%%i
for /f %%i in ('echo %date_day:/=-%') do set DATE_DAY=%%i
for /f %%i in ('time /t') do set DATE_TIME=%%i
for /f %%i in ('echo %date_time::=-%') do set DATE_TIME=%%i

"C:\xampp\mysql\bin\mysqldump" --user=urusername --password=urpassword --databases databasename > "%DATE_DAY%_%DATE_TIME%_backupTestLink.sql"

save this file in "C:\xampp\mysql\backup\daily-backup\" Folder . "daily-backup" Folder is created by me to store these backups.

2) Start window scheduler to run this file at specific time.
               Go to -> Start-> Setting->Control Panel->scheduled Tasks-> Add scheduled Tasks-> Browse and select the file (backup.bat) , Perform this task-> Daily -> set the time-> enter username and password
and Finish.

The schedular will run at specific interval to create a backup.

3) But this still generates the backup at local PC, if something happens everything will be gone. So

Map one network folder ( another server which has shared folder ) .

Go to My computer -> Tools-> Map network drive -> give drive name ( automatically it takes the next letter. Browse the folder ( the network folder ) click finish.

Now in above script in the end put one copy command to copy the file to server folder

" copy C:\xampp\mysql\backup\daily-backup\%DATE_DAY%_%DATE_TIME%_backupTestLink.sql  Y:\TestLink-Backup "

Now the generated backup file will be present in both local as well as network server PC.

You can mail me on for any other methods/ideas.

" Keep Learning , Keep sharing "

Tuesday, 13 December 2011

What are the Ports of Root Bridge called in Spanning tree Protocol?

This is really interesting question i came across, asked by my junior whom i was explaining the STP protocol.

It has not mentioned explicitly anywhere but  we can call them "designated ports" and definitely not "root ports".

As Root ports cannot exist on root bridge, only non -root bridges can have root ports.

Designated ports exist on the segment  that connect any switch to root bridge through the lowest cost . So through this port only the down link switch is getting connected to the root bridge.

Hope it is clear.

Keep Learning , Keep Sharing !!!

Script to Do continuous FTP from windows client to FTP server

This is to put continuous loop to ftp server which can be Linux FTP server or windows based FTP server like Fillezilla.

First Method to start continuous FTP loops to FTP server:

On Client:

1) Make one TXT file which contains the following information:

open ftpserveripaddress
put filename

Save it as ftpputloop.txt

2) Open Command prompt and go to the directory in which the file is saved.

Give below command :

c:\> for /L %i IN (1,1,99999999999) DO ftp -s:ftpputloop.txt

This command will continuously gets repeated and do FTP put.

You can do similar for ftp get also.

Sunday, 11 December 2011

How to run Continous Telnet from windows PC to Linux Telnet Server

Note : The Telnet server should be working properly in Linux.

To run continuous Telnet on Linux Server , create a file "telnetloop" file in linux:

The file should have following information:

while true
ls -laR

Now change the permission of the file using command "chmod +x telnetloop"

From windows machine now do telnet to the Linux machine, login with username and password.

Now run the script using command ./telnetloop

Wednesday, 7 December 2011

What to do if Telnet is not working for Root, How to telnet as Root user ?

In our lab we need to run telnet using root. Well in real environment its not good idea but for lab purpose we wanted it. Even though we enabled Telnet server and on local PC the telnet was working, remotely it was not allowing. After some online "googling"  the issue got resolved by commenting following line in remote file:

 open :  vi /etc/pam.d/remote

#auth       required

Why we hate to share our knowledge ?

Yesterday i came across a classic case of " I know but i won't tell" type of people. I met this person and he said that i have spent hours understanding them why i should tell you? And i thought " Typical Indian Mentality" Well I live in India and I am an Indian ,so i felt hurt from my own comments, and it let me think " Why we Indians does not want to share our knowledge". I have interacted with other countries professionals and they seem to be understanding and never fear to share their knowledge.

I did some analysis and came out with three categories of people:

1)  First category are of those who says that they know the answer but actually they does not know the answer.

2) Second category are of those people who had struggled a lot in their life to reach the position in which they are now , and they think that by sharing their knowledge with others they will be left behind.

3) Third are really genius and intelligent people who thinks that "others" should do proper research or at-least try to find the answer on their own first, before asking them.

My classic case comes in second category and i could map almost all cases in one of these categories.

My view with proper disclaimers :-)

" Sharing your knowledge with others does not decrease you knowledge but increases it by leaps and bounds" When we share/ discuss with others we come across many questions which helps us to understand the issues and the topics more clearly.

Body will go but the mind/ thoughts/ knowledge shared by each one of us will remain forever in one form or the other.

So "Keep Sharing and Keep Learning "

Monday, 5 December 2011

What is difference between Throughput Test and Frame Loss test ( RFC 2544 and RFC 1242)

Yesterday i came across this question  while some were performing these tests.  We know that for any networking device the "Throughput" is very important. The throughput claimed by vendor to vendor is different so there is one RFC which guides the method to be used to measure the throughput . The RFC is 1242 (Benchmarking Terminology for Network Interconnection Devices) and RFC 2544 (Benchmarking Methodology for Network Interconnect Devices)

The RFC 1242 gives all the definitions  or the terminology for the devices and the 2544 RFC explains the method to be used to measure some of the key parameters. In all it covers below tests:

1) Throughput
2) Latency

3) Frame Loss
4) Back to Back
5) System Recovery

6) Reset

I would recommend everyone who is performing anything related to performance tests should go through these RFC's.

One important point is the trail duration for which the tests is to be run. The trail duration varies and i have seen using very less trial duration and quoting the values. The RFC recommends trail duration of 60 second for tests which uses binary search like throughput tests and frame loss tests. If you use less trail duration obviously you will get more throughput which may not be accurate.

Ok so now back to both the tests . Lets see what is throughput and frame loss of the device as per RFC 1242 and RFC 2544:

Throughput: The maximum rate at which none of the offered frame 
are dropped by the device.

Frame Loss Rate: Percentage of frames that should have been forwarded
                by a network device under steady state (constant)
                load that were not forwarded due to lack of

26.1 Throughput

   Objective:  To determine the DUT throughput as defined in RFC 1242.

   Procedure:  Send a specific number of frames at a specific rate
   through the DUT and then count the frames that are transmitted by the
   DUT. If the count of offered frames is equal to the count of received
   frames, the fewer frames are received than were transmitted, the rate
   of the offered stream is reduced and the test is rerun.

   The throughput is the fastest rate at which the count of test frames
   transmitted by the DUT is equal to the number of test frames sent to
   it by the test equipment.

26.3 Frame loss rate

   Objective:  To determine the frame loss rate, as defined in RFC 1242,
   of a DUT throughout the entire range of input data rates and frame

   Procedure:  Send a specific number of frames at a specific rate
   through the DUT to be tested and count the frames that are
   transmitted by the DUT.  The frame loss rate at each point is
   calculated using the following equation:

          ( ( input_count - output_count ) * 100 ) / input_count

   The first trial SHOULD be run for the frame rate that corresponds to
   100% of the maximum rate for the frame size on the input media.
   Repeat the procedure for the rate that corresponds to 90% of the
   maximum rate used and then for 80% of this rate.  This sequence
   SHOULD be continued (at reducing 10% intervals) until there are two
   successive trials in which no frames are lost. The maximum
   granularity of the trials MUST be 10% of the maximum rate, a finer
   granularity is encouraged.
So if you Observe that both are saying almost similar thing, we need to
find a rate where there is no frame loss. 
Both uses binary search to find the rate. ( depends on vendors test devices ) 
Both gives you result where no frame loss is observed. 

so what is the difference between the two ?

The difference is only in the interpretation of the result and the way the 
tests is performed. I could find following differences :
1) The trial duration for throughput tests should be 60 sec(recommended),
2) Frame loss test is based on configurable total no of frame transmitted at max rate.
   Throughput test the calculation of frames is based on the rate configured. 

3) Generally Frame loss rate and passed throughput rate will be same with very 
 less difference and it is because on the duration for which the tests are run.
4) Frame loss test can give you results, which tells that at that particular rate 
what is the frame loss. 
5) Frame Loss test comes when there are routing priorities,sequenced flow is 
 important and congestion is present in network. 
In  Normal scenarios The results for both the tests are same.