HNHacker News
TopNewBestAskShowJobs

iam-TJ

1,507 karma · joined February 23, 2016

submissionscomments
iam-TJ··on Libations: Tailscale on the Rocks
I wanted to check it out but they apparently can't even manage to do IPv6 correctly for their own service; advertising an AAAA record but not answering on it even for ICMPv6 let alone TCP 443/80 - apparently on AWS.
iam-TJ··on AnandTech Farewell
More important than that is text lends itself to searching for possibly obscure phrases to narrow down the possible candidates before even having to "consume" any information whereas with video that is challenging and very inefficient (time and energy-wise).
iam-TJ··on Adding 16 kb page size to Android
In Debian kernel we've very recently enabled building an ARM64 kernel flavour with 16KiB page size and we've discussed adding a 64KiB flavour at some point as is the case for PowerPC64 already.

This will likely reveal bugs that need fixing in some of the 70,000+ packages in the Debian archive.

That ARM64 16KiB page size is interesting in respect of the Apple M1 where Asahi [0] identified that the DART IOMMU has a minimum page size of 16KiB so using that page size as a minimum for everything is going to be more efficient.

[0] https://asahilinux.org/2021/10/progress-report-september-202...

iam-TJ··on I picked up a shitty NUC from ewaste and it had a label on it for an AI company
Even with LUKSv1 there are seven key slots. On creation generally the first will be a keyboard-entered pass-phrase, then one might add a key-file, and then add the hardware token as another.

With LUKSv2 the seven slot limit doesn't apply.

For headless GRUB is configured to the serial port for its terminal in/out so a passphrase can be typed.

iam-TJ··on What is an SBAT and why does everyone suddenly care
From the people reporting this affecting their Linux boots in various IRC/Matrix forums and my diagnostics with them, very often they weren't dual-booting in the Microsoft sense, in that they were booting using the UEFI Removable Media Path so there was no entry in the motherboard firmware's Boot menu.

I suspect the MS installer simply scans the EFI BootXXXX entries and looks for a non-Windows boot-loader path like, for example, /EFI/$distro/shimx64.efi

If one-such doesn't exist the installer likely assumes it is not a dual-boot system.

iam-TJ··on I picked up a shitty NUC from ewaste and it had a label on it for an AI company
If you are physically present but the device is operating headless, and if using LUKS and GRUB, you can use a hardware token such as YubiKey via USB to unlock the device without needing to see the console.

I do this with a gateway/router on a PC Engines APU2 that has an internal SSD.

Just ensure GRUB includes the requisite USB modules in its core image, or use grub-mkstandalone to include all modules in core.

iam-TJ··on Kioxia Demonstrates Raid Offload Scheme for NVMe Drives
I have an NVME device that very rarely literally (but figuratively) falls off the PCI port and disappears [0]. It is one of several Physical Volumes (PV) in a Logical Volume Management (LVM) Volume Group (VG) that backs several RAID-1 mirror Logical Volumes (LV).

When it drops off file-systems writes to the LVs are blocked and reads can also fail but the system survives sufficiently to do a controlled power off/on that recovers it.

In some cases the LVs pair up a spinning disk with the NVME but due to how I've configured the LV the spinner is read-mostly and the NVME is write-mostly (RAID member syncing is delayed and in background). There isn't too much noticeable latency except for things like `git log -Sneedle` - and worth it for the resilience.

[0] first time it happened it was spiders that had taken up residence around the M2 header and CPU (nice and warm!) and causing dust trails allowing current leakage between contacts (yes, I did do microscopic examination because I could not identify any other cause) that a simple blast with the air-compressor resolved. Later incidents turn out to be physical stress due to extreme thermal expansion and contraction as best as I can tell - ambient air temperature can fluctuate from 14C to 40C and back over 18 hours. Re-seating the M2 adapter fixes it for a a few months before it starts again! All NVME SMART self-tests pass; the failure is of the link not the storage - effectively being removed from the PCIe port. Firmware was at one stage suspected, although it had been fine for a couple of years on the same version, but updates haven't changed it in any way. ASPM is disabled.

