HNHacker News
TopNewBestAskShowJobs

chenxiaolong

532 karma · joined June 12, 2020

submissionscomments
chenxiaolong··on FEMA and FCC Plan Nationwide Emergency Alert Test for Oct. 4
In case anyone is curious, this is the commit that implements the change: https://github.com/GrapheneOS/platform_packages_apps_CellBro...

EDIT: For folks with rooted devices, all alerts can be disabled with:

    adb shell su -c 'pm disable com.google.android.cellbroadcastreceiver'
and reenabled with:

    adb shell su -c 'pm enable com.google.android.cellbroadcastreceiver'
For folks on custom Android builds (or older stock Android builds without APEX module support), the package name is `com.android.cellbroadcastreceiver` (without the `.google`).
chenxiaolong··on Yt-Dlp Commands: The Complete Tutorial for Beginners
I don't know the details of what happened between the two projects, but according to Wikipedia [1], libav was abandoned a bit over 5 years ago. Looks like their website (and main git repo) no longer exist.

[1] https://en.wikipedia.org/wiki/Libav

chenxiaolong··on An exabyte of disk storage at CERN
In case anyone is curious, I took a quick look at my copy of the set:

- The Fellowship of the Ring

    - Theatrical:      66.7 GiB video @ 53.5 Mbps, 3.81 GiB English audio @ 3055 kbps

    - Extended disc 1: 51.5 GiB video @ 69.8 Mbps, 2.22 GiB English audio @ 3000 kbps

    - Extended disc 2: 56.8 GiB video @ 66.4 Mbps, 2.56 GiB English audio @ 2989 kbps
- The Two Towers

    - Theatrical:      72.4 GiB video @ 57.8 Mbps, 3.90 GiB English audio @ 3108 kbps

    - Extended disc 1: 49.8 GiB video @ 66.9 Mbps, 2.30 GiB English audio @ 3089 kbps

    - Extended disc 2: 52.6 GiB video @ 58.4 Mbps, 2.73 GiB English audio @ 3032 kbps
- The Return of the King

    - Theatrical:      73.2 GiB video @ 52.1 Mbps, 4.33 GiB English audio @ 3086 kbps

    - Extended disc 1: 59.2 GiB video @ 66.3 Mbps, 2.66 GiB English audio @ 2985 kbps

    - Extended disc 2: 61.5 GiB video @ 64.9 Mbps, 2.80 GiB English audio @ 2957 kbps
chenxiaolong··on Linux terminal emulators have the potential of being much faster
Happy to see more folks working on fast terminal emulators!

Earlier this year, I went through every single terminal emulator in Arch's repos and tested using them while compiling AOSP (Android). AOSP's Soong build system does not produce a lot of scrollback, but it does overwrite a line containing the progress ~150k times (once per source file). Alacritty was the only one that was both responsive and didn't eat up a CPU core (staying under 10%). Wezterm, Kitty, Foot, and Konsole stayed responsive, but used 100% CPU on a single core, causing a measurable impact to the build speed (though Konsole 23.08 seems to have regressed and now sometimes locks up). Most of the others became unresponsive or had multiple second delays trying to do anything (eg. ^C, opening new tab, etc.).

