Live data from Hacker News

Bashbro – Make Any Comp a Web-Based File Server

github.com

31–40 of 52 posts

Re: Bashbro – Make Any Comp a Web-Based File Server

#32

I re-read "Make Any Comp a Web-Based File Server" 10 times and I don't understand what it means. Specifically the word "Comp". What does this mean?

I think it's just what 12 year olds call a computer. A comp-u-ter.

gotta save todays date into my google cal, so i remember the day i learned this.

("cal" obviously stands for "calculator")

Re: Bashbro – Make Any Comp a Web-Based File Server

#33
post #10

This is cool, but there's currently an overload of ports assigned on my system. Is there a way to manage all these port numbers? And why can't we use strings, even if just locally? And what do people use to allocate port numbers in a way that you'll never get clashes?

I've seen scripts that probe ports with nc until they find a free one. They usually log to stdout which port they found.

Re: Bashbro – Make Any Comp a Web-Based File Server

#34

Earlier quoted context omitted.

It requires Python. Bashbro, on the other hand, seems to require socat. I wonder if there's any bash-istic method of listening to a port...

I solved that problem some time ago with netcat, „coproc nc -l -p PORT“. Makes bash listen to nc‘s stdout and let’s it write to it‘s stdin. But nc is not bash.

Here's my nc version, works on all shells:

https://gist.github.com/alganet/140c7c12d1603c244a01

nc is almost everywhere, you can count on it.

Ultimately, this is a toy, but it can be handy. I originally made it to attempt using for serving config for networked debian unattended installations[1] while automating VM creation, but never went that far.

[1]: https://debian-handbook.info/browse/en-US/stable/sect.automa...

Re: Bashbro – Make Any Comp a Web-Based File Server

#37
post #8

What is wrong with "python -m http.server"?

It requires Python. Bashbro, on the other hand, seems to require socat. I wonder if there's any bash-istic method of listening to a port...

There might be a way to create a listener using bash's /dev/tcp but I can't remember (I haven't used bash for decades)

edit:

https://unix.stackexchange.com/questions/49936/dev-tcp-liste...

gives some pointers

Re: Bashbro – Make Any Comp a Web-Based File Server

#39
post #10

This is cool, but there's currently an overload of ports assigned on my system. Is there a way to manage all these port numbers? And why can't we use strings, even if just locally? And what do people use to allocate port numbers in a way that you'll never get clashes?

No way to allocate port numbers without clashes ever. What I do is having a Ports.md in my personal knowledge base with all port assignments in my personal projects and networks: port, description, project link and/or service host:port. This works very well, I don’t have tens of thousands of projects so I’m not going to exhaust port numbers. I used to try to use Unix domain sockets as much as possible for anything fronted by nginx, but stopped bothering with that since I started centrally maintaining port assignment.

Re: Bashbro – Make Any Comp a Web-Based File Server

#40

In a slightly more heavyweight category I've settled on dufs for my single binary file serving / uploading / password-protecting needs. https://github.com/sigoden/dufs

Does this support starting a webdav server over an ssh tunnel to remote server? It looks like it from the readme, will attempt asap.

Ok, checked it out, dufs is a cool tool. Definitely replaces python -m http.server. This is a new standard rightalong side ripgrep.

Cargo is the package manager that pip wanted to be. We should just use cargo anyway. Why have distros when you have Cargo? Why have homebrew when you have Cargo?

Dufs support of webdav is nascent.

I kid, but only a little bit.

Post reply on HN