iam-TJ··on Damn Vulnerable UEFI
I had a chuckle when I saw "Challenge 1: Singing Binaries" [0]

[0] https://github.com/hacking-support/DVUEFI/tree/main/docs/2-s...

iam-TJ··on Bashsimplecurses: Simple curses library made in bash to draw terminal interfaces
It's all in the code - many simple examples to get started

https://git.savannah.gnu.org/cgit/bash.git/tree/examples/loa...

iam-TJ··on How did Facebook intercept their competitor's encrypted mobile app traffic?
That got me too for a few seconds whilst my brain cogs whirred... but the latter sounds tastier than the former for some reason!

For those wondering:

  P2P OTR E2EE == Peer to Peer, Off The Record, End to End Encryption
  Non-CA TOFU SSH == Non-Certificate Authority, Trust On First Use, Secure SHell
iam-TJ··on Bashsimplecurses: Simple curses library made in bash to draw terminal interfaces
There's some quite impressive and interesting bash (and other shell) exploration in the matrix.org "Fun Shell Scripting" room from time to time; usually when someone asks an obscure question and a few people dive down a rabbit-hole.

One oft overlooked feature is bash supports dynamically loadable 'builtins' as shared object modules so it wouldn't take much to create a 'proper' wrapper around libncurses.

Debian and derivatives have the package "bash-builtins" that has a lot of examples including wrapping/implementing many coreutils tools.

iam-TJ··on The Linux Kernel Module Programming Guide
I use qemu extensively especially for early-stage kernel debugging when no console is available; one such was just this week with v6.8 where, on arm64, any kernel command-line parameter >= 146 characters hangs the kernel instantly and silently.

Here's how I used qemu + gdb (on Debian 12 Bookworm amd64 host) to emulate and execute the arm64 kernel build to single-step the problematic code to identify the cause.

1. In a prepared kernel build system (i.e; all build dependencies and cross-compile tools installed) build the kernel image. I do this in an unprivileged systemd-nspawn amd64 container to avoid messy -dev package installs on the host. Nspawn bind-mounts the host's source-code tree which includes a separate build directory:

  cd "${SRC_DIR}"
  # copy/install/configure a suitable ${BUILD_DIR}/.config; review/edit with:
  make V=1 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=${BUILD_DIR} -j 4 menuconfig
  # build the kernel
  export KBUILD_BUILD_USER=linux; export KBUILD_BUILD_HOST=iam.tj; time make V=1 LOCALVERSION="" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=${BUILD_DIR} -j 12 Image
  # build gdb helper (Python) scripts 
  export KBUILD_BUILD_USER=linux; export KBUILD_BUILD_HOST=iam.tj; time make V=1 LOCALVERSION="" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=${BUILD_DIR} scripts_gdb
This will create the debug symbols needed by gdb in ${BUILD_DIR}/vmlinux and the executable kernel in ${BUILD_DIR}/arch/arm64/boot/Image

2. Install "gdb" (and if doing foreign architecture debugging "gdb-multiarch") on the host as well as "qemu-system-arm"

3. Execute the kernel but -S[uspend] it and have QEMU listen for a connection from gdb:

  qemu-system-aarch64 -machine virt,gic-version=3 -cpu max,pauth-impdef=on -smp 2 -m 4096 -nographic -kernel ${BUILD_DIR}/arch/arm64/boot/Image -append "debug $( for l in {144..157}; do echo -n param$l=$(pwgen $((l-9)) 1)' '; done )" -initrd rootfs/boot/initrd.img-6.8.12-arm64-debug -S -gdb tcp::1234
