by jedisct1 · 6y ago · 0 comments
For managing project dependencies, Poetry is the current best. It means I dont have to interact with virtualenv or pip or setuptools or pip-tools or manifest.in.
I don't do a lot of Go either but at least Go generates freestanding binaries so if I install it in precompiled form I know that it will be fairly frictionless and won't rely on half a billion dependencies (which may or may not conflict with something else). I use a bunch of Go programs regularly (like docker or Arch's yay package manager) and it never gets on in the way.
On the other hand if it's an npm package I don't even think about it.
- single binary deploy(unlike Python)
- fast (llvm)
- memory efficient (no GC)
- newer (by virtue of the newness of the language itself).
Nothing wrong with setting expectations in title ;-)
Aha. I have a web server written in rust that literally uses about 5Mb memory on RPi. And that one actually has a proper web framework, not something barebones.
Good luck doing that in Python.
I'm looking at REST API frameworks for rust these days, but nothing looks decent...
python3 -m http.server
Note also that Python is primarily reference counted, with GC used only to detect cyclic references.No GC forces the programmer to think about memory, this is a good thing because you need to to that in all garbabe collected languages anyway - or you will get bloat.
For most use cases I consider garbage collection to be a mistake. Scripting languages or small one-off applications exempted.
Besides that, Mozilla and the Firefox community have a lot of Rust devs so writing this in Rust may make this more likely to get PRs from people involved in the FF Send project
Edit: I see now. Thanks
sum=$(sha1sum "$1" | cut -f 1 -d ' ')
ssh your-vps mkdir /srv/http/files/$sum
scp "$1" your-vps:/srv/http/files/$sum/
echo https://your-vps/files/$sum/$1
+ nginx or whateverAlso it can't be a "secure sharing service" if you're still using 'sha1sum' and it not being end-to-end encrypted...
Also it's quite secure since file content is clearly mapped to the URL you're sharing with the other party via independent channel and the receiving party can verify the content of the file.
It may not be completely private if VPS does not run on your own HW, but nothing prevents you from running it on your own HW in your secured location.
You can use this on windows the same way you'd use it on Linux. You just install a bunch of programs and run commands from command line. (basically just like you'd need to do with fsend) It's less hassle on Linux, since the commands are pre-installed. Fsend is more hassle on Linux since it's not preinstalled and requires rust, compilation, etc.
The other people just open a https links and download files in any browser or via curl, no tools required at all, not even JS.