Skip to content

Instantly share code, notes, and snippets.

View kwilczynski's full-sized avatar
:octocat:

Krzysztof Wilczyński kwilczynski

:octocat:
View GitHub Profile
@kwilczynski
kwilczynski / Makefile
Created February 20, 2024 11:19
Simple Linux kernel module to toggle running process state between "D" (uninterruptible) and interruptible
ccflags-y := -DDEBUG -Wfatal-errors
ifneq ($(KERNELRELEASE),)
obj-m += state-toggle.o
else
BUILD_KERNEL ?= /lib/modules/$(shell uname -r)/build
default:
$(MAKE) -C $(BUILD_KERNEL) M=$(CURDIR) modules
endif
@aojea
aojea / README.md
Last active April 13, 2024 14:52
Kubernetes DNS: Headless services with large number of endpoints

Kubernetes DNS at scale

It seems that is a common practice in HPC and AI/ML environments that use MPI applications to populate a hosts files with all the nodes on the cluster and copy it over all the nodes, ref https://help.ubuntu.com/community/MpichCluster

It is my observation that in Kubernetes, Headless Services are used to implement this Service Discovery This is very handy because it allows to reference a pod by hostname without having to copy over a generace /etc/hosts.

There must also be an A record of the following form for each ready endpoint with hostname of and IPv4 address . If there are multiple IPv4 addresses for a given hostname, then there must be one such A record returned for each IP.

@aojea
aojea / daemonset.yaml
Created December 3, 2023 16:18
Daemonset to reconcile nodes ethtool configuration
# See for more options https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node-ethtool
namespace: kube-system
labels:
k8s-app: node-ethtool-config
spec:
selector:
@kwilczynski
kwilczynski / tags.txt
Created October 27, 2023 11:04
Linux kernel preferred commit tag order
Fixes:
Closes:
Suggested-by:
Link:
Reported-by:
Tested-by:
Co-developed-by: (co-author)
Signed-off-by: (co-author)
Signed-off-by: (author)
Signed-off-by: (chain)
@aojea
aojea / README.md
Last active March 26, 2024 13:13
BPF cheatsheet
@saschagrunert
saschagrunert / Vagrantfile
Last active October 30, 2023 13:35
Environment for building Red Hat packages
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrant box for testing
Vagrant.configure("2") do |config|
config.vm.box = "fedora/35-cloud-base"
memory = 6144
cpus = 4
config.vm.provider :virtualbox do |v|
@rbitr
rbitr / random_notes.md
Last active November 10, 2023 16:34
Confusion about using $RANDOM to generate random numbers

Random numbers in bash et al

There is a variable $RANDOM than you can read in bash or zsh to get a random number beteen 0 and 32767. Here in zsh on my (old) mac:

% echo $RANDOM
13757
% echo $RANDOM
16896
@kwilczynski
kwilczynski / openpgp.md
Created December 21, 2022 20:07
openpgp.md

$argon2id$v=19$m=64,t=512,p=2$G/DQSn2+4afFDXZRdR3Vlw$DBvv46nt3EEkY5ehfDVfQQ

Keybase proof

I hereby claim:

  • I am kwilczynski on github.
  • I am kwilczynski (https://keybase.io/kwilczynski) on keybase.
  • I have a public key whose fingerprint is 12D2 7D5D 8C8E 9BF1 AABC 7C7C 7C64 768D 3DE3 34E7

To claim this, I am signing this object:

name: "Auto-merge Dependabot Pull Request for Dockerfile updates"
permissions:
pull-requests: write
contents: write
on:
pull_request_target:
branches:
- main