The -append and -initrd shown here are optional; in my case no -initrd is actually needed since the (silent) panic occurs in the first few instructions the kernel executes. If debugging loadable modules however they would be in the initrd and loaded in the usual way. If the problem being diagnosed occurs after the root file-system and userspace proper are active then one would need to add the appropriate qemu options for the emulated storage device where the root file-system lives.

4. In another terminal shell (I use "tmux" and create a new tmux window) start the debugger:

  cd ${BUILD_DIR}
  # this cd is important - gdb needs to be in the base of the BUILD directory
  gdb-multiarch ./vmlinux
5. In the gdb shell:

  target remote :1234
  break __parse_cmdline
  continue
At this point the usual gdb functionality is available to examine memory, variables, single-step, view the stack and so on.

For more details on debugging kernel using gdb and the gdb scripts lx-* see

https://www.kernel.org/doc/html/latest/dev-tools/gdb-kernel-...

Edit: Forgot to note that for gdb to be able to use the lx-* Python scripts it usually needs the path authorising:

  echo "add-auto-load-safe-path ${SRC_DIR}/scripts/gdb/vmlinux-gdb.py" > ~/.gdbinit
iam-TJ··on Alexa is in millions of households and Amazon is losing billions
The change-over was actually driven by the technology at the time - namely the outdoor road-facing price advertising panels, as well as many of the pump displays.

Simply - they were only designed to show 2 numbers so when the price-per-gallon exceeded 99 pence many had to stick a static "1" in front, and many point-of-sale terminals and cash registers couldn't handle it.

Since there are ~4.5 litres in a British gallon displaying pence-per-litre brought the displayed prices back to 2 digits and allowed for a gradual transition to 3 and 4 digit displays.

And yes, at the time the switch from pence-per-gallon to pence-per-litre occurred some retailers did take advantage to 'add some profit margin' but it wasn't universal.

iam-TJ··on No more boot loader: Please use the kernel instead
A small side-note to solve your "unique [EFI-SP] directory to that OS instance":

In each GRUBified OS instance, in /etc/default/grub (or on Debian and derivatives, to avoid altering the distro-shipped config file, /etc/default/grub.d/local.cfg ), set:

GRUB_DISTRIBUTOR=

This is used by grub-install.

If calling grub-install directly one can also pass --bootloader=id=

The value is set via efibootmgr's --label

iam-TJ··on Canonical's 'distroless' Linux images are a game-changer for enterprises
I'm quite surprised by this descriptive term also; in fact I've always (for years) called this type an "application container" since it only contains the files required by the primary process and doesn't have a standard init system (usually it is expected to handle PID 1 responsibilities in its primary executable or use a stub init (as when using e.g: systemd-nspawn --as-pid2 ... ).

In contrast a "system container" has a regular init system and likely also package management (although that is optional) but was created using a package manager so the miscellaneous package-installed files are usually in there.

iam-TJ··on Discovered June 16th, large asteroid to pass between Earth and moon on Saturday
I'm confused about the late warning quote because the data page for MK2024 shows the first observation for the orbit fit was 2024-05-07.

https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=2024%...

iam-TJ··on Spending 3 months investigating a 7-year old bug and fixing it in 1 line of code
Based on experience gained from debugging complex issues and code over decades I have a mantra I repeat to myself and others:

"Almost every bug turns out to be a 1 that should be 0, or a 0 that should be 1"

Keeping this in mind often keeps one focused on the detail of the underlying binary values and how they are being manipulated.

iam-TJ··on A transport protocol's view of Starlink
General usage stemmed from the Tactical User Terminal's deployed in the 1980s by the U.S. Army in Germany; part of codename TENCAP ELINT programme - and were truck-sized!
iam-TJ··on A transport protocol's view of Starlink
For those not aware of how Starlink operates: The customer antenna is called the User Terminal (U.T.) a.k.a. "dish" although all production models are rectangular - only the pre-production beta model is round and dish-like.

