Skip to content

Instantly share code, notes, and snippets.

@rplevy
Created October 2, 2018 01:58
Show Gist options
  • Save rplevy/bc732e8ba12a9d750de02ed5680c70d0 to your computer and use it in GitHub Desktop.
Save rplevy/bc732e8ba12a9d750de02ed5680c70d0 to your computer and use it in GitHub Desktop.
filebin.net command-line example
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
@viewpointsa
Copy link

viewpointsa commented Sep 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment