HNHacker News
TopNewBestAskShowJobs

Klasiaster

1,389 karma · joined September 25, 2014

submissionscomments
Klasiaster··on Show HN: Fleet – Experimental build tool for Rust that’s up to 5x faster
Sounds interesting, do you want to share the ~/.cargo/config.toml entries?
Klasiaster··on My upgrade to 25 Gbit/s Fiber To The Home
The speed aside there are multiple other positive aspects mentioned that serve as a role model for larger providers, sadly…
Klasiaster··on Show HN: Rust userland container image with nsh, coreutils, ripgrep
This is a small experiment inspired by the coreutils Rust port, wondering on how far one can get if only Rust tools are used. Currently it only consists of a tiny selection of statically compiled binaries using musl libc but in the future I want to try to compile without musl and use relibc or the mustang approach of skipping libc entirely. Also, currently a lot of common tools are lacking, there is no "ip" nor "ps" installed and a "curl" drop-in is also not present yet. See the TODO list ;)
Klasiaster··on Podman Desktop Companion GUI – Parity on All Major Operating Systems
Some extra args needed, though:

  podman run -ti --rm --security-opt seccomp=unconfined --security-opt label=disable --cap-add SYS_ADMIN --env STORAGE_DRIVER=vfs quay.io/podman/stable sh -c 'podman run -ti --rm --security-opt seccomp=unconfined --security-opt label=disable --cap-add SYS_ADMIN --env STORAGE_DRIVER=vfs quay.io/podman/stable sh -c "podman run --rm hello-world"'
Klasiaster··on Podman Desktop Companion GUI – Parity on All Major Operating Systems
It's possible to run podman in podman in podman in …, which is nice if you containerize the build system but don't want to pack everything into one large image nor want to divide it into stages called by some main script on the host.
Klasiaster··on Podman Desktop Companion GUI – Parity on All Major Operating Systems
There is "podman buildx build …" which sounds like what you are searching for?
Klasiaster··on Podman Desktop Companion GUI – Parity on All Major Operating Systems
The "podman.service" systemd unit takes care of restarting containers that were marked so.
Klasiaster··on Bore: A simple CLI tool for making tunnels to localhost
How about UPNPC when your local gateway supports it?

    sudo apt install miniupnpc
    upnpc -r 22 57922 TCP # forward 57922 on public address to this client's port 22
Together with something like https://dynv6.com/ you even get a subdomain that you can point to the public address:

    curl "https://ipv4.dynv6.com/api/update?ipv4=auto&token=$TOKEN&zone=$ZONE.dynv6.net"
    curl "https://ipv6.dynv6.com/api/update?ipv6=auto&token=$TOKEN&zone=$ZONE.dynv6.net"
Klasiaster··on Show HN: A tiny solar-powered server only awake during the day
The real obstacle I see for these kind of projects is exposing them to the Internet. Standard wifi routers are horrible even with UPNP… The promise of having a globally reachable IPv6 address is also destroyed by the complexity/inability to have the wifi router forward something like port 80 traffic.
Klasiaster··on QOI – The Quite OK Image Format
Essentially good compression needs prediction. Here the previous pixels are used but it seems only from the row. Given that this is a linear decompression (not a progressive) it would help a lot to instead of looking just at the row, also look at the above row where the other previously seen neighbor pixels are. With something like arithmetic coding and only the previously seen neighbor pixels as prediction contexts with some tweaking one can quickly get better compression than PNG offers. Doing this in a short C implementation is left to the reader ;)
Klasiaster··on Farewell, Elementary
The problem is money, they could have set up a foundation instead of a company and while similar it already steers things into another direction that a for-profit company. They could have still benefitted from the foundations assets in the form of contractors, or even employees, I believe, but the whole topic of being acquired is sidestepped.
Klasiaster··on Lapsus$ and SolarWinds hackers both use the same old trick to bypass MFA
No one external should be able to trigger this, it should only be the owner that takes action of, e.g., opening a code generator or requesting an SMS/phone call through dialing from the right number.
Klasiaster··on Python 3.11 in the Web Browser
wasmtime, Standalone JIT-style runtime for WebAssembly, using Cranelift: https://github.com/bytecodealliance/wasmtime

wasm3, WebAssembly interpreter: https://github.com/wasm3/wasm3

