Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Linux Ask!

Aug 302010
 

Fix the warning of: Remote Host Identification Has Changed error and solution

Answer:

You might experience this error, especially when you are connecting to a remote Linux machine which has just got re-installed.

To solve this, enter the command:

# ssh-keygen -R 192.168.2.36

Where 192.168.2.36 is the IP you are connecting.

Aug 272010
 

How to kill a TCP connection using tcpkill?

Answer:

You can use the tcpkill program.

tcpkill came with the dsniff in Debian/Ubuntu, you need to install it manually.

# sudo apt-get install dsniff

Usages:

1. Kill all outgoing web (port 80) connection:

# tcpkill -i eth0 port 80

2. Kill all connection by IP

# tcpkill -i eth0 host www.google.com

Aug 262010
 

Hash reference in Perl

Answer:

Hash reference is something like a pointer to a hash data structure in Perl

Example:

my %hash = (
        "a" => "1",
        "b" => "2",
);

my $hash_ref = \%hash;

$hash{"a"} = "A";

print $hash_ref->{"a"}; # print out "A" as change in  %hash  also reflected in its reference