The U.T. contains a phased array antenna that can electronically 'steer' the bore-sight (aim) of the transmitted (and received) signal at the current satellite that is in view. In ideal circumstances the U.T. antenna has approximately 110 degrees field of view (~ 35 degrees above each horizon).

The satellites pass from west to east and take approximately 15 seconds to pass through the field of view of the U.T. The satellite forms a beam aimed at a fixed location on the ground - this is called a 'cell'. All U.T. within that area share the radio link that has a fixed bandwidth, so contention is managed by the satellite.

The path length to a satellite directly overhead would be around 550km (in most cases the satellite is slightly north, or slightly south, of the U.T. but for round numbers sake assume 550km).

The path length to a satellite appearing 35 degrees above the horizon (the slant range) is ~ 2568km.

Satellites relay the packets from the U.T. to the (nearest) Earth ground station, so the path length and therefore travel-time will vary enormously over just 15 seconds.

The round-trip for the minimum case is 4 x 550km = 2200km but for the maximal case is 4 x 2568km = 10272km. These equate to a travel time of between 1.8 and 3.6ms per leg, so that gives a hard physical minimum of 4 x 1.8ms = 7.2ms to 4 x 3.6ms = 14.4ms

As more satellites are added to the constellation so the gap between satellites decreases and the angle above horizon at which a satellite is acquired can increase thus shortening the maximum path and lowering the latency.

Starlink has a publicly stated goal of less than 20ms round trip latency and published a report in March 2024 about the engineering efforts to achieve this [0]. Much of the effort that customers see focuses on two issues:

  1. reducing latency between ground station and Internet connection point
  2. scheduling the radio links between satellite and all U.T.s in its beam area
Starlink balances contention by sometimes restricting and sometimes promoting activation of new U.T.s in each area - this is why on occasion a fully subscribed cell will impose a waiting list on new activations. At other times Starlink will, and does, dynamically change the monthly subscription cost. Recently some areas had their residential price reduce from US$120 to US$90 where others in congested areas had an increase from US$90 to US$120 (in the USA).

[0] https://api.starlink.com/public-files/StarlinkLatency.pdf

iam-TJ··on SSD death, tricky read-only filesystems, and systemd magic?
One can use:

journalctl --relinquish-var

to switch from /var/log/journal/ to /run/log/journal/ (which should be a tmpfs)

iam-TJ··on Ford Mustang Mach-E using BlueCruise at time of crash: NTSB
In the U.K. some years ago the police changed the term in common use from "Road Traffic Accident" (RTA) to "Road Traffic Collision" (RTC) in order to underscore that these were not accidental but mostly due to poor driving of one sort or another.

"Road Traffic Collision" is encoded in the applicable laws.

iam-TJ··on British Placename Mapper
I get a giggle every time I hear an American talk about "Fort Belvoir" because in the English Vale of Belvoir, under Belvoir Castle, it is pronounced "Beaver" not "Bel-Voir"
iam-TJ··on Running a Raspberry Pi with a read-only root filesystem
Several mentions here of using overlay file-system via the RaspberryPi specific raspi-config options.

However, where-ever systemd is the init one can do it via adding to the kernel command line

  systemd.volatile=overlay
"If this setting is set to "overlay" the root file system is set up as "overlayfs" mount combining the read-only root directory with a writable "tmpfs", so that no modifications are made to disk, but the file system may be modified nonetheless with all changes being lost at reboot."

See man 7 kernel-command-line for the other volatile mode options.

