File Sharing Using cURL
File sharing from terminal which suck less

Search for a command to run...
File sharing from terminal which suck less

No comments yet. Be the first to comment.
For those who don't know, Wayle is a project from the same creator as Hyprpanel, which is apparently going to be deprecated soon. Probably because of that, I couldn't find a proper theming guide anywh

Once you've spent years on an operating system, things soon start becoming stagnant. I hit that wall recently. I realized I'm spending most of my time at a full-time job, so I have very little time le

If you just want Thunar to work properly without digging into details, run: sudo pacman -S thunar gvfs tumbler ffmpegthumbnailer thunar-archive-plugin Optional (but useful): sudo pacman -S thunar-vol

I was bored and just wanted to code something to spark the life, of course. And, to fight it, my brain thought, "how fast really is my DNS provider?" No architecture diagram. No benchmarking framewo

What really happens when you run docker ps: from CLI to Kernel Internals

These days, sharing photographs, videos, and document files is a pretty routine task. If you don't want to use any Google or Microsoft accounts, the procedure can occasionally get very frustrating. Then the only option is to use a website that offers this feature without requiring a login, such as WeTransfer.
But what if you want to share something more quickly or from a terminal then we can use a very interesting and mind-blowing website THE NULL POINTER. This site allows you to create an HTTP POST request to send a file very quickly. I just have to do
curl -F 'file=@yourfile.png' https://0x0.st
And, this will return a shareable link in the terminal (fast and easy enough).
The full source code is accessible as a Git Repo If you'd like to run a server and website like this, it is amazing.
cURL comes pre-installed in most Linux distributions but in case you didn't have it installed.
Install on Ubuntu / Debian
sudo apt install curl fzf
Install on Arch OS
sudo pacman -Sy curl fzf
curl -sS -F "file=@\((find \)HOME | fzf)" https://0x0.st | xclip -selection clipboard && xclip -selection clipboard -o
In the command above, you simply upload a file to THE NULL POINTER, copy the shareable link to the clipboard, and then stdout the link on the terminal.
Explanation
-sS show any info on stdout only if any error occurred
-F allow uploading a file on THE NULL POINTER
"file=@\((find \)HOME | fzf)" grab file location using fzf
xclip -selection clipboard copy sharable link to clipboard
xclip -selection clipboard -o finally also stdout on terminal
Now, we can simply create an alias out of this by simply pasting in .zshrc or .bashrc
alias fshare='curl -sS -F "file=@\((find \)HOME | fzf)" https://0x0.st | xclip -selection clipboard && xclip -selection clipboard -o'
Rather than an alias, I usually prefer to use a standalone bash script and making it executable. I have fshare bash script on my GitHub (Check Here). Where you can always get updated version of fshare there. So to install it run below commands.
sudo wget https://raw.githubusercontent.com/FlareXes/Micro-Utils/main/bin/fshare -O /usr/local/bin/fshare
sudo chmod +x /usr/local/bin/fshare
fshare
But, THE NULL POINTER is a free service which means it comes with restrictions some of which are listed below.
0x0.st is not a platform for:
piracy
extremist material of any kind
malware / botnet C&C
anything related to crypto currencies
tor exit nodes not allowed
any file types:
application/x-dosexec
application/x-executable
application/x-hdf5
application/java-archive
android apks and system images
Check out their website for more information.
If you don't like these restrictions then spin up your own server because it is open-source and available as a git repo and don't spam on them.