nwcopy/nwpaste

The fool proof network copy & paste program. Well, maybe someday.

Usage

Copy data from the clipboard (pbpaste).

> nwcopy -p
/Users/josh/Dropbox/nwcopy/f314eee55161b14f140ee07b358ba63ef54112ac

Paste to STDOUT and the clipboard (pbcopy)

> nwpaste
<Contents of clipboard>

Copy contents of a file to the clipboard (works with binaries)

> nwcopy /path/to/file
/Users/josh/Dropbox/nwcopy/e1c1675f009e65d8571bbab9243660da20a3b2a2

Paste the file to disk

> nwpaste
Pasted to file

Pipe arbitrary whatever to the clipboard

> echo 'pipes work' | nwcopy
/Users/josh/Dropbox/nwcopy/5293e79627710caf507fb9b841df51356650c78d

Paste to STDOUT and the clipboard (pbcopy)

> nwpaste
pipes work

Paste a hash from nwcopy.net (shared or otherwise)

> nwpaste <hash>
Whatever that hash represented

Description

nwcopy takes whatever is in the clipboard (or pipe or filename) and copies it to nwcopy.net. If you don’t have nwcopy.net configured, it will copy to a file in your Dropbox folder ~/Dropbox/nwcopy/<sha1>

nwpaste takes the contents of the most recent file (from nwcopy.net or your Dropbox), prints it to STDIN and puts it in the clipboard.

WTF?

How in the world is this useful?

I constantly want to copy and paste between machines which cannot directly talk to one another. My solution was simple, and this is it. It also happens to be really easy to use.

Is that all?

Is that all? Well, yeah, right now. This is the initial version, and it works! However, here are my plans:

  • Support multiple files with globbing and whatnot.

  • When multiple files are supplied, they should be pasted back with their original filename (tarball?)

  • Whatever folks deem useful.

  • Have some delicious brisket.