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

Kubernetes Secrets encoding gotcha

Kubernetes provides a neat concept for managing sensitive pieces of data, the Secret A Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key. Such information might otherwise be put in a Pod specification or in a container image. Using a Secret means that you don’t need to include confidential data in your application code. Secret text is by default base64 encoded. For this reason it’s recommended that secret definitions are not published to git. ...

August 25, 2021 · 2 min

React environment variables in an nginx container

Your React app is ready to ship. Congratulations! Packaging for production is (and should) be different from your development configuration. In the case of Create React App the toolchain is rich, includes development productivity conveniences such as hot reloading, source maps and custom environment variables. This toolchain is mind blowingly productive as you develop the app, npm start and watch the magic unfold. At this point, its possible to put the React app one big (~1.7GB) happy container: ...

August 21, 2021 · 3 min

Debian install notes

I’m moving lots of my machines back to Debian in the yearning for rock solid stability and a complete distribution that just works. Debian was the first GNU/Linux I ever used as a teenager back in late 90s and I’ve fond memories of it. Starting with the official amd64 install guide. Preparation Make USB key I quickly discovered I want the image that includes proprietary firmware, so I can get my (nasty) wifi card working as quickly as possible. ...

July 11, 2021 · 3 min

Notes from the book Atomic Habits

I just read the kindle edition of Atomic Habits by James Clear. Its worth the time investment, giving practical ways for building desired habbits and more importantly, breaking bad ones. The habit loop The four stages of habit are an endless cycle. This habit loop is continually scanning the environment, predicting what will happen next, trying out different responses, and learning from the results. The cue triggers a craving That motivates a response That provides a reward That satisfies the craving and, ultimately, becomes associated with the cue 4 laws of behavior change The pillars of the book, are the four stages of the habit building process: ...

June 12, 2021 · 15 min

Binary Similarity Analysis Technical Paper

An academic paper I authored in May 2019, as part of studying Reverse Engineering at UNSW. Abstract Extracting meaningful semantic differences between software binaries without source code is difficult. This is a challenging problem due to the overwhelming amount of syntactic noise that small changes can result in at the assembly level. Curiously when it comes to program semantics the “signal from the noise” can be distilled in a manner that is both static and processor agnostic, through the application of control flow and graph isomorphism analysis, symbolic execution and theorem proving. The graph isomorphism problem has no known polynomial time algorithm (i.e. is NP) making brute force approaches computationally infeasible. By blending various static analysis techniques and applying some generalisations, consider a novel approach to overcoming the computationally infeasibility of this problem domain with a view to binary difference analysis. ...

May 29, 2021 · 17 min

Hiking pack system

Stacked packing system Inner pack Side pockets Front pocket Options Ditty bag Food Cold soak meal recipes Refried beans Pinto beans Cous Cous Veggies Oil wrap Potato Bomb Rice Bomb Oatmeal Cereal Useful resources Lessons learned April 2021 November 2021 Over the last year I have been experimenting with reducing the weight of my hiking pack when out on track. Reading books on ultralight hiking, has me with some strategies for doing so. ...

May 29, 2021 · 5 min

Gentoo Linux

The next step in my minimalist computing journey. Enter Gentoo, my first source based GNU/Linux distro. Pre-packaged binaries, which is the approach most other (binary based) distros take, must often cater for the lowest common denominator to ensure packages can run on lots of differing setups out in the wild. On a source based distro, I can articulate my specific needs (USE flags on Gentoo) to finely tune the binaries to my system. For example, as I plan to steer clear of software like systemd, kde and gnome, I can ensure support for these packages is NOT built into other program binaries I build for my system. ...

February 22, 2021 · 13 min

KVM virtualisation

The Kernel Virtual Machine is a hypervisor for Linux on hardware with virtualization extensions (Intel VT or AMD-V). It is deployed as a loadable kernel modules, kvm.ko, and either kvm-intel.ko or kvm-amd.ko. The KVM Debian Wiki rocks, and provides details on the basics including a great performance tuning section. Install Administration tasks User specific vs system wide VMs List VMs Start VM Shutdown VM Murder (hung) VM Autostart default NATed bridged network What if the default network interface is not listed How to extend / increase a partition Use network ISO source for new VMs Windows VM disk driver Install Easy instructions to get QEMU/KVM and virt-manager up and running on Arch. ...

October 31, 2020 · 4 min