Using netcat and tar for network file transfer

Imagine you are on lan party or on the road and quickly want to transfer a file or directory to another computer. Both computer owners are just to lazy to setup something like ftp, smb, nfs. A very simple and even cross platform solution is using netcat and in case of a directory in combination with tar like the following steps. I will just show you how to use it without compression for a directory. Fell free to play around. You can test it locally of course.

1. The sender

The sender has to call netcat in server mode and pipe content into it. The next line tells tar to build a tarball and write it to standard output which is redirected via a pipe to netcat. Netcat is told to start in server mode (-l), listen on port 7878 (-p 7878) and shutdown itself after waiting 10 seconds after having seen an end of file in standard input (-q 10):

$ tar c directory | nc -q 10 -l -p 7878

2. The receiver

The receiver has to call netcat and tell him to Weiterlesen

Getting around the Gnome network manager

Know that problem? You are somewhere around and got special network settings like a wlan essid and static ip ressources. Your Gnome network manager which you really like as it finally brought easy wpa2/wpa/wep detection and setup to you prefers dhcp and skips around the networks like mad.

So this is the time to consider going back to the roots: Switch it off. Just disable the network manager by right clicking on it. Now open /etc/network/interfaces in an editor of your choice with sudo/root rights and add something like this:

iface mynetwork inet static
address 1.2.3.4
netmask 255.255.255.0
gateway 1.2.3.1
wireless-essid NAME-OF-WLAN

Fill this with your specific details and yes, just choose a name for the interface you like. Don’t edit an existing one, don’t think about connecting it to a real interface right now.

After you have done this, open Weiterlesen