Talks that changed The way I think about programming

Oliver Powell put this amazing original list together in 2016. While I didn’t appreciate the gravity of the list at the time, the talks have actually changed how I think about programming. Each of the presenters is not only incredibly intelligent but they have some serious credentials and achievements behind them. They in essence have much wisdom to impart. For example Rich Hickey, the creator of Closure, is brilliantly articulate and thought provoking. ...

March 14, 2022 · 7 min

Cyber Defence Operations

Semester 1 2022 has snuck up on me again. This semester as part of the UNSW and ADFA run Master of Cyber Security degree, I’m taking the blue team core unit ZEIT8026 Cyber Defence - Network Security Operations (SecOps) lectured by Dr Waqas Haider and Dr Nour Moustafa. Unlike its sister red team unit ZEIT8020 Cyber Offense - Cyber Network Operations (CNO) which I took in 2018, ZEIT8026 aims to lay the foundational knowledge of cyber defence operations: ...

March 4, 2022 · 26 min

Default programs based on MIME type with XDG

From an ancient post I previously did…I need to refresh my mind on this topic often enough thought it worthy of breaking it out. How Linux systems figure out what program should open a file Programs that handle arbitrary files (e.g. web browsers, irc clients, file managers) delegate to a general purpose resource handler. XDG MIME Applications is the ubiquitous option here, and is not only an implementation, but a full blown specification. ...

February 1, 2022 · 2 min

Migrating off Google Workspaces (Google Apps or G Suite)

Google Workspace (formally Google Apps, formally G Suite) After years of frustration in the Google platform, specifically G Suite (also known as Google Apps or Google Workspace) it all recently came to a head for me after I received a couple of Google Nest cameras as gifts last Christmas. Having been a strong Google proponent since the late 90’s, when Google was a cool startup bucking the trend with their famous do not be evil mission, Googles brand within the technical community rose to dizzying heights. Ever since the Google brand has always had a strong influence on me and I have happily recommended their products to people I care about. ...

January 30, 2022 · 7 min

DVD backups on GNU/Linux

This is how I like to create digital copies (i.e., backups) of my physical DVD collection, which I own legitimately. I don’t condone piracy or theft. Backup instructions Rip physical DVD media makemkv Transcode mkv to m4v container using Fast 1080p30 preset in handbrake. Passthrough UTF-8 subtitles if you like those. Copy to media backup server rsync --protect-args -av --progress Season8 "shnerg@172.16.1.32:/data/TV/Penn & Teller Bullshit/" Software MakeMKV transcoder that deals with proprietary (and usually encrypted) disc into a set of MKV files Handbrake general video transcoder The C source is available as tarballs makemkv-bin-1.16.5.tar.gz and makemkv-oss-1.16.5.tar.gz. The Linux release includes full source code for MakeMKV GUI, libmakemkv multiplexer library and libdriveio MMC drive interrogation library. ...

January 21, 2022 · 2 min

My Glorious GMMK Pro 75% custom keyboard

Last year I decided in addition to my amazing ErgoDox EZ to look for a 75% layout keyboard (think a more minimal version of ten-keyless). After wasting far too much time on r/MechanicalKeyboards the Glorious GMMK PRO hit my radar. Short for Glorious Modular Mechanical Keyboard, the pro version cuts the previous full sized keyboard version down to a 75% design with a digital rotary dial. GMMK PRO is an ultra premium, gasket-mounted 75% layout keyboard built for enthusiasts, gamers, and professionals. ...

January 13, 2022 · 3 min

Rust cheat sheet (2022)

Please refer to Don Bright’s original rust-lang-cheat-sheet which I based much of this content off, as I work through The Book. Rust in a nutshell Documentation Toolchain Mutability basic Types and variables Operators Run time errors, Crashing, panic, except, unwrap, Option, Result Printing loop, while and for Concurrency, parallel processing Functions and closures Unit tests, integration tests Documentation If, conditionals, patterns, match, control flow Ownership, Borrowing, References, Lifetimes Arrays, Slices, Ranges Structs Enums Collections, Key-value pairs, Sets Macros Little programs Guess a number Cool references Rust in a nutshell Syntax similar to C Ownership of memory enforced at compile time Statically linked Functional-ish, generic-ish, not so objecty Control flow using patterns, match keyword Packages: ‘cargo’ command, https://crates.io Testing: cargo test, #[test] Concurrency: ownership, mutability, channels, mutex, crossbeam + Rayon packages Auto formatter: rustfmt filename.rs Compiler engine: LLVM Raw pointers, low level: unsafe{} keyword Documentation rustup doc for offline docs! doc.rust-lang.org standard library, primitive types, standard macros docs.rs for package documentation Toolchain $ rustup.sh # install rust, see rust-lang.org for details $ cargo new myproj # start new executable project $ cargo new --bin myproj # as above $ cargo new --lib myproj # start new library project $ cd myproj # cd into the new directory $ ls -lR # list our skeleton of files src/main.rs # main.rs, has main() entry point Cargo.toml # Cargo.toml defines packaging $ $EDITOR Cargo.toml # add dependencies and other details $ cargo build # downloads dependencies + builds main.rs $ cargo build --release # release build $ cargo check # make sure code compiles, without binary outputs $ cargo update # ignore Cargo.lock and figure out latest versions $ cargo run # runs program created from main.rs $ cargo doc --open # local web based doc $ cargo test # runs tests (in parallel by default) $ cargo test -- --test-threads=1 # run tests one at a time $ cargo test -- --nocapture # run tests, show output $ cargo run --example fundemo -- --argtodemo # run example with argument $ rustc --explain E0384 # eli5 what an error code means Mutability basic let x = false; // all variable bindings are immutable by default x = true; // compile error: can't change an immutable binding let mut p = false; // "mut" designates a binding as mutable p = true; // ok, mutable binding can change; Types and variables Rust provide two compound types; arrays and tuples. ...

December 11, 2021 · 26 min

st emoji support with libXft BGRA glyph patch

The Problem st crashes whenever an emoji needs to be rendered. It turns out to be an issue with the underlying font rendering library libXft. libXft is the client side font rendering library, using libfreetype, libX11, and the X Render extension to display anti-aliased text. The Solution In its current offical mainline form libXft does not support rendering images. A patch by Maxime Coste exists to add support for BGRA glyphs and scaling, effectively enabling emoji rendering support. ...

December 7, 2021 · 2 min

dotnet worker kubernetes health probe

The Problem You have a (headless) background worker process that needs to communicate its readiness to kubernetes. The Solution ASP.NET Core provides a decent approach to performing a series of agnostic health checks. There are hundreds of health probes available such as Network, Elasticsearch, Kafka and NpgSql. However being part of ASP.NET Core, does mean that some of these dependencies, such as Microsoft.AspNetCore.Diagnostics.HealthChecks package, will bleed into the worker as a needed dependency. The plus side is that you can avoid reinventing the wheel. ...

November 18, 2021 · 2 min

OpenShift NginX 13: permission denied /var/cache/nginx/client_temp

Trying to deploy an NGINX container to an OpenShift cluster today, ran into: nginx: [emerg] mkdir() "/var/cache/nginx/client_temp" failed (13: Permission denied) To do some investigating spun up a new Pod an attached an interactive shell using oc: oc run --rm -i -t frontend --image=artifactory.evilcorp.com/frontend:1.0.0 --restart=Never --command -- /bin/sh Indeed a quick ls -la /var/cache revealed that the nginx subdirectory is writtable by root. No good for OpenShift, which by default is non-root: ...

August 26, 2021 · 1 min