chenxiaolong··on Android 14 adds support for using your smartphone as a webcam
I don't think this is possible, at least not directly. My understanding is that there's a special optimized path for CameraConstrainedHighSpeedCaptureSession recording to MediaCodec surfaces backed by a hardware encoder. If you capture to a different type of surface, the frame rate will likely drop to 60 or lower (assuming it's even allowed--I have not tested).

I'm not too familiar with image analysis, but if it's acceptable to work on lossy frames and to take a small hit to latency, you could record to a MediaCodec hardware encoder and then immediately send the output to another MediaCodec instance to decode it.

chenxiaolong··on Android 14 adds support for using your smartphone as a webcam
scrcpy is awesome! Native support for streaming the camera directly (vs. streaming a screen capture of the camera app) is coming soon: https://github.com/Genymobile/scrcpy/pull/4213

For folks willing to build from source, I have an additional commit on top of the PR (linked in the comments) that enables support for Android's constrained high speed capture mode, allowing 120fps/240fps camera streaming. Not the most useful for meetings, but enables things like capturing high frame rate mixed reality VR footage. As far as I'm aware, there's no other Android webcam app, proprietary or open source, that can do anything above 60fps.

chenxiaolong··on Kopia: Fast and secure open-source backup software
Kopia is great, though it's worth noting for folks on Linux: non-UTF-8 paths aren't stored correctly [1] and xattrs aren't stored [2]. While most folks probably won't care about the former, the latter can could cause issues (eg. losing SELinux labels makes it difficult to restore a backup of the root filesystem on distros that use SELinux).

[1] https://github.com/kopia/kopia/issues/1764

[2] https://github.com/kopia/kopia/issues/544

chenxiaolong··on I booted Linux 293k times in 21 hours
I tested with 6.4.0-0.rc6.48.fc39.x86_64 + f31dcb152a3 revert and all 10000 iterations succeeded (same hardware and environment as my previous post).

To guarantee that there's absolutely no other difference between the two tests, I took the source RPM, added the commit f31dcb152a3 diff + `%patch -P 2 -R`, and built the kernel RPM with mock.

chenxiaolong··on I booted Linux 293k times in 21 hours
I gave that reproducer a try and it failed after 1968 iterations.

* CPU: Intel(R) Core(TM) i9-9900KS

* qemu: qemu-kvm-7.2.1-2.fc38.x86_64

* host kernel: 6.3.6-200.fc38.x86_64

* guest kernel: 6.4.0-0.rc6.48.fc39.x86_64 (grabbed latest from mirrors.kernel.org/fedora since fedoraproject.org DNS is down and I can't access koji)

Log:

    <...>
    1966... 1967... 1968...

    [    0.075343] LSM: initializing lsm=lockdown,capability,yama,bpf,landlock,integrity
    [    0.075514] Yama: becoming mindful.
    [    0.075514] LSM support for eBPF active
    [    0.075514] landlock: Up and running.
    [    0.075514] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
    [    0.075514] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
    [    0.075514] x86/cpu: User Mode Instruction Prevention (UMIP) activated
    [    0.075514] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
    [    0.075514] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
    [    0.075514] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
    [    0.075514] Spectre V2 : Mitigation: Enhanced / Automatic IBRS
    [    0.075514] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
    [    0.075514] Spectre V2 : Spectre v2 / PBRSB-eIBRS: Retire a single CALL on VMEXIT
    [    0.075514] RETBleed: Mitigation: Enhanced IBRS
    [    0.075514] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier
    [    0.075514] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl
    [    0.075514] TAA: Mitigation: TSX disabled
    [    0.075514] MMIO Stale Data: Vulnerable: Clear CPU buffers attempted, no microcode
    [    0.075514] SRBDS: Unknown: Dependent on hypervisor status
    [    0.075514] Freeing SMP alternatives memory: 48K
    *** ERROR OR HANG ***
I'll try reverting f31dcb152a3 and testing again later. Happy to test anything else if needed.
chenxiaolong··on T-Mobile Suddenly Lays Off over Two-Thirds of Their T-Force Support Staff
It sucks that these folks are getting laid off. In all my past interactions with them, they've been quick and helpful and never felt like they were just following a script.

I submitted this because this might potentially affect users dealing with the Samsung + T-Mobile SIM unlocking shenanigans. For folks unaware, when you purchase a T-Mobile branded Samsung phone from samsung.com (or any retail store), the devices are still SIM-locked, even if you pay in full. However, unlike the same exact phone purchased from T-Mobile directly, T-Mobile isn't aware of the IMEI, so the built in "Device unlock" feature won't ever work. This has been an issue since at least 2018 and is still present with the Galaxy S23 series. Samsung refuses to help since the OS requires the unlock authorization to come from T-Mobile (which I've confirmed in the past by reverse engineering the binaries responsible for it). T-Mobile's phone support won't help because they're not able to add new IMEIs to their whitelist. Contacting T-Force via Twitter/Facebook is the only way to get these devices SIM unlocked.

chenxiaolong··on Bringing the power of AI to Windows 11
The wiki page is just out of date. It's been supported in libarchive for several years, though it's optional at compile time, so this new Windows build might not have it (I didn't check).
chenxiaolong··on Ligatures in programming fonts: hell no (2019)
I don't mind the look of ligatures too much in most monospace fonts that have them. However, I use my editor and terminal emulator for a lot more than just editing source code in common programming languages. In every single ligature-supporting font I've tried, there are edge cases where glyphs are combined in a way that don't make sense in context, which is jarring enough to not be worth it for me.
chenxiaolong··on Pixel phones are sold with bootloader unlocking disabled
In case anyone is curious which Android components are responsible for this:

* There are 3 boolean states:

    1. whether the bootloader is unlocked
    2. whether the bootloader unlocking ability is enabled by the user ("OEM unlocking" toggle)
    3. whether the bootloader unlocking ability is allowed to be enabled (carrier restriction)
* The Android Settings app grays out the "OEM unlocking" toggle if `isOemUnlockAllowedByCarrier()` returns false [1].

* The state of `isOemUnlockAllowedByCarrier()` is changed by a call to `setOemUnlockAllowedByCarrier(boolean allowed, @Nullable byte[] signature)`, which is done by the `android.apps.work.oobconfig` package (/product/priv-app/OTAConfigNoZeroTouchPrebuilt/OTAConfigNoZeroTouchPrebuilt.apk) on the Pixel's stock firmware. This is the same package that handles the Android Enterprise zero-touch provisioning. It's not obfuscated and can be trivially reverse engineered. Prior to the December 2022 update, it was actually possible to bypass the check just by disabling this package via `pm` [2]. This is now blocked both by [3] and also the bootloader's requirement of a signed blob to lift the carrier restriction. This package is also responsible for preventing the removal of the carrier restriction (for the bootloader) when the SIM is locked.

* The Android framework talks to `android.apps.work.oobconfig` at all because the stock firmware ships an overlay (/product/overlay/framework-res__auto_generated_rro_product.apk) that contains `<string name="config_deviceProvisioningPackage">com.google.android.apps.work.oobconfig</string>`.

* The communication with the bootloader is done via the `oemlock` HAL: /vendor/lib64/android.hardware.oemlock@1.0-impl.nos.so. Its implementation of `setOemUnlockAllowedByCarrier()` seems to require a signed blob from Google (passed in from `android.apps.work.oobconfig`) before the state of the setting can be changed (see: `carrierUnlockFromSignature()`). Once unlocking is allowed, the setting is persisted by the bootloader unless something calls `setOemUnlockAllowedByCarrier()` again to disable it. Without the carrier restriction, the bootloader allows the user to freely toggle the "OEM unlocking" state.

I don't know for sure since I haven't tested, but I believe even SIM-unlocked Pixels purchased from the Google Store use this "carrier" restriction mechanism. It's just that when the device asks Google's servers for the signed blob to lift the carrier restriction, it's always granted. (EDIT: Though there are reports that refurbished devices from warranty claims for bootloader-unlockable devices may sometimes have a carrier restriction that Google's servers don't allow removing.)

[1] https://cs.android.com/android/platform/superproject/+/andro...

[2] https://nvd.nist.gov/vuln/detail/CVE-2022-20611

[3] https://android.googlesource.com/platform/frameworks/base/+/...

chenxiaolong··on Ask HN: What's your residential Internet speed and cost?
Symmetric gigabit on AT&T fiber (USA) on their older GPON-based network for $85USD/month. The GPON OLT for my neighborhood isn't oversubscribed (yet), so I consistently get the advertised speeds.
chenxiaolong··on Windows Snipping Tool is vulnerable to Acropalypse too
I just took a look at spectacle (KDE's screenshot tool, version 22.12.3) and it's not affected. It properly truncates the file when overwriting a file that already exists (after cropping or any other edit I tested). The inode number stays the same, so it's not doing the create-temp-file + rename method.
chenxiaolong··on Windows Snipping Tool is vulnerable to Acropalypse too
Windows 10 1607 and newer support it now if you call SetFileInformationByHandle() with FileRenameInfoEx and specify the FILE_RENAME_FLAG_POSIX_SEMANTICS flag. Not sure how commonly it's used in standard libraries, but I've seen it popping up more and more.
chenxiaolong··on Google urges Android phone users to switch off Wi-Fi calling
I don't know if it's true for this particular OS, but some OS's bundle the baseband, bootloader, and other vendor-specific images so that they're automatically updated, like with the stock OS.
chenxiaolong··on The Samsung Galaxy S23’s bloated Android build somehow uses 60GB of storage
Do you know if OnePlus uses the same A/B style OTA updates as Pixel devices and whether it supports setting a custom bootloader key?

If so, you might be able to use my avbroot project [1]. It roots the boot image, signs it with your own key, and replaces the OTA verification certificate with your own, so you can install future updates signed by your key while the bootloader is locked.

[1] https://github.com/chenxiaolong/avbroot

EDIT: I read a bit about OnePlus devices. Looks like they do indeed support locking the bootloader with a custom signing key installed. So I went ahead and added support for OnePlus' OTAs in avbroot: https://github.com/chenxiaolong/avbroot/pull/32. There are only minor differences compared to Pixel's OTA images.

chenxiaolong··on The Samsung Galaxy S23’s bloated Android build somehow uses 60GB of storage
Interesting, thanks for the info!
chenxiaolong··on The Samsung Galaxy S23’s bloated Android build somehow uses 60GB of storage
The firmware is not available on the FOTA (OTA update metadata) server yet, but if you know the exact version number, you can download the firmware from Samsung FUS ("firmware update service").

Looking at the European S23 Ultra (model: SM-S918B, sales code: EUX, version: S918BXXU1AWA6/S918BOXM1AWA6):

* The compressed firmware is 9.2 GiB.

* The total image size after decompression and desparsing is 12 GiB. I'm not sure why the device mentioned in the article would be reporting 60 GB, but I'm guessing it's counting some data in the userdata partition. Due to AVB's (Android Verified Boot) use of footers, the image size in the firmware package must match the actual partition size. So the 60 GB can't be the sum of all the read-only OS partitions.

* The biggest image is `super` -> `system` at 5.4 GiB.

* All of the images contained within the dm-linear `super` partition are formatted with the new erofs filesystem. I didn't know any devices shipped with that yet. Even the Pixel 7 series is still using ext4 for read-only partitions.

* The complete partition table and file list (after image extraction): https://gist.github.com/chenxiaolong/a4c70376f8e5ba0b4f41547...

chenxiaolong··on Inherit environment variables from PID 1 by reading /proc/1/environ
I just gave it a try in gdb on a C program with an empty main(). The argv/envp data was in this range:

    7ffffffdd000-7ffffffff000 rw-p 00000000 00:00 0                          [stack]
Running `call (int) munmap(0x7ffffffdd000, 0x22000)` in gdb did indeed unmap the stack... and the program segfaulted immediately afterwards. But while the process was still in the stopped state and before it finished crashing/exiting, /proc/<pid>/cmdline was a 0-byte file.
chenxiaolong··on Inherit environment variables from PID 1 by reading /proc/1/environ
Some programs, like sshd and chromium, make use of this fact to change the process name as shown in procfs and ps. On Linux, every string that argv[] and envp[] point to are stored in one contiguous block of memory. Programs can change the name of the process by writing a new string starting at *argv[0] and overflowing into the *envp[] memory as needed. (Though the program needs to strdup() the environ[] entries beforehand since they initially point to envp[] strings.)

For example, chromium's implementation: https://source.chromium.org/chromium/chromium/src/+/refs/tag...

chenxiaolong··on Server BMCs can need to be rebooted every so often
BMCs have to be some of the most unreliable devices that I've worked with. Some of the issues I encountered at my last job:

* [ASRock BMC] The BMC firmware updater sometimes causes the NICs to get stuck in a bad state where every NIC has the same MAC address. This can be resolved via a proprietary UEFI application for reflashing the correct MAC address.

* [Dell iDRAC] Local authentication randomly stops working due to some tmpfs running out of space (can see the message if there's an active SSH session). IPMI/SSH occasionally works well enough to issue a reboot command, but when it doesn't, sending the BMC reset comand to /dev/ipmi0 in the server OS is needed.

* [Dell iDRAC] Setting an asset tag via the IPMI DCMI command has a 15 character limit. If that limit is exceeded, the success response is still returned, but when querying the asset tag, random junk data longer than 15 bytes is returned. If I had to guess, I bet there was an sprintf() call somewhere in there :). This was fixed in newer iDRAC firmware. Now, it stores the last 15 bytes of the asset tag instead of returning an error.

* [Lenovo IMM] The shift or alt key sometimes gets stuck on the emulated keyboard without having used the remote console since the last BMC reboot. Can't be fixed by repressing the button, neither physically nor via the virtual keyboard. BMC reboot required.

* [Lenovo IMM] Booting the UEFI shell sometimes crashes both the system and the BMC.

* [Lenovo IMM] BMC and BIOS update sometimes claims to have succeeded, but didn't actually take effect.

* [Lenovo IMM] Rebooting the BMC via the web UI or SSH sometimes doesn't work. Making 50+ simultaneous requests to the login page is enough to crash and restart some component that allows the BMC reboot command to work again though.

* [Supermicro BMC] The BIOS update sometimes doesn't fully upload, but claims that it did. It still parses the header, so the new/old version fields look correct. Sometimes, rebooting the BMC and reflashing works. Other times, only a USB drive + USB keyboard + a recovery key combination fixes it.

* [Supermicro BMC] The remote console sometimes completely fails to initialize (though I've only seen this on servers where the BMC uptime was measured in years). Not just a blank screen. The GPU device was just... gone.

* [Supermicro BMC] Various IPMI commands just lie about successful execution. For example, setting the asset tag via the FRU succeeds, but has no effect. Those commands require toggling a write lock bit via an OEM command, which I only found by reverse engineering. Other commands, like the set asset tag DCMI command, leave the data in a corrupted state until a BMC reboot.

And finally, not really a bug, but an interesting thing about the Lenovo IMM. Instead of exposing information via standard IPMI features, like FRU or DCMI commands, the Lenovo IMM implements a virtual filesystem over OEM IPMI commands. These are commands, like (my naming) open_ro, open_rw, get_size, read, write, and close. They sometimes fail too. I think I ended up making all commands retry up to 10 times with a 5 second delay. At least Lenovo gets error return values right :).

To query the asset tag, you have to open_ro the "config.efi" file, get the size (because read-until-EOF doesn't always work), do a read loop, and close the file. Then, you have the XML data from the file you can query (20 seconds later due to retries). (If anyone ever needs to deal with the Lenovo IMM programmatically, I'd highly recommend the pyghmi [1] library. Wish I knew about it before reverse engineering their proprietary commands...)

[1] https://opendev.org/x/pyghmi

chenxiaolong··on Ask HN: What's on your home server?
Yeah,AT&T unfortunately tries really hard to make their customers use the provided routers. For customers on the older GPON network (like myself), they provide an ONT and a router. The ONT will not communicate until the router authenticates with EAP-TLS. The ONT has some additional funkiness, like requiring the EAP-TLS ethernet frames be tagged with VLAN ID 0.

Some folks work around this by using a ONT <-> dumb/unmanaged switch <-> router setup. They'll plug in the provided router, wait for it to authenticate, disconnect it, and then plug in their own router. The dumb switch will keep the link alive from the ONT's point of view. Works well, though it is annoying to have to redo the procedure whenever the power goes out. For the lucky folks whose provided routers are easily jailbreakable, we can extract the EAP-TLS certs and configure our own routers to authenticate directly.

On their newer XGS-PON network, some folks found out that the EAP-TLS isn't even enforced by the ISP's network--it's enforced locally by the ONT. So you can buy your own SFP ONT module that doesn't support the OMCI commands for enabling EAP-TLS, spoof the SFP serial number, and get connected.

chenxiaolong··on Ask HN: What's on your home server?
For my router PC, I run vyos [1]. Dinky little 9th gen Core i3 machine, but consumes <9W and easily handles gigabit throughput, even with Wireguard. For those in the US with an AT&T fiber GPON ONT, vyos' 802.1x EAP-TLS implementation is complete enough where the certs can just be imported and things will work without obscure hacks (for those not familiar with AT&T fiber, this is to connect your own router directly to the fiber ONT, bypassing the bundled router).

Everything else is on a separate server running Fedora. I used to run applications inside k3s, but got tired of the constant 10% CPU usage from the control plane trying to keep track of its state. Also didn't like that the containers I used weren't being rebuilt for security updates in packages (eg. openssl). Now, I just use plain old RPMs inside VMs.

The stuff I run:

* [Host] ssh: For CLI access and git hosting (just `git init --bare`; no fancy UIs like Gitea or Gitlab).

* [Host] samba: For all file access.

* [Host] zrepl: For zfs snapshot replication.

* [Host] syncthing: For syncing KeePass databases. Also for syncing pictures from my phone.

* [VM] jellyfin: For easy access to rips of my physical media collection. VFIO is very unstable with the 13th gen iGPU on my hardware, so I custom ffmpeg wrapper that SSH's back into the host for remote transcoding in a bwrap sandbox.

* [VM] pdns-auth + dnsdist: The powerdns authoritative server handles the internal DNS. I have DNSSEC set up and SSHFP records for everything, so I don't need to worry about ~/.ssh/known_hosts. All of my computers that rely on this run systemd-resolved and do the DNSSEC validation locally. I run a daemon [2] on every host, which handles pushing new A/AAAA records via TSIG signed updates to the DNS server.

dnsdist acts as a proxy which only allows access to the specific TXT record needed for ACME DNS challenges originating from Let's Encrypt's IP addresses. I may switch to a custom CA in the future when the name contraints x509 extension is better supported (so that a custom CA wouldn't be able to issue trusted certificates for domains that aren't mine).

* [VM] miniflux: For RSS.

* [VM] unifi-controller: For managing Ubiquiti wireless APs.

[1] https://vyos.org/

[2] https://github.com/chenxiaolong/ddns-updater

chenxiaolong··on Why didn't you buy a Tesla?
After driving a new rental Model Y for 1000+ miles recently, my biggest complaints are:

* The sound proofing feels as if it did not exist. The cabin noise in my family's old minivan is even quieter than in this car.

* The ride is incredibly bumpy (I hear this issue is specific to the Model Y?). You feel each and every bump, even on newly paved roads.

* Autopilot, at least on the roads I drove on, was significantly worse than other manufacturer's lane-following systems. I was driving on straight highways that frequently switched between one lane and two lanes. Without fail, every time the two lanes merged into one, autopilot would get confused and jerk the steering wheel left, steering the car past the double yellow lines (USA) into the oncoming traffic lanes. The screen's depiction of what the car saw did not match reality at all in this situation.

* The automatic emergency braking triggered at least once every time I was on the highway.

There were definitely things I did like about the car, but I would never consider personally buying a Tesla for the reasons above.

chenxiaolong··on LineageOS 20
I root my phone for a few reasons (in no particular order):

* Reverse engineering, mostly to satisfy my own curiosity, but also to verify that the few third party apps I install don't do scummy things behind my back. I mostly use frida [1] for this and if I want to change the behavior of something permanently, I make a module for LSPosed [2].

* Get rid of Android's awful app links feature [3]. I despise Android >=12's behavior of always opening deep links in "official" apps (eg. Youtube) by default. To open those links in third party apps by default, the user has to go into Android's settings for the app and manually whitelist domains. This module forces Android to treat every domain as "unverified", which restores the old behavior of prompting the user which app to use when opening a link.

* Call recording [4]. (Or playing audio into a phone call to rickroll friends... [5])

* Raw access to app data, mostly for extracting information from apps with no export functionality.

That said, I don't like increasing the attack surface of my devices, so I do a few things to mitigate that a little bit. I wrote some scripts to sign the Android OTA update images, apply the Magisk boot image patches, and sign the images with a custom key [6]. This way, I can keep the benefits of Android's verified boot with a locked bootloader while rooted. I also don't allow any third party apps root access. My (hacky) local fork of Magisk only allows executing `su` if the app is signed by my own key or with a password if executing via `adb`. My LSPosed build only allows modules signed by my own key as well.

[1] https://frida.re/

[2] https://github.com/LSPosed/LSPosed

[3] https://github.com/Henry-ZHR/KillDomainVerification

[4] https://github.com/chenxiaolong/BCR

[5] https://github.com/chenxiaolong/BCP

[6] https://github.com/chenxiaolong/avbroot

chenxiaolong··on Ask HN: What's your proudest hack?
A few years ago, the company I work at switched to using Alpine-based docker images for most containerized things. One side effect was that our Ansible playbooks (running from inside one of these containers) would fail with inconsistent network timeouts when targeting a couple thousand servers. It turned out that the issue wasn't with the network nor with Ansible. The way that Ansible invoked some library functions for keeping track of SSH connections caused it to create a bunch of POSIX semaphores via sem_open().

glibc had a dynamically allocated data structure to keep track of semaphores, but musl libc only had a fixed-size 256 element array. When the semaphore limit was exhausted, Ansible would fail to keep track of the connections, resulting in a network timeout error message. I fixed the problem by forking musl's semaphore functions, making the array resizable, and loading the implementation with LD_PRELOAD: https://github.com/chenxiaolong/musl-sem-ext. Worked perfectly for 6 years until we decommed our data center :)

chenxiaolong··on Microsoft Is Forcing Me to Buy MacBooks
Interesting! I didn't know coreboot was available for the *20 series. I hadn't touched my W520 since the last warranty replacement. Maybe coreboot will be my next weekend project.
chenxiaolong··on Microsoft Is Forcing Me to Buy MacBooks
> The X1C6 did initially have a problem: It rewrote its Thunderbolt configuration upon every boot, into a kind of physically memory not designed to have a lesson of that many writes.

Heh, that's such a Lenovo problem. I hard bricked my old ThinkPad W520 four times (and got warranty replacements) just by hitting F12 to bring up the BIOS boot menu. It did some sort of write that wore out the BIOS flash chip. I don't think they ever fixed that problem.

← PreviousPage 2 of 5Next →