2 examples for socat
# Create a virtual serial port pair (anything sent to one is received on the other).
socat -d -d pty,raw,echo=0 pty,raw,echo=0
# Listen for a docker container on OS X to show it's display
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"