iam-TJ··on Waking My Computer from Afar
I wrote a pure bash shell version for use on my IPv6-only networks. I initially wanted to make pure POSIX sh but the ease of being able to use ${param,,} and more importantly /dev/udp/$IP/$PORT makes bash more suitable for the use-case.

  #!/usr/bin/env bash

  config_sys="${config_sys:-/etc/wol}"
  config_user="${config_user:=$HOME/.config/wol}"
  PORT="${PORT:-9999}"

  cat <<EOF
  WoL Wake-On-LAN Magic Packet transmitter
  Copyright 2023 Tj <hacker@iam.tj>
  Licensed on the terms of the GNU General Public Licence version 3.

  EOF

  ls() {
        shopt -s nullglob
        for f in $@; do
                printf "%s\n" "${f##*/}"
        done
  }

  if [ -z "$1" ]; then
        cat <<-EOF
        Please specify the hostname. Currently defined:
        System ($config_sys/): $(ls "$config_sys/*" 2>/dev/null)
        User ($config_user/):  $(ls "$config_user/*" 2>/dev/null)

        Config files should be named for the target host
        Content is shell variable definitions
        Required: IP= and MAC=
        Optional: PORT= (default is ${PORT})
        E.g:
        MAC="60:45:cb:9f:42:fb"
        IP="fddc:7e00:e001:ee80::2"
        EOF
        exit 1
  fi

  for conf in "$config_sys" "$config_user"; do
        if [[ -r "$conf/$1" ]]; then
                . "$conf/$1"
                # don't break; allow user override
        fi
  done

  if [[ -z "$IP" ]] || [[ -z "$MAC" ]]; then
        >&2 printf "Error: required configuration missing IP='%s' MAC='%s'\n" "$IP" "$MAC"
        exit 2
  fi

  target="/dev/udp/$IP/$PORT"

  hex2char() # $1 = 2 hex digits
  {
        case "${#1},${1,,}" in
                (2,*[!0-9a-f]*) return 2 ;;
                (2,*) printf '%b' "\x$1" ;;
                (*) return 1 ;;
        esac
  }

  make_payload() # $1 = Ethernet MAC address with ":" separators
  {
        IFS=":" read -r -a mac < <(echo "$1")
        for h in "${mac[@]}"; do
                magic="$magic$(hex2char "$h")"
        done
        payload=""
        ff="$(hex2char "ff")"
        for ((i=0; i < 6; i++)); do
                payload="${payload}${ff}"
        done
        for ((i=0; i < 16; i++)); do
                payload="${payload}${magic}"
        done

  }

  printf "Sending magic packet to %s (%s port %s [MAC %s])\n" "$1" "$IP" "$PORT" "$MAC"
  make_payload "$MAC"
  printf "%s" "$payload" > "$target" || printf "error: failed to send (error %s)\n" "$?"
iam-TJ··on Young men and women are drifting apart
The symptoms described are different but the end result (polarisation and self-segregation) reads very much like the situation in many (western, and other) countries 100 years ago.

Maybe a cycle is starting and this is a sign of the first 'dip' heading back towards the starting condition?

iam-TJ··on Windows 1.0 site – everything there is to know about the first Windows version
There were/are two front slots; the permutations were:

  720KB FDD, blank
  720KB FDD, 720KB FDD
  720KB FDD, 20MB HDD
(I also seem to recall seeing (blank,blank) for "dumb terminals" when Xenix and line cards were in the Xenix server. Could have up to 16 terminals hanging off the back when using Xenix.
iam-TJ··on Windows 1.0 site – everything there is to know about the first Windows version
Apricot Xen (not IBM PC/AT compatible) used Windows 1.0, 80286@7.5MHz, and had a paper-white monitor - was fantastic to use. Windows performed really well on it.
iam-TJ··on Sycamore Gap: New life springs from rescued tree
Investigation is still ongoing; originally two people were arrested but now face "no further action"; Two further people have been arrested.

https://www.bbc.co.uk/news/uk-england-tyne-67284492

iam-TJ··on Sycamore Gap: New life springs from rescued tree
It's a Whydunnit, not a Whodunnit - the people that cut the tree down are known.
iam-TJ··on Sweden Is a NATO Member
Looking at the flag colours I cannot but think that Sweden is paving the way for Ukraine's membership.
← PreviousPage 2 of 11Next →