Skip to content

Instantly share code, notes, and snippets.

@jamesratcliffe
Created June 17, 2020 13:59
Show Gist options
  • Select an option

  • Save jamesratcliffe/1d402a443416f9316debee1ecba4f514 to your computer and use it in GitHub Desktop.

Select an option

Save jamesratcliffe/1d402a443416f9316debee1ecba4f514 to your computer and use it in GitHub Desktop.

Revisions

  1. jamesratcliffe created this gist Jun 17, 2020.
    7 changes: 7 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # Use pbcopy over ssh

    From https://seancoates.com/blogs/remote-pbcopy/.

    1. Save pbcopy.plist to ~/Library/LaunchAgents/.
    2. Load it: `launchctl load ~/Library/LaunchAgents/pbcopy.plist`.
    3. Save pbcopy /usr/local/bin. Make sure it's executable.
    1 change: 1 addition & 0 deletions pbcopy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    cat | nc -q1 localhost 2224
    26 changes: 26 additions & 0 deletions pbcopy.plist
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>localhost.pbcopy</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/bin/pbcopy</string>
    </array>
    <key>inetdCompatibility</key>
    <dict>
    <key>Wait</key>
    <false/>
    </dict>
    <key>Sockets</key>
    <dict>
    <key>Listeners</key>
    <dict>
    <key>SockServiceName</key>
    <string>2224</string>
    <key>SockNodeName</key>
    <string>127.0.0.1</string>
    </dict>
    </dict>
    </dict>
    </plist>