Archive for July, 2008

How to use Secure Shell (SSH)

July 30, 2008

Secure shell (SSH) is a replacement for telnet. telnet uses plain text protocol so a man in the middle can see what is being exchanged between client and server including sensitive information like passwords. A more sophisticated hacker can even hijack your connection. Read more in “How to use Secure Shell (SSH)” article at Techpulp.com.
Complete [...]

Seemless directory navigation in bash

July 30, 2008

It is time (and brain) consuming to remember and type the directory path if you require to move across directories frequently. You can save some time and energy with three in-built commands supported by bash. They are pushd, popd and dirs. Read more on this in “Seemless directory navigation in bash” at TechPulp.com
Full Article

Find how long a command takes to run

July 30, 2008

Some times it is required to know how long a command is taking to execute especially in case of huge scripts. There is a command called time which can be used to determine the time taken by a command or a script. Read more in “Find how long a command takes to run” article at [...]

PHP Page Redirection

July 30, 2008

This article explains how to redirect to another page using PHP. You can use header function in the beginning of PHP script to inform browser about page redirection. Read more in “PHP Page Redirection” article at TechPulp.com.
http://techpulp.com/?p=29

Find peer IP address and port number using getpeername

July 12, 2008

The getpeername function can be used to retrieve the peer IP address and port number on a given socket. For this to work, the socket should have a valid TCP connection established. Typically this is used by server to find the IP address and port number of client. Read more in “Find peer IP address [...]

Find local IP address and local port number using getsockname

July 12, 2008

The getsockname function can be used to find the local port used by a given socket. It is valid to use this function only if the socket is already using a local port number. i.e A server socket which invoked bind system call with zero as port number. A client socket which has established connection [...]

Resolve “Address already in use” error with socket bind

July 12, 2008

To get rid of Address already in use” error with bind system call, SO_REUSEADDR socket option should be set before invoking bind. This makes operating system to allow the socket to bind if there is no active socket bound to the requested address and port. See code example in Resolve “Address already in use” error [...]

Linux file compression tools/utilities

July 12, 2008

Linux has various types of compression and decompression tools like tar, gzip, bzip2, zip and compress. Read the full article explaining how to use them with examples here.
http://www.techpulp.com/articles/linux/art-linux-compression-utilities.php

Parse words in a string

July 10, 2008

Find how a string is parsed and split in to words and returned as array of pointers each pointing to start of each word. Get the details and code snippet here.
http://www.techpulp.com/articles/c/snip-parse-words.php

Identify processes that have open sockets

July 10, 2008

The lsof can be used to find the list of processes that have active sockets open.
Then netstat command can be used to verify it.
Find more details here.
http://www.techpulp.com/articles/linux/tip-identify-process-with-open-socket.php