Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aanari/e338488f708cfe2541cc0ab0e5d74969 to your computer and use it in GitHub Desktop.
Save aanari/e338488f708cfe2541cc0ab0e5d74969 to your computer and use it in GitHub Desktop.
how to use lemonade to share a clipboard between remote computers
on local and remote machine:
go get github.com/pocke/lemonade (if you have Go installed, if not download lemonade binary from github)
make sure $GOPATH/bin is in your path on both machines
-- or move $GOPATH/bin/lemonade to a place already in your path like /usr/local/bin
on your local machine add a script like this:
cat ~/bin/remote
#!/bin/bash
ps cax | grep lemonade> /dev/null
if [ $? -eq 0 ]; then
echo "lemonade is running."
else
echo "lemonade is not running."
nohup lemonade server &
fi
ssh -R 2489:127.0.0.1:2489 remote.server.com
then chmod +x ~/bin/remote
when you type `remote` it will open lemonade server locally, ssh tunnel the lemonade clipboard port.
locally (like on my mac) cmd-C to copy something.
this works between any two computers, even if one of them is a vm on the same machine
remote - $> lemonade paste
OR use the amazing neovim which has built-in lemonade support and just type "p" in neovim to paste the contents
of your local clipboard to your remote neovim session buffer.
for bonus points, modify the script to use a variable to invoke it with the remote server name:
$ remote my.server.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment