4 ms·
I wrote a tool to copy stdout from a remote machine to my windows clipboard. I alias ssh to ssh with port forwarding to a static port that isnt used anywhere, r
by bostonsre 5y ago
I wrote a tool to copy stdout from a remote machine to my windows clipboard. I alias ssh to ssh with port forwarding to a static port that isnt used anywhere, run a flask site locally on my laptop that has an endpoint for accepting base 64 encoded posts for copied data and an endpoint that has some bash function definitions for doing a curl post of base64 encoded piped data to the port that was forwarded over ssh. I have a terminal hot key which does a curl get of the bash functions and imports them.
so this on a remote machine:
some_remote_machine> echo hello | cb
Will base64 encode hello, post that to localhost:1234 on the remote machine which gets forwarded to my laptop flask site, it base64 decodes the text, then since im in wsl, the flask site runs powershell to write it to my windows clipboard.
It's good for note taking and sharing output in slack easily. I also have an alias for cbc or clipboard with command which prefixes the text with the command used to generate the output.