Skip to content

Instantly share code, notes, and snippets.

@ychaouche
Created July 15, 2025 11:10
Show Gist options
  • Save ychaouche/8b5c506b32500608bd8e4fe8d416c60b to your computer and use it in GitHub Desktop.
Save ychaouche/8b5c506b32500608bd8e4fe8d416c60b to your computer and use it in GitHub Desktop.
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