Skip to main content

Posts

Local file transfer-python

Here is the python code to send a file from a local server to a local client. # server.py import socket                   # Import socket module port = 60000                    # Reserve a port for your service. s = socket.socket()             # Create a socket object host = socket.gethostname()     # Get local machine name s.bind((host, port))            # Bind to the port s.listen(5)                     # Now wait for client connection. print 'Server listening....' while True:     conn, addr = s.accept()   ...

Server/Client Communication-python

The basic mechanisms of client-server setup are: A client app send a request to a server app.  The server app returns a reply.  Some of the basic data communications between client and server are: File transfer - sends name and gets a file.  Web page - sends url and gets a page.  Echo - sends a message and gets it back.  Client server communication uses socket.              To connect to another machine, we need a socket connection. What's a connection?  A relationship between two machines, where two pieces of software know about each other. Those two pieces of software know how to communicate with each other. In other words, they know how to send bits to each other. A socket connection means the two machines have information about each other, including network location (IP address) and TCP port. (If we can use anology, IP address is the phone number and the TCP port is the extension).  A so...

Network Configurations

Ubuntu ships with a number of graphical utilities to configure your network devices. Eg:$network-admin This document is geared toward server administrators and will focus on managing your network on the command line. Basic network configuration and hostname on a Ubuntu system are stored in several files which must be edited to create a working configuration: /etc/network/interfaces describes the network interfaces /etc/hostname configures the nameserver credentials /etc/hosts resolves IP addresses to hostnames Once the new configuration is saved the interface must be restarted. Ethernet Interface Logical Names Interface logical names are configured in the file /etc/udev/rules.d/70-persistent-net.rules . If you would like control which interface receives a particular logical name, find the line matching the interfaces physical MAC address and modify the value of NAME=ethX to the desired logical name. Reboot the system to commit your changes....

Linux Network Commands

Dear students refresh your basic linux knowledge and try the linux commands you have learned in the FOSS lab ( fourth semster) .You can refer my FOSS blog for the same. http://binuvp.blogspot.in/. In this course we will learn essential Linux network commands in Ubuntu. These commands may be used to configure, to troubleshoot your network or to obtain some more information all via the terminal in Linux. So let’s go! ifconfig (interface configurator) ifconfig (interface configurator) command is use to initialize an interface, assign IP Address to interface and enable or disable interface on demand. With this command you can view IP Address and Hardware / MAC address assign to interface and also MTU (Maximum transmission unit) size. Eg: $ifconfig $ifconfig eth0 $ifconfig -a Enable eth0 $ifup eth0 Disable eth0 $ifdown eth0 By default MTU size is 1500. We can set required MTU size with below command. Replace XXXX with size. $ifconfig eth0 mtu xxxx Set Interface in P...