Netcat is a powerful networking tool available on most Linux and Unix distributions. It allows you to arbitrarily create network pipes and can be easily scripted which lends tremendous power to an enterprising user.
-e: allows execution of a program upon connect. Note: requires compilation with -DGAPING_SECURITY_HOLE.
-l: set Netcat into listen mode.
-k: forces netcat to continue listening after its current connection is completed.
-n: do not do any DNS/service lookups for addresses, hostnames, or ports.
-v: verbose output.
-p: specify the source port.
nc [IP] [PORT]: connect to a socket IP:port.
nc -nlkv [PORT]: set up a listen server on a given port.
nc -nlkv [PORT] -e /bin/sh: set up a listen server on a given port that executes /bin/sh upon a connection
nc -l -p [PORT] > out.file: dump whatever is received to a file named out.file.
nc -w 3 [IP] [PORT] < out.file: send the contents of a file, out.file, to a socket.