HNHacker News
TopNewBestAskShowJobs

Tigress8780

49 karma · joined October 20, 2022

submissionscomments
Tigress8780··on A kernel developer plays with Home Assistant
Even though ESPHome has warnings about using WiFi and Bluetooth proxy together being unstable, I've found it to be much better in terms of stability and performance than the Intel Bluetooth adapter connected to my Home Assistant system. BlueZ is probably more complex and less mature.
Tigress8780··on IPv6 Is Hard
We have this thing called NATMap: https://github.com/heiher/natmap

It gives you a public dynamic IP + port combination if your network is NAT1 all the way to the internet. Both IP & port being dynamic kinda complicates things, they ended up inventing a new DNS record type, "IP4P" where IPv4 address and port are encoded as an IPv6 address, and modified WireGuard/OpenVPN clients are required.

We are supposed to solve this using SRV records, but I don't think many consumer-facing apps can do this.

Tigress8780··on Xiaomi Home Integration for Home Assistant
A fresh HAOS VM can not successfully boot without internet access, maybe due to how they are managing everything with Docker within HAOS? I noticed this because the VM was accidentally put into a network that does not have stable internet, and I kept wondering why it didn't boot.

Really hope that there is a fully offline solution.

Tigress8780··on Jiff: Datetime library for Rust
Rust will determine what `parse` does based on the inferred return type (which is being explicitly set to `Timestamp` here). This is possible when the return type has `FromStr` trait.
Tigress8780··on DHCPv6-PD – First Steps
It probably is. I remember that putting a /72 into OpenWRT's `ip6prefix` field actually breaks the whole network stack (including IPv4, the interface no longer has any address assigned to it).
Tigress8780··on DHCPv6-PD – First Steps
SLAAC is fine, until you somehow get a subnet smaller than /64 on your router, in which case SLAAC completely breaks. I understand why SLAAC has such a limitation, but this is what we get.

It's not optimal, but the upstream network provider does not budge, and now everything except Android devices get IPv6 address via DHCPv6.

Tigress8780··on Bypassing the WiFi Hardware Switch on the Lenovo X201 (2023)
That's probably the best thing we can do (for now) for a PCIe device. PCIe hotplug [1] is a thing, but your (badly-written) WiFi kernel driver is probably not designed for that.

[1] https://lwn.net/Articles/767885/

Tigress8780··on Polars
Given examples, Copilot can generate code for extremely rare languages or data structures. For example, it worked fine when I was writing for an obscure scripting language found in a railway simulation game.
Tigress8780··on DeskHop – Fast Desktop Switching
I recently had the idea of making similar hardware with ESP32 (some of them has USB hardware). You may lose mouse acceleration, but many do not like this to begin with, so it's fine.

Does absolute mouse work correctly when two systems have very different (total) resolution? For example, one is a laptop with a single screen, and another one is a desktop with three screens.

Tigress8780··on Apple allows some iOS apps to track user locations via lists of nearby SSIDs
These "super apps" get special treatment everywhere.

Many phone manufacturers even automatically grant certain permissions when these apps are installed (the list is sometimes hard-coded into the system), since there are people who do not understand what is "permission", and they blame the phone manufacturer for not being able to use WeChat/Alipay.

Tigress8780··on Firefox tooltip bug fixed after 22 years
This still happens on my Windows 11 machines (the tooltip stays there unless you move the mouse over the same icon again), but only to a small number of applications. Makes me wonder if they are using a different set of API to set up their tray icons.
Tigress8780··on What it takes to pass a file path to a Windows API in C++
I buy digital Japanese Doujin music on sites like booth.pm, and their provided zip files extracts "beautifully" on Linux if you simply `unzip` them.
Tigress8780··on What it takes to pass a file path to a Windows API in C++
On desktop clients, they fetch the cursor bitmap and renders it locally, then send absolute movements. For mobile clients, it is possible (and better) to send relative coordinates and let Windows accelerate that action, since touch events are not accelerated. Doing this acceleration actually makes the client feel more like a laptop touchpad if you are using relative mode.
Tigress8780··on What it takes to pass a file path to a Windows API in C++
Talking about how strange the current state of Windows API is, there are actually 3 different APIs that can move the mouse cursor: SetCursorPos [1], SendInput [2], and mouse_event [3].

