Created
July 15, 2025 11:10
-
-
Save ychaouche/8b5c506b32500608bd8e4fe8d416c60b to your computer and use it in GitHub Desktop.
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
12:07:35 ~/NOTES/TXT -1- $ type net.paste0x0 | |
net.paste0x0 is a function | |
net.paste0x0 () | |
{ | |
local useragent="net.paste0x0 by https://github.com/ychaouche"; | |
echo "net.paste0x0 $1"; | |
if (($#)); then | |
filepath="$1"; | |
filename="$(basename "$filepath")"; | |
mkdir /tmp/net.paste0x0/ 2> /dev/null; | |
dest="/tmp/net.paste0x0/"$filename".txt"; | |
cp -i "$filepath" "$dest"; | |
echo "we're going to upload $dest"; | |
curl -kF "file=@$dest" "https://0x0.st" -A "$useragent"; | |
else | |
tmpfile=$(mktemp -t paste-XXX.txt); | |
cat > "$tmpfile"; | |
echo "we're going to upload $tmpfile"; | |
curl -kF "file=@$tmpfile" "https://0x0.st" -A "$useragent"; | |
fi | |
} | |
12:09:42 ~/NOTES/TXT -1- $ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment