HNHacker News
TopNewBestAskShowJobs

PeterWhittaker

2,211 karma · joined April 27, 2009

submissionscomments
PeterWhittaker··on Ask HN: Does retro computing make you feel younger or older?
I feel the same about old HW as I do old cars: some deserve historical recognition for their importance, and I'm thankful for the uh, passionately committed people who maintain them against all odds and sometimes at ridiculous expense, so that these important historical icons remain, but they are the past, and I don't live there anymore.

While we can learn from them and their inventors/creators, if we choose, I'm much happier with my rock solid highly reliable five year old RAM and my new MacBook Pro. I've driven a lot of the Jeeps ever made, and off-road I'll take my JKU Rubicon over any of them (except maybe the 2004 "LJ") any day. It's a beast to maintain mostly because I am beastly to it, and the older ones are worse for that.

I don’t rush after the newest and shiniest (my M3 replaced a 2013 Air), but when it's time, the RAM and JKU will be replaced with new.

PeterWhittaker··on Biggest shell programs
OK, so JOOC I ran wc against the main binary and supporting libraries for a project I did last year: It's a script to manage linear assured pipelines implemented as a series of containers (an input protocol adapter, one or more filters, an output protocol adapter). The whole thing was intended to be useful for people who aren't necessarily experts in either containers or protocols, but who have an idea of how they want to filter/transform files as they transit the pipeline.

It's 6224 lines, so far.

There is a top-level binary with sub-functions, sort of like how

   git [ git options ] < git action> [action options]
or

  systemctl [etc.[
work.

There is a sub command to add a new sub command, which creates the necessary libraries and pre-populates function definitions from a template; the template includes short and long usage functions, so that

  cbap -h
or

  cbap pipeline -h
give useful and reasonable advice.

There are subcommands for manipulating base images, components (which are images with specific properties for use as containers in the pipelines), and pipelines themselves. A LOT of code is for testing, to make sure that the component and pipeline definitions are correctly formatted. (Pipelines are specified in something-almost-TOML, so there is code to parse toml, convert sections to arrays, etc., while components are specified as simple key=value files, so there is code to parse those, extract LHS and RHS, perform schema validation, etc.).

Since pipeline components can share properties, there is code to find common properties in var and etc files, specify component properties, etc.

There are a lot user and group and directory and FIFO manipulation functions tailored to the security requirements: When a pipeline is setup, users and groups and SEL types and MCS categories are generated and applied, then mapped into to the service files that start the components (so there is a lot of systemd manipulation as well).

Probably the single biggest set of calls are the functions that get/set component properties (which are really container properties) and allow us to use data-driven container definitions, with each property having a get function, a validation function, and an inline (in a pipeline) version, for maximum flexibility.

Finally, there is code that uses a lot of bash references to set variables either from files, the environment, or the command line, so that we can test rapidly.

It also support four levels of user, from maintainer (people who work on the code itself), developer (people who develop component definitions), integrators (people who build pipelines from components), and operators (people who install pipelines), with the ability to copy and package itself for export to users at any of those levels (there is a lot of data-driven, limited recursive stuff happening therein).

Since target systems can be any Linux, it uses makeself to package and extract itself.

For example, an integrator can create a pipeline definition, which will produce a makeself file that, when run on the target system, will create all users, groups, directories, FIFOs (the inter-component IPC), apply DAC and MAC, create systemd files, copy images to each user, and launch the pipeline - with a delete option to undo all of that.

There is some seccomp in there as well, but we've paused that as we need to find the right balance between allow- and deny- listing.

(Yes, I use shellcheck. Religiously. :->)

PeterWhittaker··on Biggest shell programs
Thanks for the clarification. It was so long ago, it’s all a bit hazy.

Other than the COLUMNS thing. That is burnt into my memory forever.

PeterWhittaker··on Biggest shell programs
dspillett was exactly right: ps, e.g., truncated its output at $COLUMNS and there was no horizontal scroll.

As suggested above, it did this even when called from a script.

The fix was easy, set COLUMNS ridiculously large if DEC Unix, but it took days of WTF apparent UB before I realized how simple was what was happening. It just seemed haphazard: I'd reposition and resize a window so I could run the script in one while manually running the commands in another, get inconsistent results, rinse, repeat...

...and eventually realize the common element in each test was me, and the variations I was introducing were window size.

I cursed their engineers for trying to be "helpful" and keep things "pretty".

PeterWhittaker··on Biggest shell programs
Oh, yes, I think it was Digital Unix. IIRC, we toyed with OSF/1, but there wasn't much call for it.
PeterWhittaker··on Biggest shell programs
Oh, no, now I have to go dig out some of mine....

The first really big one I wrote was the ~7000 line installer for the Enrust CA and directory, which ran on, well, all Unixes at that time. It didn't initially, of course, but it grew with customer demand.

The installation itself wasn't especially complicated, but upgrades were, a little, and this was back when every utility on every Unix had slight variations.

Much of the script was figuring out and managing those differences, much was error detection and recovery and rollback, some was a very primitive form of package and dependency management....

DEC's Unix (the other one, not Ultrix) was the most baffling. It took me days to realize that all command line utilities truncated their output at column width. Every single one. Over 30 years later and that one still stands out.

Every release of HP-UX had breaking changes, and we covered 6.5 to 11, IIRC. I barely remember Ultrix or the Novell one or Next, or Sequent. I do remember AIX as being weird but I don't remember why. And of course even Sun's three/four OS's had their differences (SunOS pre 4.1.3; 4.1.3; Solaris pre 2; and 2+) but they had great FMs. The best.

PeterWhittaker··on RAII and the Rust/Linux Drama
I'm even less sure what to make of this article after developments over the past two weeks and especially this past weekend: It seems to be mostly Rust FUD wrapped in a screed against RAII, implying that somehow Rust will harm the kernel, maybe. But in the past two weeks...

16 Nov, Linux 6.13 Introducing New Rust File Abstractions, https://www.phoronix.com/news/Linux-6.13-Rust-File-Abstract

26 Nov, 3K Lines Of New Rust Infrastructure Code Head Into Linux 6.13, https://www.phoronix.com/news/Linux-6.13-Rust

30 Nov, Linux 6.13 Hits A "Tipping Point" With More Rust Drivers Expected Soon, https://www.phoronix.com/news/Linux-6.13-char-misc-More-Rust

That last one is particularly interesting, with the following quote from Greg K-H: "rust misc driver bindings and other rust changes to make misc drivers actually possible. I think this is the tipping point, expect to see way more rust drivers going forward now that these bindings are present. Next merge window hopefully we will have pci and platform drivers working, which will fully enable almost all driver subsystems to start accepting (or at least getting) rust drivers. This is the end result of a lot of work from a lot of people, congrats to all of them for getting this far, you've proved many of us wrong in the best way possible, working code :)"

PeterWhittaker··on Rust: Tools (early access edition)
Hmm, hard to read on mobile (in portrait), had to zoom in a bit (but then text went out the window, so it was a bit of a balancing act)...

...so I rotate my phone.

DON'T DO THAT!

I'm directing that at both HN readers (you're welcome) and at the web author/admin (dude, TF?): a sudden explosion of additional content that I could not find a way to dismiss, when all I wanted to do was see the excerpts properly.

Seconding other comments re the poor quality crab, when your presentation is that poorly thought out and your prose that amateurish, it makes me want to save even more and dismiss this from my mind.

So thank you? I think?

PeterWhittaker··on Goodbye, Rust. I wish you success but I'm back to C++ (sorry, it is a rant)
Another commenter mentioned the NSA and safe languages, which is what prompted our move...

...and I have to say, Rust is fantastic. I was reading the O'Reilly book when I was doing some gnarly three-star C work and I kept thinking that it would likely be far easier and safer in Rust.

We're now at the point where all new work is Rust and that gnarly, performant AF piece of C that just flies will be replaced with a simpler, safer Rust version.

Another commenter mentioned speed of prototyping. That was a concern for me, too, but so far real life has shown me the opposite: prototyping is only slightly slower, mostly because I am having to learn various Crates instead of using system calls and their libc variants I've known for years, but incremental debelopment from proto to poc to mvp to product is faster because there is far less dumb at each step: if it built, it is safe(r) to extend.

Maybe it is because so much of what we do is low level high performance system programming, I dunno, but, after 37 years, I may soon have invoked a C compiler for the last time.

PeterWhittaker··on Researchers discover first UEFI bootkit malware for Linux
Honest question: how do you assess the risk to MBR as lower?

Related: How many hardware platforms are currently available with "pure" MBR support, that is, completely lacking in UEFI? My understanding is that all relatively recent systems have only UEFI and some have a hybrid mode through which they can recognize and load MBR.

PeterWhittaker··on Show HN: Clean Your Mac with a Script
And half of that is parsing the options and processing the dry run...

The script is clean and straightforward.

PeterWhittaker··on The OSI Model Revisited (2023)
Love the diagrams, will be directing people this way as needed.

Like the wise page/coconut-horse once said, "it's only a model".

PeterWhittaker··on The 'Return to Office' Lies
My daughter, SIL, and I are 100% remote (three different companies, all located in different places). RTO was an important but not deciding factor in her recent job change, but 100% remote made the new spot all that much more attractive.

She's a marketing event manager, he's an accountant manager, and I'm a, well, it depends on the day; let's say senior systems architect and programmer across our HW-and-container-based security products.

Of the three, mine needs the most in person time, which we mostly satisfy with ad-hoc whiteboarding sessions, but we've gotten good at doing even that in video calls.

When we do get together, it's for team lunches, mini-golf tournaments, etc.

It's great.

My co has people in TO, NYC, London, with most of us around but not necessarily in Ottawa.

PeterWhittaker··on Against the Dark Forest
I remember. We took a deep breath and said "here we go again"... ...I finally released that breath, but it hurt. The Dumb! So much dumb....
PeterWhittaker··on The Surprising Benefits of Talking Out Loud to Yourself
It depends if you are really talking aloud or just sort of hum-mumble vocalizing.

I shared an office with a good friend until his office was ready. When he moved, he said he would miss the buzzy hum coming from my chair.

PeterWhittaker··on Is the 80 character line limit still relevant? (2008)
I simply find spaces easier to navigate. I don't always use vim-golf-winning movements, and when I am being lazy using hl or arrow keys, I expect to move a space at a time. Tabs violate that expectation.

It's a visceral rather than a rational thing (which I suppose is implied by the word "hate" :->). I also have trailing spaces and all tabs highlighted for similar reasons.

PeterWhittaker··on Is the 80 character line limit still relevant? (2008)
> formatting tennis

That's a paddling.

Seriously, professionals do this? If someone else wrote it and it does what it is supposed to do, it is not, NOT (no apologies for shouty emphasis), my job to change that.

(I hate tabs, but will never :retab someone else's code.)

My job is either/both to fix bugs and add new capabilities, not to be precious about, well, anything.

I would have serious reservations about any team member who wasted all our time on that.

PeterWhittaker··on Undergrad thought he had mastered Unix in weeks. Then he discovered rm -rf
Been there. Thought I was in a subordinate directory, forgot I was in /dev. When my tty went funky, I realized the scope of my error, hit ctrl-C, and with great luck managed to remember the mknod incantation for tty.

With the tty restored, the rest was painful but doable.

PeterWhittaker··on Show HN: Nova JavaScript Engine
Do you plan on supporting TCO? I was disappointed to learn a few years ago that V8 wouldn't, on the grounds that, IIRC, it would confuse developers.

True tail call recursion and lazy evaluation would enable truly functional JS.

PeterWhittaker··on Why your house is a terrible investment
Perfect for me, but I run kablock and wipr....
PeterWhittaker··on Half of Young Voters Say They've Lied about Which Candidates They Support
Much of what you cite, being able to have and share opinions, etc., has been illegal in much of the world for at least parts of the twentieth century, e.g., Germany from sometime in the late twenties or early thirties, and definitely from the mid thirties on, until 1945; the Soviet Union for much of its existence; Mao's China; Khmer Cambodia; etc.

Democratic politics with free association and free elections with secret ballots are what it possible for you to hold and share your opinions, especially the unpopular ones.

PeterWhittaker··on CIL: C Intermediate Language
Not to mention SELinux CIL, Common Intermediate Language, https://selinuxproject.org/page/PolicyLanguage
PeterWhittaker··on Should JavaScript be split into two languages?
Oh, duh! Good catch! Apologies!
PeterWhittaker··on Should JavaScript be split into two languages?
> ECMA not Ecma

Incorrect: https://ecma-international.org/about-ecma/history/

PeterWhittaker··on Transitioning the Use of Cryptographic Algorithms and Key Lengths
Ah, OK, thanks. So part of the broader efforts to modernize, not in response to PQ threats.
PeterWhittaker··on Transitioning the Use of Cryptographic Algorithms and Key Lengths
I'm surprised to see symmetric algorithms in this list. It's been a while since I worked adjacent to the field (I'm not a cryptographer but spent a lot of time working with them in a past life), but my understanding is that PQ refers to replacing those algorithms that are vulnerable to advances in quantum computing, e.g., public key algorithms, such as RSA, that use relative primes and are therefore subject to attack by efficient implementations of Shor's algorithm.

AIUI, symmetric algorithms such as 3DES are not subject to these attacks, but my understanding could be wrong.

Care to enlighten?

PeterWhittaker··on [dead]
Written by someone who (apparently) thinks that a simpler malloc will solve memory safety issues, someone apparently unaware of the dangers of pointers arithmetic, out of bounds indexing/references, uninitialized values, UB, etc.

(Don't misunderstand me, I will happily - and carefully - program in C when I need to, or can, and will claim to be a safe three star programmer (the only time I had to do it, which was recently, I spent a LOT of time making sure it was necessary and safe), but the reason I can write reasonably safe code in C is that I know where (at least some of) the foot guns are - and every time I do something close to the edge, I learn of more limb shredding behaviour. But I am slowly acquiring Rust, and some of my colleagues are much farther along that path. For what we do, some things MUST be done in memory safe languages, and the Rust I've read and written is such a joy compared with the pain I often feel when using a language I have love for (takes out fingers, counts) more than 4 decades. The idea of NOT having to spend hours trying to find that unexpected leak or SEGFAULT is giddy-making.)

PeterWhittaker··on How I Use Git
Well, it's not navigable, but there is git log --graph --oneline --decorate
PeterWhittaker··on Adapting Plan 9's listen to GNU Guix
Honesty, that’s trivial to parse, even if you don’t want to use or don’t have regex available: In C, e.g., just treat the name as a string and walk backwards from the last character until you find a non-digit; adjust for indexing, and you now know where the protocol ends and port begins.
PeterWhittaker··on Apple macOS 15 Sequoia is officially Unix
But is pipe2 not Linux specific? It isn’t POSIX, AFAIK.
← PreviousPage 6 of 34Next →