Applications might react differently to input events generated by these APIs. For example, in Windows 11's display settings, the position of screens can not be dragged if input events are coming from SetCursorPos, but works fine if using SendInput. Microsoft's own PowerToys uses a mixture of both under certain (complex) conditions, but I never found out the actual difference between them.

I was writing an application that sends mouse input from a Linux machine to a Windows one (similar to Synergy), and I originally received mouse movement events that are accelerated (with user or system-defined acceleration factors), and I found out that there are no Windows API (three of them) that accepts relative movements without further acceleration (i.e. Windows will always apply further acceleration, making the mouse hard to use). I ended up directly hook into evdev to get raw mouse movements and let Windows accelerate them.

[1] https://learn.microsoft.com/en-us/windows/win32/api/winuser/... [2] https://learn.microsoft.com/en-us/windows/win32/api/winuser/... [3] https://learn.microsoft.com/en-us/windows/win32/api/winuser/...

Tigress8780··on What if OpenDocument used SQLite? (2014)
The way our "MongoFS" was organized is actually also low quality and probably would fall apart pretty quickly if used as a serious web service. However, it works if you try to quickly deploy and serve millions of files to a small number of clients.

Our use case was a Maven mirror for disconnected environment that only contains metadata (i.e. lots of small XML files, without the actual jar). We already had a MongoDB service for some other JSON data, so here we are.

Tigress8780··on What if OpenDocument used SQLite? (2014)
Once we had to ship millions of extremely small files to our customer, we ended up throwing them into a MongoDB and serve them with a web server. It worked great.

We tried to use an image of traditional filesystems (ext4 and fat32), but with most files being under 1 KiB, it was super wasteful.

Tigress8780··on Introduction to Immutable Linux Systems
Well, it's never the same 20%, which is precisely why we have plugins and extensions even outside of the Linux GUI bubble. This include IDEs, browsers, office suites, media production software (e.g. VST), and of course engineering software. For a complex software product, it is never possible to include batteries for everyone.

FreeCAD might not come with enough battery to power a full workflow, but I have also seen entire engineering firm not able to work without a particular AutoCAD plugin.

