Last active
December 24, 2020 15:27
-
-
Save PeterRincker/8fab6296b6905793e284e84aba7041bc to your computer and use it in GitHub Desktop.
Exposing your clipboard over SSH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run this on your local machine | |
# gist: https://gist.github.com/dergachev/8259104 | |
echo "When connected via ssh:" | |
echo " type ~C" | |
echo " -R 5556:localhost:5556" | |
echo "" | |
echo " Send data via `nc localhost 5556`." | |
echo " e.g. `cat foo.txt | nc localhost 5556`" | |
echo "" | |
# display number of characters recieved | |
while (true); do nc -l 5556 | pbcopy; pbpaste | wc -c; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Add line to remote vimrc file | |
" :[range]Y - send [range] lines to remote-pbcopy via netcat. | |
command! -range Y silent <line1>,<line2>w !nc localhost 5556 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment