Search This Blog

Friday, July 10, 2015

To avoid overridden of /etc/resolve.conf (Ubuntun 14.04) ..

While setting up the dns for the naming server, I came across this situation where /etc/resolv.conf file  is not getting updated.

To avoid this ..
-add name server details in base file
-then update resolve conf
-restart network mgr ( -> service network-manager stop and  .. start)



Saturday, June 6, 2015

Socket Configuration With The Client System ..

********************************************

06-June-2015


Requirements beore going to this article:
i)Basic idea of socket and its use
ii)Usage of Perl modules

********************************************

Generally Socket configuration consists of..

Creating Socket
Bind it to port
Client Connection Establishment

##Related  library is Socket INET (i.e. Socket::INET)

Below is the skeleton code..

where XXX needs values with repect to local configuration.


socket = new IO::Socket::INET (
LocalHost => 'XXX',
LocalPort => 'XXXX',
Proto => 'tcp',
Listen => 5, #5 for tcp, varies based on configuration
Reuse => 1
) or die "error in creation of scket: $!  ”;


## repeat a infinite loop till the connection is success full something like 

while(1)
{

$client_soc = $socket->accept();

#to fetch host
$peer_address = $client_sock->peerhost();
#to fetch port num
$peer_port = $client_sock->peerport();

#this is end of the connection

$data = “data 4m Server”;
print $client_sock “$data\n”;

$data = <$client_socket>;

print “ $data is received from clinet s\n”;
}
#finally end of the connection by 
$socket->close();

TCP Socketing

Generally socket operation contains..


Friday, January 9, 2015

Putty Auto Login Through Batch



Unix Terminal can easily be accessed by a batch file instead of doing it by putty(tradition repeated way ).


Use below in a batch file

start <putty.exe path> <unixhostname> -l username -pw password

Example:

start C:\putty.exe jmksrv.uk.mm -l uname1 -pw pass@12345