Provide copying and pasting within multiple hosts through the Web.
- bash (version 3.2 and more)
- openssl (version 1.0.1e and more)
- curl (versin 7.19.7 and more)
Set up ttcopy
on the hosts which you want to make share same data.
Please follow the following instructions to install it.
With zplug (for zsh users)
If you are using zplug, it is easy and recommended way.
Add this line to .zshrc
.
zplug "greymd/ttcopy"
That's all 🎉.
With Homebrew (for macOS users)
$ brew tap greymd/ttcopy
$ brew install ttcopy
# If necessary, install `add-apt-repository` command.
$ sudo apt-get install software-properties-common
# For Ubuntu 12.04: $ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ttcopy/ppa
$ sudo apt-get update
$ sudo apt-get install ttcopy
If you cannot choose any of above ways, follow below steps
$ git clone https://github.com/greymd/ttcopy.git ~/ttcopy
Add following lines.
source ~/ttcopy/ttcp_activate.sh
ttcp_activate.sh
adds ttcocpy/bin
to $PATH
. Instead of using it, you can
copy ttcopy/bin
and ttcopy/lib
somewhere you want to place then make sure
ttcopy/bin
be listed under $PATH
.
For example,
cp -rf ~/ttcopy/bin ~/ttcopy/lib /usr/local
echo "export PATH=$PATH:/usr/local/bin" >> ~/.zshrc" # if you need
First of all, ttcopy
command displays the screen to let you set default ID and Password.
Please prepare ID and Password as you like. Be lazy! You are NOT required to register them on any services.
The data you copied can be pasted within the hosts having same ID and Password.
$ ttcopy
Set default ID/Password.
Enter ID for ttcopy/ttpaste: myid001 #<= Enter your ID ("myid001" is just an example).
Enter password for ttcopy/ttpaste: #<= Enter your password.
Enter same password again: #<= Enter again.
Created credential file '/home/user/.config/ttcopy/config'
Execute 'ttcopy --init' to show this screen again.
- Host1
$ echo foobar | ttcopy
- Host2
$ ttpaste
foobar
- Host1
$ cat image.jpg | ttcopy
- Host2
$ ttpaste | file -
/dev/stdin: JPEG image data, JFIF standard 1.01
ttcopy
and ttpaste
commands support following options.
$ ttcopy --help
Usage: ttcopy [OPTIONS]
OPTIONS:
-h, --help Output a usage message and exit.
-V, --version Output the version number of ttcopy and exit.
-i ID, --id=ID Specify ID to identify the data.
-p PASSWORD, --password=PASSWORD Specify password to encrypt/decrypt the data.
--init Set default ID and password.
Use non-default ID and password.
$ seq 10 | ttcopy -i abcdef -p ghijklmn
Copied!
$ ttpaste -i abcdef -p ghijklmn
1
2
3
4
5
6
7
8
9
10
Commands load shell variable TTCP_PROXY
as their proxy server for connection.
$ echo ABCDEFG | TTCP_PROXY="http://example.proxy.server1.com:1234" ttcopy
$ TTCP_PROXY="http://example.proxy.server2.com:5678" ttpaste
ABCDEFG
It is helpful to add this line to .bashrc
or .zshrc
if you are always using specific proxy server.
export TTCP_PROXY="http://example.proxy.server1.com:1234"
This is available as open source under the terms of the MIT License.