… and many more

Klasiaster··on Running GUI apps within Docker containers
For getting a proper Wayland session I recommend doing this with Phosh and wayvnc (WLR_BACKENDS=headless WLR_LIBINPUT_NO_DEVICES=1 as env vars for starting Phosh and then "wayvnc 0.0.0.0 7050").

You can even have a whole systemd setup in a container using this VNC backend, here in this Dockerfile with CPU rendering (LIBGL_ALWAYS_SOFTWARE=1) to avoid requring a GPU:

    FROM docker.io/fedora
    RUN dnf -y update && dnf install -y phosh phoc wayvnc sudo socat iproute mutter xorg-x11-server-Xwayland dbus-x11 mesa-libgbm mesa-libOpenCL mesa-libGL mesa-libGLU mesa-libEGL mesa-vulkan-drivers mesa-libOSMesa mesa-dri-drivers mesa-filesystem gnome-shell gnome-terminal
    RUN mkdir -p /etc/systemd/system/phosh.service.d && echo -e '\
    [Unit]\n\
    ConditionPathExists=\n\
    [Service]\n\
    Environment=WLR_BACKENDS=headless\n\
    Environment=WLR_LIBINPUT_NO_DEVICES=1\n\
    StandardInput=null\n\
    TTYPath=/dev/console\n\
    TTYReset=no\n\
    TTYVHangup=no\n\
    TTYVTDisallocate=no\n\
    ExecStart=\n\
    ExecStart=/usr/bin/phoc --exec "bash -lc \"/usr/libexec/phosh --unlocked & wayvnc 0.0.0.0 7050\""\n\
    '  > /etc/systemd/system/phosh.service.d/10-headless.conf
    RUN systemctl enable phosh.service
    # Work around a problem with a missing dbus.service unit file
    RUN mkdir -p /etc/systemd/system && ln -fs /usr/lib/systemd/system/dbus-broker.service /etc/systemd/system/dbus.service
    # Mask udev instead of making /sys/ read-only as suggested in https://systemd.io/CONTAINER_INTERFACE/
    RUN systemctl mask systemd-udevd.service systemd-modules-load.service systemd-udevd-control.socket systemd-udevd-kernel.socket
    ENV container=docker
    RUN groupadd --system sudo
    RUN useradd --create-home --shell /bin/bash -G sudo user
    RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
    ENV LIBGL_ALWAYS_SOFTWARE=1
    RUN sudo -u user gsettings set sm.puri.phoc auto-maximize false
    EXPOSE 7050
    # Set up a /dev/console link to have the same behavior with or without "-it", needs podman run --systemd=always
    CMD [ "/bin/sh", "-c", "if ! [ -e /dev/console ] ; then socat -u pty,link=/dev/console stdout & fi ; exec /sbin/init" ]
