Skip to content

Instantly share code, notes, and snippets.

@bplaxco
Last active August 29, 2015 14:27
Show Gist options
  • Save bplaxco/ac0a0f5486cf526c89e9 to your computer and use it in GitHub Desktop.
Save bplaxco/ac0a0f5486cf526c89e9 to your computer and use it in GitHub Desktop.
A way to share your session with a friend
#! /bin/bash
# Create the named pipe that script will go out to
rm -R /tmp/session_fifo
mkfifo /tmp/session_fifo
# Start up the server and get the pid
nc -l 1337 < /tmp/session_fifo &
nc_pid=$!
echo 'Listening on port 1337'
script -f /tmp/session_fifo && kill $nc_pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment