Skip to content

Instantly share code, notes, and snippets.

@greymd
Last active January 16, 2017 09:25
Show Gist options
  • Select an option

  • Save greymd/159c13f9c7c3f847eb43ce9aa72e73d0 to your computer and use it in GitHub Desktop.

Select an option

Save greymd/159c13f9c7c3f847eb43ce9aa72e73d0 to your computer and use it in GitHub Desktop.

Revisions

  1. greymd revised this gist Jan 16, 2017. 1 changed file with 7 additions and 6 deletions.
    13 changes: 7 additions & 6 deletions wpb.sh
    Original file line number Diff line number Diff line change
    @@ -10,15 +10,16 @@
    # $ wpbpaste | file -
    # /dev/stdin: JPEG image data, JFIF standard 1.01

    # Set MYSTR as you like.
    MYSTR="myclip"
    PASSWD="hogehoge"
    # 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/$MYSTR);
    curl -s -X POST "https://cl1p.net/$MYSTR" --data "content=$TRANS_URL" > /dev/null
    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/$MYSTR" | xmllint --html --xpath '/html/body/div/div/textarea/text()' -)
    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
    }
  2. greymd revised this gist Jan 16, 2017. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions wpb.sh
    Original file line number Diff line number Diff line change
    @@ -12,12 +12,13 @@

    # Set MYSTR as you like.
    MYSTR="myclip"
    PASSWD="hogehoge"
    wpbcopy () {
    local TRANS_URL=$(curl -so- --upload-file <(cat) https://transfer.sh/$MYSTR);
    local TRANS_URL=$(curl -so- --upload-file <(cat | openssl aes-256-cbc -e -pass pass:$PASSWD) https://transfer.sh/$MYSTR);
    curl -s -X POST "https://cl1p.net/$MYSTR" --data "content=$TRANS_URL" > /dev/null
    }

    wpbpaste () {
    local TRANS_URL=$(curl -s "https://cl1p.net/$MYSTR" | xmllint --html --xpath '/html/body/div/div/textarea/text()' -)
    curl -so- "$TRANS_URL"
    curl -so- "$TRANS_URL" | openssl aes-256-cbc -d -pass pass:$PASSWD
    }
  3. greymd revised this gist Jan 16, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions wpb.sh
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@
    # $ wpbpaste | file -
    # /dev/stdin: JPEG image data, JFIF standard 1.01

    # Set MYSTR as you like.
    MYSTR="myclip"
    wpbcopy () {
    local TRANS_URL=$(curl -so- --upload-file <(cat) https://transfer.sh/$MYSTR);
  4. greymd revised this gist Jan 16, 2017. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions wpb.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,15 @@
    # 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

    MYSTR="myclip"
    wpbcopy () {
    local TRANS_URL=$(curl -so- --upload-file <(cat) https://transfer.sh/$MYSTR);
  5. greymd revised this gist Jan 16, 2017. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions wpb.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,8 @@
    # Usage
    # $ echo ほげほげ | wpbcopy

    # $ echo foobar | wpbcopy
    # $ wpbpaste
    # ほげほげ
    # foobar

    MYSTR="myclip"
    wpbcopy () {
  6. greymd revised this gist Jan 16, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wpb.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    # $ wpbpaste
    # ほげほげ

    MYSTR="greymd"
    MYSTR="myclip"
    wpbcopy () {
    local TRANS_URL=$(curl -so- --upload-file <(cat) https://transfer.sh/$MYSTR);
    curl -s -X POST "https://cl1p.net/$MYSTR" --data "content=$TRANS_URL" > /dev/null
  7. greymd revised this gist Jan 16, 2017. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions wpb.sh
    Original file line number Diff line number Diff line change
    @@ -3,12 +3,13 @@
    # $ wpbpaste
    # ほげほげ

    MYSTR="greymd"
    wpbcopy () {
    local TRANS_URL=$(curl -so- --upload-file <(cat) https://transfer.sh/myclip);
    curl -s -X POST 'https://cl1p.net/myclip' --data "content=$TRANS_URL" -w "%{http_code}" > /dev/null
    local TRANS_URL=$(curl -so- --upload-file <(cat) https://transfer.sh/$MYSTR);
    curl -s -X POST "https://cl1p.net/$MYSTR" --data "content=$TRANS_URL" > /dev/null
    }

    wpbpaste () {
    local TRANS_URL=$(curl -s 'https://cl1p.net/myclip' | xmllint --html --xpath '/html/body/div/div/textarea/text()' -)
    local TRANS_URL=$(curl -s "https://cl1p.net/$MYSTR" | xmllint --html --xpath '/html/body/div/div/textarea/text()' -)
    curl -so- "$TRANS_URL"
    }
  8. greymd created this gist Jan 16, 2017.
    14 changes: 14 additions & 0 deletions wpb.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    # Usage
    # $ echo ほげほげ | wpbcopy
    # $ wpbpaste
    # ほげほげ

    wpbcopy () {
    local TRANS_URL=$(curl -so- --upload-file <(cat) https://transfer.sh/myclip);
    curl -s -X POST 'https://cl1p.net/myclip' --data "content=$TRANS_URL" -w "%{http_code}" > /dev/null
    }

    wpbpaste () {
    local TRANS_URL=$(curl -s 'https://cl1p.net/myclip' | xmllint --html --xpath '/html/body/div/div/textarea/text()' -)
    curl -so- "$TRANS_URL"
    }