Gary Klein Quoting from Psychology Today:
Dr. Klein received his Ph.D. in experimental psychology from the University of Pittsburgh in 1969. He spent the first phase of his career in academia as an Assistant Professor of Psychology at Oakland University (1970-1974). The second phase was spent working for the government as a research psychologist for the U.S. Air Force (1974-1978). The third…
Make devcontainers work on Fedora with SELinux / rootless podman I needed to add the following to my .devcontainer.json to get it going:
'runArgs': [ '--userns=keep-id:uid=1000,gid=1000', '--security-opt=label=disable' ], 'containerUser': 'vscode', (Assuming your user ID is 1000. Find it by running id in a terminal)
Here’s a complete example which patched the auto-generated…
Nick’s food allergies I’m allergic to eggs, all forms of dairy, nuts, and kiwi fruit. (Also available in Dutch (NL))
Not okay Eggs. Nuts like walnuts and peanuts. All forms of dairy. Kiwi fruit. Note: I’m allergic to the milk protein, not intolerant to lactose, so something being ’lactose-free’ is not sufficient.
Okay Almonds and seeds (like sesame). Packaging…
Nick’s voedselallergieën Ik ben allergisch voor eieren, noten, melk en kiwi. (Also available in English)
Niet okay Ei. Noten/pinda. Zuivel. Kiwi. Let op: Ik ben allergisch voor melk, niet lactose-intolerant, dus iets wat enkel ’lactose vrij’ is volstaat niet.
Wel okay Amandelen, zaden en pitten (zoals sesam, pijnboompitten, etc.) Waarschuwingen over 'Kan mogelijk sporen…
List only the most recent SemVer version number per major.minor branch Here’s a handy snippet to show only v1.3, v2.1 out of a range like v1.0, v1.1, v1.2, v1.3, v2.0, v2.1:
git tag -l 'v*.*.*' --sort=-v:refname | awk -F. '!seen[$1,$2]++' (Input does not have to come from git, it can be any newline-delimited list of version numbers)
Example $ git tag -l 'v*.*.*' --sort=-v:refname…
Generating random data with OpenSSL One way to produce lots of seemingly random, hard to compress data is to leverage AES encryption through OpenSSL. This can be faster than just reading data from /dev/urandom as modern CPUs typically have dedicated AES instruction sets which openssl can leverage.
For OpenSSL 1.1 onwards, using current epoch as the seed:
openssl enc -aes-256-ctr -pbkdf2…
Saving docker container image contents to local directory You can use commands like docker save to export a container to a directory or tar archive, but the problem is that this saves the individual image layers, while what we typically want is to save files that are seen in the final, merged filesystem image.
You can use docker cp to copy files from a running or stopped container, but you…
Prospective Hindsight Prospective hindsight is the act of pretending a future event has already happened, then coming up with reasons or explanations as to why it happened.
A study performed in 1989 (Mitchell, Russo, and Pennington 1989) shows that using prospective hindsight can improve the ability to correctly predict reasons for future outcomes by as much as 30%.
References Mitchell,…
Hyrum’s Law Coined by Hyrum Wright, a tenured software engineer at Google, Hyrum’s Law states that:
With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody.
Find out more at hyrumslaw.com.
Resetting USB devices on Linux Usbutils has a usbreset command that will reset a given USB device:
# usbreset 046d:0843 Resetting Logitech Webcam C930e ... ok lsusb can be used to find the right device ID. This awk snippet may help with scripting (using the same Logitech webcam as an example again here):
$ lsusb | awk '/C930e/ { print $6 }' 046d:0843 Alternatively, to reset all of the…
Using hardware security tokens (Yubikeys) to log in to Azure AD with Firefox on Linux Microsoft currently doesn’t support FIDO2 logins with Firefox on Linux (they do support Chrome) and actively disables this in their login flow. Despite this, I have been able to make it work using the following steps:
Enroll a new key via Chrome.
Return to Firefox and save the following bookmarklet…
Google Chrome web USB serial socket permissions issues Trying to use ESPHome Web to flash some firmware using Web Serial with Chromium, I got an immediate error when selecting a USB serial device: Failed to open serial port: FILE_ERROR_ACCESS_DENIED.
The issue had to do with ownership of the /dev/ttyUSB0 device file, which was group-owned by uucp on Arch Linux (Fedora might use dialout).…
SELinux troubleshooting Use the ausearch utility to find any recent Access Vector Cache (AVC) messages and confirm that SELinux denied the action:
ausearch -m AVC,USER_AVC -ts recent (-ts recent returns AVC messages from the last 10 minutes, try -ts today if you need a longer window)
If you have setroubleshoot installed and running, then you can check its logs for more details about the…
Project retrospective template Info
This is a template I frequently use with teams to review the outcome of a project, with a focus on reflection of the process to identify strengths which should be maintained, and weaknesses to be addressed.
I typically have individuals contribute asynchronously to this ahead of time, followed by a meeting to discuss any differences of opinion and to…
Superseded
These notes have been superseded by 20240112-1400 - Intune on Fedora 39.
Intune on Fedora 38 Based on https://taoofmac.com/space/com/microsoft/intune
Install dependencies:
sudo dnf install alien sdbus-cpp java-11-openjdk
Download latest package versions of:
https://packages.microsoft.com/ubuntu/22.04/prod/pool/main/m/msalsdk-dbusclient/…
Go format flags [!info] Official sources The information below comes from the original documentation on the fmt package, with minor typesetting adjustments to make it more accessible.
General Booleans Integers Floating-point and complex constituents Strings and slices of bytes Slices Pointers The %v default format Other flags General %v	the value in a default format when printing structs,…
Fixing the 1password for Linux URL scheme handler When my employer switched 1Password over to Single Sign On (SSO), the callback from browser back to the Linux app wasn’t working for me.
It just failed silently because Firefox suppressed errors about 1Password’s URL scheme handler not being registered, so after going through the Azure SSO portal screens and hitting…
Python developer mode The Python Development Mode introduces additional runtime checks that are too expensive to be enabled by default. It should not be more verbose than the default if the code is correct; new warnings are only emitted when an issue is detected.
It can be enabled using the -X dev command line option or by setting the PYTHONDEVMODE environment variable to 1.
Some of the…
Azure Service Principals Automated tools that use Azure services should always have restricted permissions. Instead of having applications sign in as a fully privileged user, Azure offers service principals.
An Azure service principal is an identity created for use with applications, hosted services, and automated tools to access Azure resources. This access is restricted by the roles assigned…
systemd-resolved From https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html:
systemd-resolved is a system service that provides network name resolution to local applications. It implements a caching and validating DNS/DNSSEC stub resolver, as well as an LLMNR and MulticastDNS resolver and responder. Local applications may submit network name resolution requests via…
Process over outcome One of my personal mottos is “Process over outcome”. That is, focus on ensuring a consistent, quality process aimed at producing good results rather than focusing directly on the results themselves.
Focusing on results risks short-term thinking and local optimizations, easily susceptible to disruption when situations change. Focusing on a good process will…
HiDPI on Linux About
These are reference notes of my personal experiences getting HiDPI screens working on my Linux systems with Gnome shell and Wayland. This is not intended as a general guide covering all use-cases, though I’m sharing it in case it helps anyone else.
Gnome desktop Gnome natively supports integer scaling (100%, 200%, 400%, etc) out of the box. On my displays this…
Crockford’s Base32 Douglas Crockford designed a variant of the standard base 32 encoding scheme (RFC 4648) optimized for reading and writing by humans. It uses the symbol sets 0–1 and A–Z (case-insensitive) with the exclusion of I, L, O and U:
I: Can be confused with 1 L: Can be confused with 1 O: Can be confused with 0 U: Accidental obscenity Encoding/decoding When decoding, upper and…