Created
October 2, 2018 01:58
-
-
Save rplevy/bc732e8ba12a9d750de02ed5680c70d0 to your computer and use it in GitHub Desktop.
filebin.net command-line example
This file contains 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
export SHA=$(git rev-parse HEAD) | |
tar czfv $SHA.tgz resources/public/ | |
curl --request POST --data-binary "@${SHA}.tgz" -H "filename: "$SHA.tgz -H "bin: "$SHA https://filebin.net | |
export T=$(curl -s https://filebin.net/$SHA | grep \?t= | tail -n 1 | sed -e 's/^.*zip.t=//' | cut -c1-8) | |
curl -s https://filebin.net/$SHA/$SHA.tgz?t=$T --output $SHA.tgz | |
tar -xzf $SHA.tgz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FILE=flow.tgz
SHA=$(md5sum $FILE | awk '{print $1}')
response=$(curl --request POST --data-binary "@${FILE}" -H "filename: "$FILE.tgz -H "bin: "$SHA https://filebin.net)
ID=$(echo "$response" | grep -o '"id": "[^"]"' | sed 's/."id": "([^"])"./\1/')
echo https://filebin.net/$ID