Live data from Hacker News

Nerd Sniped by BINFMT_MISC

blog.jessfraz.com

21–30 of 36 posts

Re: Nerd Sniped by BINFMT_MISC

#21
I love the idea of executable single-file containers. I'd take it even farther. I've recently discovered a way to make polyglot scripts that are simultaneously executable on Linux, Mac, and Windows[1]. It would be pretty easy to embed binaries in these scripts, and by simply embedding a binary for each OS you'd have a cross-platform binary single-file application.

Of course three copies of the binary is not ideal, but it shouldn't even be necessary. With some deep hacking the platform-specific code could be minimized and the rest of the binary could be shared. Wouldn't it be fun to have truly platform-independent binary executables?

[1] https://gist.github.com/jdarpinian/6860ddfd92b5b458a20ab6055...

Re: Nerd Sniped by BINFMT_MISC

#22

Too bad the more narrow minded segment of the HN population appears to have buried this one out of spite.. because this is some super pro badass shit, packaged in a hilarious format by jessfraz. Guess it's not everyone's kind of humor, a real tradgedy if you ask me. Can you imagine a future where you don't have to install runtimes to run things anymore because they are all distributed with everything you need? It wou…

What you are describing is just a statically linked binary, the world of computing moved away from this well before I started my career but there are pros and cons about it, not only related to disk space.

Re: Nerd Sniped by BINFMT_MISC

#23
post #22

Too bad the more narrow minded segment of the HN population appears to have buried this one out of spite.. because this is some super pro badass shit, packaged in a hilarious format by jessfraz. Guess it's not everyone's kind of humor, a real tradgedy if you ask me. Can you imagine a future where you don't have to install runtimes to run things anymore because they are all distributed with everything you need? It wou…

What you are describing is just a statically linked binary, the world of computing moved away from this well before I started my career but there are pros and cons about it, not only related to disk space.

what are the pros of dynamically linked binaries, not related to disk and memory usage?

Re: Nerd Sniped by BINFMT_MISC

#24
post #23
post #22

Earlier quoted context omitted.

What you are describing is just a statically linked binary, the world of computing moved away from this well before I started my career but there are pros and cons about it, not only related to disk space.

what are the pros of dynamically linked binaries, not related to disk and memory usage?

when a security vulnerability is found, you can fix the relevant library without recompiling all the binaries that are linked to it.

Re: Nerd Sniped by BINFMT_MISC

#25
post #23
post #22

Earlier quoted context omitted.

What you are describing is just a statically linked binary, the world of computing moved away from this well before I started my career but there are pros and cons about it, not only related to disk space.

what are the pros of dynamically linked binaries, not related to disk and memory usage?

[deleted]

Re: Nerd Sniped by BINFMT_MISC

#26

Too bad the more narrow minded segment of the HN population appears to have buried this one out of spite.. because this is some super pro badass shit, packaged in a hilarious format by jessfraz. Guess it's not everyone's kind of humor, a real tradgedy if you ask me. Can you imagine a future where you don't have to install runtimes to run things anymore because they are all distributed with everything you need? It wou…

> Too bad the more narrow minded segment of the HN population appears to have buried this one out of spite.. because this is some super pro badass shit, packaged in a hilarious format by jessfraz. Guess it's not everyone's kind of humor, a real tradgedy if you ask me.

I don't know how other users feel, but I feel really annoyed when I have to read this kind of vague attack on the HNers. The fact is that, fortunately, HN is not an exteded circlejerk of badass things and weird humour.

For the rest of your comment, I haven't read the article yet, but the phrase "a future where you don't have to install runtimes to run things anymore because they are all distributed with everything you need?" makes me frighthened. That would mean that the same piece of code but slightly different repeated many times in a computing environment. Why would I need multiple versions of Python 3.5 or Ruby 2.3 is beyond me, except for development, where there are tools to manage multiple versions of interpreters and runtimes. And when Python 3.5 is declared vulnerable to the next big security vulnerability, switching to the hypothetical Python 3.5.1 would be a breeze, and I'd be secure; whereas with every package having its stuff vendored within its opaque format, you never know what's outdated and/or vulnerable.

Re: Nerd Sniped by BINFMT_MISC

#27

Earlier quoted context omitted.

An excellent and helpful correction. But security-wise chroot/runc is even worse than Xen, since the attack surface is so much bigger! https://nvd.nist.gov/vuln/search/results?adv_search=false&fo... https://nvd.nist.gov/vuln/search/results?adv_search=false&fo...

See first comment about how it's a pivot root and if you are going to claim containers are insecure please first capture the flag on https://contained.af or gfy

Thanks jessie and cyphar for making HAN great again!

Re: Nerd Sniped by BINFMT_MISC

#28
post #15

Earlier quoted context omitted.

You need to be root to change binfmt_misc's configuration, so it's not analgous to Windows' file associations (which the user can also change). I also believe that xdg-open (and the XDG scheme) is more similar to Windows' file associations than binfmt_misc, since XDG is more of a user-facing thing.

I believe you need to be a on an admin account in Windows to change global file associations. In fairness though, most people are logged in as an Administrator.

You can also have user file associations on Windows though.

Re: Nerd Sniped by BINFMT_MISC

#29
FWIW, you don't need to fiddle around with binfmt_misc (which requires root permissions) to execute a Go program as a script. The following shebang works:

   ///bin/true; exec /usr/bin/env go run "$0" "$@"
See https://stackoverflow.com/a/30082862/334761 for detailed explanation what's going on there. The only downside is that all exit codes != 0 get mapped to exit code 1 by `go run`. It will show the original exit code on stderr instead.

Re: Nerd Sniped by BINFMT_MISC

#30

I love the idea of executable single-file containers. I'd take it even farther. I've recently discovered a way to make polyglot scripts that are simultaneously executable on Linux, Mac, and Windows[1]. It would be pretty easy to embed binaries in these scripts, and by simply embedding a binary for each OS you'd have a cross-platform binary single-file application. Of course three copies of the binary is not ideal, bu…

I don't really see this.

What about packaging - e.g. this file having a proper icon on Windows? What about distribution via the app market platforms?

How do I go about upgrading the application?

Post reply on HN