Live data from Hacker News

Show HN: Redbean – Single-file distributable web server

justine.lol

121–130 of 264 posts

Re: Show HN: Redbean – Single-file distributable web server

#121
post #64

Nice job, Justine. This level of excitement reminds me of the early days of Linux. I think it has the potential to go far.

Author here. Thanks! I was deeply inspired when I read the source code to early versions of Linux and UNIX. The dream of that simple elegant power is something I'm hoping to restore for a new generation. All I'm doing to achieve that is simply standing on the shoulders of the giants who came before me.

Have you considered trying to make system calls inline to avoid the call overhead? Or already thought about it?

I've been banging my head against the wall of trying to make a micro KVM guest and the glibc startup code uses inline SYSCALL everywhere, I assume to make things faster. It does seem to call CPUID a lot too, but I guess it's not as expensive as having to make full-blown system calls.

Re: Show HN: Redbean – Single-file distributable web server

#122
post #10

I just spent 30 minutes reading about this. I'm so shocked that I'm logging in to comment after 5 years of lurking. Justine has built a c library that allows you compile a binary once and have it run it on any os or baremetal. The SAME binary. Quite frankly, that sentence doesn't even make sense to me. Check out https://storage.googleapis.com/justine/cosmopolitan/index.ht... As far as I'm concerned, this is literal m…

[deleted]

Re: Show HN: Redbean – Single-file distributable web server

#125

Caddy is a single file web server as well :) https://caddyserver.com/ Admittedly they solve different usecases, where Redbean seems to want to serve a whole static site as a single file, which isn't currently possible with Caddy, (but you can run `caddy file-server` to serve the current directory as a static site), but it may become possible in the future with Golang's new embed package https://golang.org/pkg/embed/

Is that smile at the end of your first sentence meant to be condescending? You are affiliated with Caddy and ought to mention that when you promote your own software. https://news.ycombinator.com/item?id=16687686 This is not a competition. Caddy is not even in the same realm as Redbean. Redbean is a multi-platform binary that doubles as a ZIP. It's roughly 1500 times smaller than Caddy too. > different usecases Right…

> Is that smile at the end of your first sentence meant to be condescending?

What? Of course not! You're reading way too much into that. It's simply enthusiasm. I read about Redbean and it being a single file webserver and the first thing to come to mind is Caddy, as "prior art".

Like I said, different usecases; Caddy is a general purpose webserver which has automatic certificate management, H2/H3 support, reverse proxy, file server, a strong plugin system, the list goes on. Of course it'll be bigger in size. Redbean is super cool and does have the advantage in file size and portability, clearly, but it is essentially a single-purpose tool. And there's nothing wrong with that.

Re: Show HN: Redbean – Single-file distributable web server

#126

If you want to learn more how these things work I'd highly suggest going through the PoC||GTFO archive ( https://github.com/angea/pocorgtfo/blob/master/README.md ) and check out entries by Ange Albertini or entries named like "This ZIP is also a PDF".

I came here for this. E.g. https://www.alchemistowl.org/pocorgtfo/pocorgtfo19.pdf

"This file, pocorgtfo19.pdf, is valid as a PDF document, a ZIP archive, and a HTML page. It is also available as a Windows PE executable, a PNG image and an MP4 video, all of which have the same MD5 as this PDF."

Re: Show HN: Redbean – Single-file distributable web server

#129

I really like your view of the world, that programs should be portable, tiny, and just work. The slamming of so much functionality into a zip file is inspiring. Would it be possible to do something similar with Free Pascal, allowing the recreation of something like Turbo Pascal, except really, really portable .com output?

[deleted]

Re: Show HN: Redbean – Single-file distributable web server

#130
post #55
post #45

Odd, I'm getting $ ./printimage.com image.jpg run-detectors: unable to find an interpreter for ./printimage.com

Author here. That error happens if you have binfmt_misc enabled. The solution is simple: sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:' >/proc/sys/fs/binfmt_misc/register" I intend to upstream a patch with the Linux kernel so it can do this automatically. If any kernel devs are reading, please email me!

Instead of sudo sh -c to sudo the redirects, consider echo 'abcde' |sudo tee /proc/bla. Less nesting :)
Post reply on HN