Tigress8780··on Why you might want async in your project
IO is not a part of the async runtime contract (I don't know if this is good or bad), and Tokio & futures famously have different `Async{Read,Write}` traits. I once had to do this [0] to adapt between them.

This means that any crate that uses IO will be bound to a limited number of Runtimes. Everything being Tokio-only is pretty bad (though Tokio itself is great), but here we are...

[0] https://github.com/bluejekyll/trust-dns/pull/1373#issuecomme...

Tigress8780··on NetMaker: Connect Everything with a WireGuard VPN
Tinc works, but is not really stable for my use case: strange network environment thanks to my school. It frequently falls into infinite loops, dropping all packets and fully use a CPU core (on Windows, Linux looks fine). It seems stable on an all-Linux network, but the moment a Windows client is added, things can go wrong.

It also does not really have a decent mobile client.

Tigress8780··on JPEG XL: How it started, how it’s going
That metadata is usually put around the end of the file for compatibility reasons, but one can use ffmpeg's `-movflags faststart` option to move it to the beginning (very common in files that are meant to be served on the web).
Tigress8780··on The .zip TLD sucks
Official OpenWRT builds do this by default (though you can turn that off in DNS settings), but many newer consumer routers that use OS based on OpenWRT might not have the option.
Tigress8780··on Why xHE-AAC is being embraced at Meta
An Opus frame can be as short as 2.5 ms [1] (at this packet size the effect of network buffering can be pretty obvious), but I use a frame size of 20 ms anyway when capturing on Windows, since this is what `cpal` gives me.

[1] https://opus-codec.org/docs/opus_api-1.3.1/group__opus__enco...

Tigress8780··on Finding and exploiting vulnerabilities in H.264 decoders [pdf]
AFL is great for most file formats (e.g. ELF), but probably not suitable for video formats like H.264, which uses complex encoding even for things as simple as frame width/height in the header (see things like ue(v) and CAVLC).

It will take ages for AFL to generate a valid H.264 NALU that isn't rejected outright.

Tigress8780··on Real-Time Video Processing with WebCodecs and Streams
I have opened an issue on GitHub [1], we can continue there.

[1] https://github.com/webrtc-rs/webrtc/issues/426

Tigress8780··on Real-Time Video Processing with WebCodecs and Streams
Does TCP actually works on webrtc-rs and Chrome? ADB does not support UDP at all. If it works, then having the ability to gather loopback interface is certainly a plus for my particular use case.
Tigress8780··on Real-Time Video Processing with WebCodecs and Streams
I was able to achieve a latency of ~30ms with a custom Android client by dropping outdated frames, but I could not find out how to do this with WebRTC, since its buffering and rendering is entirely controlled by the browser with almost no tuning knobs.

WebRTC as a technology is also quite complex, providing less flexibility than a custom TCP or WebSocket stream. For example, to further reduce latency, it is possible to tunnel TCP traffic through USB with the help of Android's debugging interface, but this interface does not allow tunneling of UDP, nor does webrtc-rs allows listening on 127.0.0.1 (it is hardcoded to ignore the loopback interface).

Insertable streams looks interesting, but it seems that Firefox and Safari (especially on iOS, where I can not easily relese a native client) does not support it at all, while WebCodecs is at least experimental.

Tigress8780··on Real-Time Video Processing with WebCodecs and Streams
Here we are again, locking useful features behind HTTPS :)

Background: I have been working on a software that creates and streams extra virtual displays via the local network (like Duet Display or Apple's sidecar), and the easiest way to get started for everyone is to stream to a web browser.

WebRTC is kinda easy to implement thanks to webrtc-rs, but has unacceptable latency as I do not have control over whether or when exactly a frame is rendered (I need to be able to drop outdated frames). This API has the potential to do exactly what I want, but:

* It is not possible to connect to a local server if the viewer page is served via HTTPS, as the local server won't have HTTPS.

* It is possible to generate CAs and certificates locally and instruct users to install them, but I don't think that anyone out there will like this solution.

* We have WebTransport that might be able to do this, but it is an overly complex technology that uses HTTP/3 (plus no support on anything but Chromium), and tools like localtls[1] that requires internet connection and my own domain (I would really want this tool to be able to run completely offline).

Modern web APIs are kinda useless when you don't have internet, but the ship has sailed.

[1] https://github.com/Corollarium/localtls

Tigress8780··on How to improve Python packaging
Poetry can not give you things that do not (always) exist in the ecosystem, like properly declared dependencies [1], which are a must in most other package managers.

Poetry can be painfully slow if you happen to depend on many packages that only use `setup.py` to define dependencies.

[1] https://python-poetry.org/docs/faq/#why-is-the-dependency-re...

Tigress8780··on Introducing passkeys in Chrome
While WebAuthn is an open standard, but the fact that it explicitly provides attestation API [1][2] and related database that can be used to verify devices [3] is already worrying.

Site owners really have the option to lock you into one or a dozen of ecosystems should they decide to. It is entirely possible that your home-made hardware key or software password manager will be disallowed from logging into Google or Apple.

For example, Cloudflare actively uses the attestation feature [4] to replace captchas, and they probably only allow a few manufacturers.

[1] https://developer.mozilla.org/en-US/docs/Web/API/Web_Authent...

[2] https://developers.yubico.com/WebAuthn/WebAuthn_Developer_Gu...

[3] https://fidoalliance.org/metadata/

[4] https://blog.cloudflare.com/introducing-cryptographic-attest...