Last active
January 16, 2017 09:25
-
-
Save greymd/159c13f9c7c3f847eb43ce9aa72e73d0 to your computer and use it in GitHub Desktop.
copy & paste through Web
This file contains hidden or 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
# Usage | |
## Example 1 (Text) | |
# $ echo foobar | wpbcopy | |
# $ wpbpaste | |
# foobar | |
## Example 2 (Binary) | |
# $ cat image.jpg| wpbcopy | |
# $ wpbpaste | file - | |
# /dev/stdin: JPEG image data, JFIF standard 1.01 | |
# Set ID and PASSWORD **AS YOU LIKE**. | |
MYID="your_id" | |
PASSWD="your_password" | |
wpbcopy () { | |
local TRANS_URL=$(curl -so- --upload-file <(cat | openssl aes-256-cbc -e -pass pass:$PASSWD) https://transfer.sh/$MYID); | |
curl -s -X POST "https://cl1p.net/$MYID" --data "content=$TRANS_URL" > /dev/null | |
} | |
wpbpaste () { | |
local TRANS_URL=$(curl -s "https://cl1p.net/$MYID" | xmllint --html --xpath '/html/body/div/div/textarea/text()' -) | |
curl -so- "$TRANS_URL" | openssl aes-256-cbc -d -pass pass:$PASSWD | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment