Skip to content

Instantly share code, notes, and snippets.

View kvaps's full-sized avatar
🔳
This mess is mine!

Andrei Kvapil kvaps

🔳
This mess is mine!
View GitHub Profile
@kvaps
kvaps / test_disk.sh
Last active January 28, 2026 06:11
Test disk with fio and parse results
#!/bin/sh
run(){
name="$1"
shift
(
set -x
# defailt parameters
fio -name="$name" -filename=$disk -output-format=json -ioengine=libaio -direct=1 -randrepeat=0 "$@" > results/$disk_dashed-$name.json
)
@kvaps
kvaps / README.md
Last active January 20, 2026 15:29
Claude Code statusline with API usage limits (fixed bunx -> ccusage) [forked from https://gist.github.com/lexfrei/b70aaee919bdd7164f2e3027dc8c98de]

Claude Code Statusline with Real Usage Limits

Enhanced statusline for Claude Code that shows real quota usage from Anthropic API instead of estimates.

Features

  • 🟢🟡🟠🔴 Rate indicators — compares usage% with elapsed time%
  • 5-hour window — always shown with time remaining
  • 7-day window — shown only when ≥70% used
  • 60-second cache — avoids excessive API calls
@kvaps
kvaps / rspamd-lists.md
Last active October 9, 2025 16:10
Howto create local whitelists and blacklists for Rspamd

Local whitelists and blacklists for Rspamd

  • cd /etc/rspamd
  • create rspamd.conf.local
  • create lists:
touch local_bl_from.map.inc local_bl_ip.map.inc local_bl_rcpt.map.inc \
local_wl_from.map.inc local_wl_ip.map.inc local_wl_rcpt.map.inc
  • change permissions:
@kvaps
kvaps / node-bootstrup.sh
Created August 14, 2023 18:36
Add external kubeadm node to Talos cluster
VIP="192.168.100.5"
mkdir -p /etc/kubernetes/pki
talosctl -n "$VIP" cat /etc/kubernetes/kubeconfig-kubelet > /etc/kubernetes/kubelet.conf
talosctl -n "$VIP" cat /etc/kubernetes/bootstrap-kubeconfig > /etc/kubernetes/bootstrap-kubelet.conf
talosctl -n "$VIP" cat /etc/kubernetes/pki/ca.crt > /etc/kubernetes/pki/ca.crt
sed -i "/server:/ s|:.*|: https://${VIP}:6443|g" \
/etc/kubernetes/kubelet.conf \
/etc/kubernetes/bootstrap-kubelet.conf
@kvaps
kvaps / grub.cfg
Created January 18, 2018 15:38
Grub config for EFI and PXE boot
set timeout=3
menuentry 'Linux diskless' --class os {
insmod efi_gop
insmod efi_uga
# set server from option 66 (tftp-server-name) if not exist, use next_server
if ! net_get_dhcp_option net_default_server ${net_default_interface} 66 string; then
echo ' using next_server option instead.'
wget https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/x86_64/alpine-standard-3.22.1-x86_64.iso
qemu-img create -f qcow2 alpine.qcow2 8G
qemu-system-x86_64 -m 512 -nic user -boot d -cdrom alpine-standard-3.22.1-x86_64.iso -hda alpine.qcow2 -nographic -enable-kvm -cpu host
========================
setup-alpine
poweroff
@kvaps
kvaps / nfs-ganesha-vs-kernel-benchmark.md
Last active April 19, 2025 03:16
NFS-Ganesha vs NFS-Kernel-Server Benchmark

local read: IOPS=12308, BW=48.1MiB/s write: IOPS=4111, BW=16.0MiB/s

nfs3-ganesha read: IOPS=7039, BW=27.5MiB/s write: IOPS=2352, BW=9.2MiB/s

nfs3-kernel read: IOPS=6571, BW=25.7MiB/s

@kvaps
kvaps / talos-build.sh
Last active April 15, 2025 16:19
How to build talos with custom kernel extensions
# Builds pkg
cd ./pkgs
git checkout release-1.9
make PKGS_PREFIX=ghcr.io/kvaps/talos PUSH=1 USERNAME=kvaps/talos PLATFORM=linux/amd64
# output would be:
# => pushing manifest for ghcr.io/kvaps/talos/base:v1.9.0-15-g45c4ba4-dirty@sha256:f3d0f691752e3158c4f36b05e4b5abad2e68437f0faa0928887e69e568ca364d
# Builds talos (with clustom pkgs)
cd ./talos
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: test
namespace: test
spec:
clusterNetwork:
pods:
cidrBlocks:
@kvaps
kvaps / openshift-console.yaml
Last active December 13, 2024 03:14
Openshift-console for Kubernetes with OIDC
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
qbec.io/component: console
labels:
qbec.io/application: openshift-console
qbec.io/environment: stage
name: openshift-console