Skip to content

Instantly share code, notes, and snippets.

@focusaurus
Created October 17, 2012 19:05
Show Gist options
  • Save focusaurus/3907446 to your computer and use it in GitHub Desktop.
Save focusaurus/3907446 to your computer and use it in GitHub Desktop.
Transfer clipboard text from one mac to another via netcat
NCSEND_PORT=6666
ncsend() {
local DEST_HOST="${1-smair}"
pbpaste | nc "${DEST_HOST}" "${NCSEND_PORT}"
}
ncreceive() {
while true
do
nc -l "${NCSEND_PORT}" | tee /dev/tty | pbcopy
sleep 1
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment