Showing posts with label FileSharing. Show all posts
Showing posts with label FileSharing. Show all posts

Saturday, 16 June 2012

Linux File Sharing Using python

Using python for file sharing in linux

# cd /dir/want/to/share
 
# python -m SimpleHTTPServer

and in browser http://192.168.1.183:8000

Linux File Sharing Using Twistd

To share your directory with others on your network or even on the internet, you can use the twisted tool to share your folders.

Twisted is a python based tool, you need rpms like python-twisted-core, pyOpenSSL, python-zope-interface to install the too.

You can make use of the RPMforge rpm repo on yum to install the tool on your server or destop easily.

Sharing your folder on the web

# yum install python-twisted-core
 
# yum install python-twisted-web

$ twistd web --path /home/ -p 8081 &

Then go to browser and run
  http://192.168.1.183:8081/

To kill or end the twistd, use.

# killall -9 twistd

The above will start a web server on port 8081 sharing your /home directory. You can use http://<server-ip>:8081 to get the full list of /home directory on your web browser.

Sharing your folder on FTP

Similar to HTTP you can also use ftp protocol to start sharing. Just execute.

# twistd -n ftp -r /home/ &

This will start the ftp service on the default port 2121, you can use your ftp client on port 2121 to connect with your server.

Friday, 3 February 2012

For High speed file transfer

Use lftp for high speed file transfer between servers or systems. It support both httpd and ftp.

lftp via httpd

#  lftp http://192.168.1.183/ -e 'pget -n 30 SM10.77_Linux_32bit_x86_SMIA-10.77.x5.28.tgz'


This will get the file of high size very fast in locally. We can move it in remote servers as well, note that the file must be place in the apache document root.

lftp via ftp

# lftp ftp://192.168.0.152/ -e 'pget -n 30 CentOS-5.6-i386-bin-DVD.iso'

put the package in /var/ftp.

we can also mention username and passeord alson with lftp.

# lftp -u 'ctechz,blogspot' http://ctechz.blogspot.com -e 'pget -n 30 package'

we can adjust the speed rates by changing 30 to some other numbers.


Wednesday, 1 February 2012

Http file sharing in linux


Let us have a look at Instant http file sharing in linux, no need of any nfs or samba to do the work for you

Go to the directory you want to share
cd ctechz

Run the below command 
# python -m SimpleHTTPServer

Go to another machine and open browser and enter
http://ipadress:8000

You will get all the files inside the directory in which you ran the python command.