
Remote pbcopy - tswicegood
http://seancoates.com/blogs/remote-pbcopy
======
ary
As someone else pointed out in a sub-comment, ssh user@host 'command' |
pbcopy; seems a lot simpler. No open ports, no firewall config... no setup at
all. It doesn't give you the access to the pasteboard in your current session,
but Command+C has you covered.

Seems like overkill.

------
tlrobinson
I did something similar for the "open" command, "ropen":
<https://github.com/tlrobinson/ropen> You can open both files and directories.
It uses sshfs with simple PHP script to coordinate. I used it for a couple
weeks then forgot about it.

Then I did this one using Dropbox, but it only works if you have Dropbox
installed on both machines:

    
    
        alias dbcopy="cat > ~/Dropbox/.dbpasteboard"
        alias dbpaste="cat ~/Dropbox/.dbpasteboard"
    

I think there's probably a better solution than all of these.

------
parenthesis
While on this general subject, here's what I use to do the equivalent X copy
and paste thing on Linux:

    
    
      # 'pbcopy'
      xsel -b -i
    
      # 'pbpaste'
      xsel -b -o

------
bockris
For windows users this project <http://unxutils.sourceforge.net/>

has 'pclip' and 'gclip' which do the same thing as 'pbcopy' and 'pbpaste'.

I have been using this technique for years (without the remote stuff described
in the article).

~~~
pasbesoin
Unexpectedly (I've used them before), I found the file links returning 403.

There are copies in the Wayback Machine, and the original site's front page
has a link to MD5 hash values in case you want to (more or less) verify the
files acquired from Wayback.

[http://web.archive.org/web/*/http://unxutils.sourceforge.net...](http://web.archive.org/web/*/http://unxutils.sourceforge.net/UnxUtils.zip)

[http://web.archive.org/web/*/http://unxutils.sourceforge.net...](http://web.archive.org/web/*/http://unxutils.sourceforge.net/UnxUpdates.zip)

<http://unxutils.sourceforge.net/md5sum>

~~~
bockris
That stinks. I didn't verify the download links, sorry.

I have mine in a 'bin' folder that gets copied to each new PC in turn.

------
pielud
Can't this be achieved just using ssh instead of setting up a process that
listens to the network?

from remote machine:

    
    
      ssh me@macbook pbcopy < foo.txt

~~~
scoates
If: 1) macbook has ssh turned on 2) macbook's IP is routable (or forwarded via
NAT), 3) server is able to log in to macbook (has private key, or you supply
password, etc) 4) the pastboarde is available without a GUI (not sure that
sshing to a macbook and issuing pbcopy will adjust the pasteboard of the user
at the terminal)

For me, #1, #2, and #3 are false. #4 is unknown. A VPN would make 1,2,3
easier, though.

S

~~~
greyboy
This is what I use, though not as fancy.

mac$ ssh user@remote "some command" | pbcopy

