A guide on how to manage multiple SSH keys for different GitHub organisations using hasconfig remote and includeif in .gitconfig, all native and no custom scripts.| code.mendhak.com
Articles, information, and tutorials on development, programming, technology, science.| code.mendhak.com
Exploring the new Android Linux Terminal, how to set up Python and see if personal app development is feasible| code.mendhak.com
Using Gemini CLI to quickly ask a question and get an answer, without interacting with it.| code.mendhak.com
My terminal-based text editing almost always occurs in short sessions. I’ll usually want to modify something and get out. To me, it makes no sense to have to step on a learning curve for a text editor. A good tool gets out of your way, which is why I don’t tend to favour vim, and only tolerate nano.| Mendhak / Code
There are only two viable optiosn for automatic infinite scroll mouse| code.mendhak.com
Using rtl-sdr, gqrx, rtl_433, sdrangel to listen and decode radio on Ubuntu| code.mendhak.com
A Dockerfile in multiple stages for running Python applications with uv, fuff, and pytest| code.mendhak.com
The safest and most reliable way to deal with feature flags is to hardcode them| code.mendhak.com
Compose keys in Linux are the nicest way of entering| code.mendhak.com
Structured DNS Errors is a new standard that should soon lead to helpful and useful error messages in browsers| code.mendhak.com
I’ve been seeing some buzz around Sigstore recently, it’s a project that aims to improve software supply chain security by making signing and checking easier. It has seen ongoing work in the Python and Maven ecosystems, as well as npm and Github Actions, which is pretty significant.| Mendhak / Code
On Ubuntu 22.04 and 24.04, the background image that you set for your desktop doesn’t appear on the login screen. I will go over two ways of synchronizing the login screen wallpaper to match the one chosen for the desktop.| Mendhak / Code
While setting up PiHole on an Ubuntu 24.04 server, I realized that the usual instructions I’d been following for years on Debian systems for setting a static IP address (often involving /etc/network/interfaces or /etc/resolv.conf) weren’t going to work here. It’s worth sharing now that I’ve learned how for myself. Netplan basically acts as a translation layer, it takes configuration files, and creates the right systemd-networkd or Networkmanager configuration.| Mendhak / Code
When working with certain AWS services that require secure connectivity over TCP, you might run into the dreaded “unable to get local issuer certificate” error. This is because the service is presenting a certificate signed by an Amazon CA that isn’t in your trust store. I’ve commonly seen this with services such as Redis, DocumentDB, RDS, etc.| Mendhak / Code
When the lockdown was announced in March 2020, there was a surge of traffic to online grocery sites. Although I had been an early adopter and frequent user of several online supermarkets, I found myself unable to access many of my usual shops due to the way they decided to handle the traffic.| Mendhak / Code
A really nice quality of life feature I’ve noticed in some applications is the ability to automatically hyperlink some selected text when pasting a URL over it. To be clear this isn’t about automatically converting URLs in text into hyperlinks, rather when you have some text selected and you paste a URL over it, the text becomes a hyperlink to the URL just pasted.| Mendhak / Code
GraphQL’s touted advantages are numerous, including data retrieval efficiency, and flexibility that it can enable. This page even calls its developer experience its greatest benefit, but this is only true from the API owner’s perspective, not the API consumer’s. That might explain why it sells so well to API development teams in organisations; their local experience gives them the assumption that their own experience will mirror the consumer’s.| Mendhak / Code
In this post I will go over an approach to getting developers familiar with, and write code against LLMs. The aim is to get developers comfortable interacting and programming with LLMs. It is only a starting point; it’s not meant to be in depth in any way, nor will it cover the inner workings of LLMs or how to make your own.| Mendhak / Code
The most common programmatic interaction with Large Language Models (LLMs) and LLM APIs (ChatGPT, Claude) is to give it some natural language instructions and get a shaped, specific output back. For example you might ask it to summarize a news article for you, and have it respond only with the summary, for storage and further processing later. More advanced applications might have the LLM acting as an agent with tooling that needs to be invoked, so it outputs (in JSON) a tool name with some a...| Mendhak / Code
While most well known Large Language Models (LLMs) are closed and behind paywalls, there exist open models such as LLaMa and its derivatives, available for free and private use. A thriving open-source community has built up around them, and projects like MLC and llama.cpp bring these LLMs to consumer devices such as phones and laptops.| Mendhak / Code
As I spend a lot of time on the CLI, I often need to look up commands, even if I’ve used them before. I like to offload memory elsewhere if I don’t need to remember things, including commands, boilerplate code, birthdays, phone numbers and so on, and do a search when I need them. As a convenience, I have written a CLI lookup tool, accessible from the commandline itself. It works by making use of LLMs such as OpenAI GPT 3.5 and Llama2.| Mendhak / Code
Common ways of choosing a password manager are to see what everyone else is using, search for what’s popular, or just pick something convenient. I do the same, but also want to spend some time evaluating my choices because password managers are the ‘keys to the kingdom’. Threat modelling feels like a really good fit in helping evaluate these choices, doing so at a high level can go a long way towards granting assurance and peace of mind.| Mendhak / Code
My favorite kind of features are usually ones that let you start simple and still let you build powerfully on top without being overwhelming. .NET’s ConfigurationBuilder being one, is one of my favorite framework features. It’s used regularly in codebases, without much thought given to it, but I wanted to take a moment to appreciate it.| Mendhak / Code
There are two ways that websites can offer users a choice between light and dark mode. The first makes use of pure CSS and is managed natively by the browser. The other involves a combination of CSS and Javascript and is usually accompanied by a sun/moon toggle that the user can click on.| Mendhak / Code
I recently switched from a Kindle device to a Kobo Libra 2, and have been playing around with its customization and tweaks. These are the ones I’ve found useful so far. They include dark mode, immersive reading, less fidgeting, Pocket and Overdrive. Most important is integration with Calibre Web, and some unlocked features with NickelMenu.| Mendhak / Code
The common, prevailing advice given regarding TLS certificates is to avoid using wildcard certificates. That is, when securing a domain, it is considered a best practice to use a certificate for mydomain.example.com instead of *.example.com.| Mendhak / Code
I have a simple epaper dashboard project, which displays the time, date, weather and calendar entries. Of course the format is entirely specific to English, and I had naïvely assumed that everyone would understand “Friday Feb 17, 2023” and “5:20 PM”. When I received a feature request to display the preferred time format based on the system’s locale, I decided to apply it to the days and dates too, which sent me down a rabbit hole of locales, formats, and figuring out how to display...| Mendhak / Code
A rite of passage exists, that after a certain amount of time spent writing on a platform, a blogger feels a need to revamp or migrate to something else. I used to come across such posts on various other blogs and I’d be dismissive of them. Just be happy with what you have, right? As it turns out, no, there are always good reasons to move, and it took me a while to understand that. I can say I am glad to be free of the torturous hell that is Jekyll and Ruby.| Mendhak / Code
I used to develop my app solely for the Play Store, until just 2 years ago when I determined that the stress of arbitrary removals had accumulated to an unsustainable level.| Mendhak / Code
Security improvements tend to be a one way street, they are usually implemented in newer versions of operating systems, and by extension, on newer mobile devices. There is an assumption often made by technologists, that mobile device users are going through a constant upgrade cycle, but the assumption is made from a position of inequality, and grossly misunderstands how devices are used by a huge majority of the world. (Though in fairness, there is only so much support the technology sector...| Mendhak / Code
I prefer running my Torrent (and related tools) in a container, for isolation from my host OS, as well as the ability to route all of its traffic through a VPN.| Mendhak / Code
Stable Diffusion is a machine learning model that can generate images from natural language descriptions. Because it’s open source, it’s also easy to run it locally, which makes it very convenient to experiment with in your own time. The simplest and best way of running Stable Diffusion is through the Automatic1111 repo, but there’s also a commandline friendly Dream Script Stable Diffusion fork, which comes with some convenience functions.| Mendhak / Code
I have written a script that will attempt to update your Github user profile status with the game currently being played on Steam. I haven’t been using the Github Profile Status feature for any purpose, so might as well use it for something interesting to me.| Mendhak / Code
Dealing with open source software, I regularly encounter many kinds of licenses — MIT, Apache, BSD, GPL being the most prominent — and I’ve taken time out to read them. Of the many, the GNU General Public License (GPL) stands out the most. It reads like a letter to the reader rather than legalese, and feels quite in tune with the spirit of open source and software freedom.| Mendhak / Code
I used to have a simple life — I’d buy books off Amazon, and read them on a Kindle. But over the past few years, my reading habits changed drastically. I’m now reading a lot more things, from a lot more sources, on a lot more devices and have had to break out of the Amazon bubble.| Mendhak / Code
There is a growing focus on Zero Trust security models across businesses, and with this changing landscape will come a new set of security paradigms and processes that end users will need to adapt to.| Mendhak / Code
On Steam, I like to trade with other users to complete my card sets, and craft badges. A common way to find users offering trades is on the Steam Trading Cards Group. Now, in this group, some people will accept cross-set trades.| Mendhak / Code
Does there exist a key more useless, more banal in its existence than Caps Lock? For most typical computer usage and software development there is no reason to use it, and yet it persists as a holdover from the typewriter era.| Mendhak / Code
It might appear that the tech industry tends to gravitate towards tools, languages and frameworks that are highly flexible by design. Said technologies will capture attention through numerous blog posts, articles and social media bluster about them, perpetuating their hype cycles. The problem with this perception is that it prematurely captures mindshare which in turn can lead to poor decision making among the unseen 99% of developers.| Mendhak / Code
In Bash I use a very basic prompt which is simple and effective.| Mendhak / Code
As a computing end user, I’ve been vaguely aware of quantum computing on the horizon, but haven’t been aware regarding its effect on us. To that end I decided to get a generalist’s understanding of how quantum computers would affect our security, and what’s happening right now in the industry to address these issues. I’m only vaguely aware that our SSH keys will need changing, and browsers will need to perform TLS differently, but without understanding the why and the ‘behind the...| Mendhak / Code
Smashtest is a DSL on top of Selenium that makes reading and writing tests easy. It focuses on improving productivity with a lot of helpful features, it can run tests in parallel and also comes with an interactive mode.| Mendhak / Code
I have previously shown how to serve keys to WSL1, here I’ll be going over the method to do it for WSL2.| Mendhak / Code
It’s possible to host your OpenAPI (Swagger) JSON as well the UI from within API Gateway itself, without needing an S3 bucket or any additional infrastructure.| Mendhak / Code
I have created a simple, DIY e-paper dashboard setup that displays the weather and calendar information. It’s minimal, and doesn’t require a lot of power, so it can run on a Raspberry Pi Zero. I have been running it for several years now and it is very reliable.| Mendhak / Code
To the tune of Go the Fuck to Sleep| Mendhak / Code
If you have a Github Action set on a cron schedule, but don’t necessarily want it to always run on that schedule - for example a daily cron that doesn’t always need to run daily - it’s possible to introduce a random cancellation step.| Mendhak / Code
The Doomsday algorithm is a memory trick that lets you figure out the day of the week that a given date falls on. I’ll go over the simplest variation of this which is a good starting point, and requires refreshing just once a year.| Mendhak / Code
The well known A, B, C series paper sizes may seem arbitrary at first glance, but they are actually based on some simple basic principles which make it easy to calculate and understand. They are quite intuitive and easy to work with and are based on good mathematical foundations.| Mendhak / Code
AWS recently announced the ability to use Docker images in your Lambda functions. Here I’ll go over a basic set of steps to get a simple example working.| Mendhak / Code
When mapping tall buildings, it’s important to ensure that the drawn area matches the building’s footprint - where it intersects with the earth.| Mendhak / Code
How to set up an Angular application. Secured with Auth0 logins and protected API requests. With the configuration loaded dynamically via a web request.| Mendhak / Code
Sometimes you may need to run an app that you’re not comfortable with or don’t necessarily trust. Android comes with a feature that lets you run such apps in relative isolation, without compromising your security or privacy.| Mendhak / Code
Grub Reboot Picker is a tray application that helps you reboot into other operating systems or kernels, UEFI, BIOS, or just reboot.| Mendhak / Code
Steps that I take to install WSL with Ubuntu, and set up a dev environment to work with Docker, correct permissions and a few other tweaks, on Windows 10. I’ll show the commands to run with explanations.| Mendhak / Code
Both gnome-terminal in Ubuntu as well as Windows Terminal with bash allow you to set the title of the current tab you’re working in. This can be useful if you’re in multiple shell sessions and need a visual cue to switch between them.| Mendhak / Code
KeePassXC is an alternative to KeePass 2; an interesting feature is that it has SSH agent support built in, rather than supplied via a plugin. It can be used to serve SSH keys to WSL1, which is useful when remoting on to servers, or using Git over SSH.| Mendhak / Code
When working with a Raspberry Pi Zero W, as there is no network port, you will need to enable WiFi and SSH as well so that you can connect to it when it first boots.| Mendhak / Code
Here I will go over a Terraform script to help with running a cheap Selenium Grid, in an AWS ECS cluster, with the containers managed by Fargate Spot instances. To put it in a simpler way, this Selenium Grid (hub and nodes) runs in Docker containers, the containers are run on an ECS Cluster. Within ECS, the containers are managed by Fargate, which immensely eases the running of containers from your perspective - you don’t have to specify instance details, just tell it how much CPU/RAM you...| Mendhak / Code
Modern SSDs now come with built in commands that can wipe a disk for you. This is an action that should normally be performed when you’re about to give/sell it away.| Mendhak / Code
How to properly validate TLS certificates from Android applications - without bypassing or compromising validation.| Mendhak / Code
Documenting the steps I took to get NextDNS, NordVPN and restricted WiFi networks to work together.| Mendhak / Code
When creating software for distribution to end users, it’s a good idea to enable checking its integrity and trustworthiness.| Mendhak / Code
Although I’m not a prolific or advanced editor, I do enjoy contributing to OpenStreetMap. I’ll generally perform edits when I notice new changes in my area or while on holiday when I find certain features, trails or details are missing.| Mendhak / Code
Many node packages and tools will encourage you to install their tools globally. This is a bad practice and should be avoided.| Mendhak / Code
curl is normally used to issue a single request against a URL. Sometimes you need to issue multiple requests against a URL, or quickly stress test a server or endpoint. You don’t have to do this using bash’s loops, instead you can use curl’s own sequences feature, []| Mendhak / Code
If applied, this commit will:| Mendhak / Code
This Apache Airflow operator can send messages to specific MS Teams Channels. It can be especially useful if you use MS Teams for your chatops. There are various options to customize the appearance of the cards.| Mendhak / Code
How to serve SSH keys to ssh running in WSL (Ubuntu) from KeeAgent running in Windows 10.| Mendhak / Code
While KeePass is generally used for storing credentials, it can also be used to store SSH keys as well as serve those SSH keys when applications need it.| Mendhak / Code
When someone submits a pull request to your repository, it is actually possible to update their pull request by pushing commits to their fork.| Mendhak / Code
Understanding and measuring Angular JS perceived performance| Mendhak / Code
When running Gradle tests on Travis CI, the terminal is usually set to dumb mode, so you get very plain looking output. However, Travis does allow for colors in their logs.| Mendhak / Code
I’ve often had to test various aspects of web requests such as whether the right headers, querystrings, body, methods, etc. were being passed correctly.| Mendhak / Code
This build feature sends build status updates from TeamCity to Bitbucket. You can then see build statuses against commits.| Mendhak / Code
Automatically turning off the XBox 360 controller off when the PC is shut down| code.mendhak.com
Using basic Linux Bash commands to demonstrate a simple reverse shell.| code.mendhak.com
My favourite networking troubleshooting commands, like curl, nc, dig, openssl, etc.| code.mendhak.com
Leaving Lightroom behind and moving on to better photography workflow tools.| code.mendhak.com
How I modified my Kobo to generate images from higlighted text using Stable Diffusion, and ELI5 feature to simplify text using OpenAI.| code.mendhak.com
How to use KeePassXC to sign your git commits using the git ssh signing feature| code.mendhak.com