Use as: podman run --systemd=always --rm -p 7050:7050 imagename
Klasiaster··on Kani Rust Verifier – a bit-precise model-checker for Rust
Nice, I just would have liked to get all these different verification tools combined under the same interface, just being different backends as drafted by the rust verification tools work of project oak: have "cargo verify" as common command and use common test annotations, allowing the same test to be verified with different backends or just fuzzed/proptested (see https://project-oak.github.io/rust-verification-tools/using-... and https://project-oak.github.io/rust-verification-tools/using-...).

The model checking approach seems to be a bit limited regarding loops. There are also abstract interpreters, such as https://github.com/facebookexperimental/MIRAI, and symbolic executers, such as https://github.com/dwrensha/seer or https://github.com/GaloisInc/crucible.

Overall I believe this space would benefit from more coordination and focus on developing something that has the theoretical foundations to cover as many needs as possible and then make a user-friendly tool out of it that is endorsed by the Rust project similar to how Rust analyzer is the one language server to come.

Klasiaster··on Meld is a visual diff and merge tool targeted at developers
On the terminal I find `ydiff -s --wrap --width=0` very good for a comprehensible side-by-side diff: https://github.com/ymattw/ydiff

I definded this wrapper script ~/bin/git-ydiff-s:

    #!/bin/sh
    git diff "$@" | ydiff -s --wrap --width=0

with which you can do `git ydiff-s` in your repos easily.
Klasiaster··on QuickJS JavaScript Engine
There is also duktape which got some traction: https://wiki.duktape.org/projectsusingduktape

Not sure how they exactly compare - seems QuickJS supports a newer JS standard?

Klasiaster··on My thoughts on writing a Minecraft server from scratch in Bash
Besides the nostalgia, the website font is so easy on my eyes I'm considering to give up space and start to use it as well
Klasiaster··on Easily handle CLI operation via Python instead of regular Bash programs
Or pz could be a lightweight wrapper that speaks to a python server or starts a new one if there isn't yet. The server could end after X seconds of not getting new requests.
Klasiaster··on WebVM: Server-less x86 virtual machines in the browser
The VM could have its own TCP/IP stack, possibly with a SLIRP layer for translation of connections to the outside. Internet connectivity can be done by limiting it to AJAX, or forwarding the packets to a proxy (something like http://artemyankov.com/tcp-client-for-browsers/), or including a Tor client that connects to a Tor bridge, etc.
Klasiaster··on WebVM: Server-less x86 virtual machines in the browser
Have you tried compiling Linux as User Mode Linux with emscripten? I imagine something like this https://github.com/nabla-containers/nabla-linux would run on wasm, too?
Klasiaster··on WebVM: Server-less x86 virtual machines in the browser
So, this is a reimplementation of the Linux ABI and no Linux kernel source is involved, right?
Klasiaster··on Nasm – A cross-platform x86 assembler with an Intel-like syntax
I think the main reason is for supporting both AT&T and Intel syntax at the same time.
Klasiaster··on Nasm – A cross-platform x86 assembler with an Intel-like syntax
There is also yasm https://github.com/yasm/yasm which has different goals but doesn't seem to be that active anymore.
Klasiaster··on Who Got It Right: Orwell or Huxley?
Fahrenheit 451 from Ray Bradbury gives the perfect mix in my opinion: being semi-/pseudo-happy with the drugs and entertainment and when you try to leave that path, you face oppression in increasing degree.
Klasiaster··on Pwnkit: Local Privilege Escalation in polkit's pkexec
It won't be a child process because PID 1 will actually start this unit. Yes, without setuid because PID 1 takes the request from the unprivileged systemd-run client.
Klasiaster··on Pwnkit: Local Privilege Escalation in polkit's pkexec
Setuid programs like pkexec or sudo are hard to get right… Here an example of using systemd-run (not setuid, and the wrapper script neither) for something similar like sudo (but it uses a systemd unit instead of a direct child process in the same process group):

https://gist.github.com/pothos/73dd4f7694acc3b6bbed614438f6e...

Since polkit is used (but not the setuid pkexec, this was the point of this exercise) there is still one setuid binary invoked for the PAM check, though.

Klasiaster··on Pwnkit: Local Privilege Escalation in polkit's pkexec (CVE-2021-4034)
Here for the pkexec/sudo case done using systemd-run - the script is similar to sudo and doesn't need to be setuid:

https://gist.github.com/pothos/73dd4f7694acc3b6bbed614438f6e...

Klasiaster··on Pwnkit: Local Privilege Escalation in polkit's pkexec (CVE-2021-4034)
> You cannot accomplish sudo without setuid.

Right, process group and being child process gets lost when following this route. I think it's a compromise that is acceptable in many cases.

> [polkit-agent-helper-1] will fail to check your password because most mechanisms for doing so, like the usual pam_unix, are only accessible to root.)

That's what I mean, the helper itself could be unprivileged and hand the password over to a privileged daemon that does the check.

Klasiaster··on Pwnkit: Local Privilege Escalation in polkit's pkexec (CVE-2021-4034)
Nope because pkexec already is a privileged process because it is a setuid binary. Being a setuid binary instantly makes it a privileged process, it's not related to whether it's similar to sudo and does authorization. What I'm saying is that the pkexec process itself doesn't need to be setuid, it should be an unprivileged process (also true for the /usr/libexec/polkit-agent-helper-1 helper it uses which is a setuid binary but doesn't really have to be when splitting this up in a daemon process).

Edit: Maybe to make it clear, yes, in theory the polkit project does follow the scheme of a privileged daemon process and unprivileged clients but in practice it doesn't because of the setuid polkit-agent-helper-1 and setuid pkexec programs.

← PreviousPage 4 of 11Next →