HNHacker News
TopNewBestAskShowJobs

chenxiaolong

532 karma · joined June 12, 2020

submissionscomments
chenxiaolong··on “To be safe allocate 5 bytes more than you need”
Android's bionic libc strlen function does a similar read-beyond-the-buffer thing: https://cs.android.com/android/platform/superproject/+/maste...

I first learned about it when valgrind complained at every place I was calling strlen.

chenxiaolong··on Software/Services Thanksgiving
Definitely https://rr-project.org/ and whole valgrind suite of programs for me.
chenxiaolong··on Slimium: Debloating the Chromium Browser with Feature Subsetting
One thing I've done in a project before was statically linking all of my native library's dependencies into the library itself. Everything would be compiled with `-ffunction-sections -fdata-sections` and the final shared library linked with `-Wl,--gc-sections`. I'd call `strip` on the `.so` as well.

This worked well because the JVM code only ever called the native API I exposed and did not need to access the dependencies' APIs.

chenxiaolong··on Names and Identities Change – You Should Design for That
My vision insurance company (in the US) is awful about this. They use emails as usernames and when you log in, there's an option to change the email or password. The problem is if you change the email, it only updates where notifications go. The username is still the old email and that's where things like password reset emails are sent.

(And they don't support 2FA. Better keep the old email around indefinitely...)

chenxiaolong··on How to Improve Bluetooth Audio Quality on Linux
Just curious, since it's been a while since I last used bluetooth on Linux: does BlueZ support AVDTP 1.3 delay reporting? If so, is it integrated into pulseaudio and the media stack? Windows and Android use this mechanism to delay the video by the appropriate amount to make the latency imperceptible for non-realtime content.
chenxiaolong··on Ask HN: What RSS Reader do you use?
I'm still trying to find a good app for Android tablets that has a decent tablet UI and supports one of the major syncing services. On my iPad Pro, I was previously using Feedly + NetNewsWire, which was fantastic.
chenxiaolong··on Creating a Home IPv6 Network
I’ve gotten pretty lucky with my past and current ISPs (Spectrum and AT&T fiber in the USA). The only times I’ve had my public IPv4 address or IPv6 prefix change was when the router’s MAC address or DUID (dhcpv6) changed.

For my use case, I kind of like this system since everything is (mostly) static and I can change it if I need to.

chenxiaolong··on Lunar – macOS utility to set brightness and volume on external monitors
Not related to monitors, but this is how I bricked my old Lenovo Thinkpad W520 4 times. I switched between the Intel and Nvidia GPUs via the BIOS setting enough times to wear out the BIOS chip. I didn't figure out what was going on until my 3rd replacement.
chenxiaolong··on How to turn off Android TV's homescreen ads, 'staff picks'
It does that even with network access (I didn't see any additional traffic when it happens in a packet capture). I have to use a programmable HDMI splitter that presents an EDID when the real input is off just to get rid of that behavior. My computer resuming from sleep triggers it.
chenxiaolong··on Where do argc and argv come from?
One neat thing I learned is that `argv` and `envp` are contiguous on Linux. You can change the process name that appears in `ps` by modifying memory that `argv` elements point to. If you need more space, you can also skip NULL-terminating `argv` so that it will read on into `envp`.

Chromium, for example, does this: https://source.chromium.org/chromium/chromium/src/+/master:s...

chenxiaolong··on Optical Disc Data Rot: Burned CDs going bad
I've been meaning to try M-DISCs [0] after I found out that my BD drive supports burning them. Apparently, they last longer than normal discs because the drives burn "a permanent hole in the material, rather than changing the color of a dye".

I don't use optical discs much anymore, but I still like the idea of archiving things like family pictures on read-only media once in a while.

[0] https://en.wikipedia.org/wiki/M-DISC

chenxiaolong··on Ask HN: Advanced Linux users, which distribution do you run? Why?
One thing I do (for better or worse): if I need to patch a system package for an extended period of time (like to use a fork), I rebuild the package with a different name and make it provide the original package. For example, one package I recently did this with is libarchive. I rebuilt it as libarchive-patched and in the RPM spec file, I specified:

    Provides: libarchive-%{version}-%{release}
The new package would be able to substitute the old one, but the only way to install it is with dnf shell. Since other things depend on libarchive, I couldn't do:

    dnf remove libarchive
    dnf install ./libarchive-patched-*.rpm
Instead, if I do:

    dnf shell
    remove libarchive
    install ./libarchive-patched-*.rpm
    run
then both the remove and install are done in the same transaction and dnf won't throw any dependency resolution errors.
chenxiaolong··on Ask HN: Advanced Linux users, which distribution do you run? Why?
I've done a ton of distro hopping over the years and always come back to Fedora for a few main reasons:

* They ship a ton of mingw-w64 libraries. It's super nice to not have to cross-compile a bunch of dependencies when I'm building something for Windows.

* They ship debuginfo packages for everything. This was one thing I really missed when I used Arch, where I'd have to rebuild packages with "options+=(debug)".

* "dnf shell" exists, which lets you do multiple operations in one transaction that would otherwise cause conflicts if done separately. I'm not aware of any other distro package manager that supports this.

chenxiaolong··on Ask HN: Most life changing things that you bought?
For me, it was the VR game Beat Saber. I built my first desktop and got a VR headset just to be able to play it. I took 3 weeks off work December last year and lost ~10lbs (155lbs -> 145lbs) playing 2-3 hours every day. It's been great for me since I've been sitting in front of my computer all day for years and never really enjoyed exercising.
chenxiaolong··on Ask HN: How do you take notes when reading a book?
I feel exactly the same way. Taking notes just distracts me from the original content and I end up absorbing less. When I was still in school, the only notes I took were exact copies of what the teacher/professor wrote on the board, and only if it was something I couldn't derive myself with what I already knew.

I wonder if part of it might be because I write slowly and tend to focus on my penmanship (unknowingly).

chenxiaolong··on Tell HN: YouTube fixed the dot after domain ad bypass
I've been using Adguard Pro [1], which is paid (not subscription), but open source [2], on my iOS devices. It uses Safari's content blocker mechanism for blocking ads on the web. I went with it over other apps because it supports adding custom rules to block specific elements on a page, like with other desktop ad blockers. If you want to block ads outside of Safari, it can optionally set up a VPN on localhost to block the traffic.

[1] https://apps.apple.com/us/app/adguard-pro-adblock-privacy/id...

[2] https://github.com/AdguardTeam/AdguardForiOS

chenxiaolong··on Ask HN: How do you RSS?
I use the Feedly web UI on desktop and NetNewsWire (which is open source) on iOS. I'm not a huge fan of the Feedly web UI because it doesn't support scraping the source page for the full article text. Too many of my RSS feeds only include the first paragraph or even just the subtitle.
chenxiaolong··on The Worst API Ever Made (2014)
ptrace is definitely one of the most frustrating APIs I’ve ever used. Admittedly, my main use of it was on armv7 and aarch64 Android devices and the kernels are generally wildly different with tons of vendor patches. On some devices, maybe one of the ptrace calls would fail or return invalid data. On one of the worst devices I worked with, simply calling ptrace would cause a kernel panic and reboot (the broken /proc/last_kmsg and pstore implementations made debugging this interesting too). And this was in PID 1 before any SELinux policies or seccomp stuff were loaded.
← PreviousPage 5 of 5