remote pbcopy with netcat post at:

Quick start

while (true); do nc -l 2224 | pbcopy; done
#If your laptop is running linux, replacing pbcopy with xcopy should work:
#while (true); do nc -l 2224 | xcopy; done

echo "This text gets sent to clipboard" | nc localhost 2224

echo "RemoteForward 2224 localhost:2224" >> ~/.ssh/config
ssh remote -t 'cat blablabla | nc -q0 localhost 2224'

Daemonizing pbcopy

launchctl load ~/Library/LaunchAgents/local.pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">

Remote pbcopy

scp pbcopy remote:/path_to/pbcopy
chmod a+x path_to/pbcopy


[ -n "$SSH_CLIENT" ] && SESSION_TYPE="remote"

if [[ $SESSION_TYPE == "remote" ]]; then
  cat | nc -q0 localhost 2224
  cat | pbcopy