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 / 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 / .gitignore
Created July 25, 2023 20:06 — forked from mcastelino/.gitignore
cloud-init ubuntu nocloud example with network config
*.img
*.raw
@kvaps
kvaps / .gitignore
Created March 10, 2023 15:08 — forked from smoser/.gitignore
cloud-init ubuntu nocloud example with network config
*.img
*.raw
// SPDX-License-Identifier: GPL-2.0-or-later
/*
drbd_transport_rdma.c
This file is part of DRBD.
Copyright (C) 2014-2021, LINBIT HA-Solutions GmbH.
*/
#undef pr_fmt
@kvaps
kvaps / convert-deploymentconfig-to-deployment.md
Created January 25, 2022 09:10 — forked from bmaupin/convert-deploymentconfig-to-deployment.md
Convert OpenShift DeploymentConfig to Kubernetes Deployment
  1. Change apiVersion from:

    - apiVersion: v1

    (or apiVersion: apps.openshift.io/v1)

    to:

@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 / indent-to-nindent.sh
Created December 28, 2021 12:10
Oneliner to replace indents with nindents in Helm chart
grep -rnoP '(?<= indent )[0-9]+' > /tmp/11
cat /tmp/11 | awk -F: '{print $1 " " $2 " " $3}' | while read file line indent; do echo "file=$file line=$line indent=$indent"; sed -i -e "$line s/^ *{{-\?/$(printf '%0.s ' $(seq 1 $indent)){{-/" -e "$line s/ indent \([0-9]\+\)/ nindent \1/g " $file; done
@kvaps
kvaps / raw_mode_posix.go
Created August 22, 2021 22:09 — forked from EddieIvan01/raw_mode_posix.go
syscall to set raw-mode-input terminal in Go (Posix/Windows)
// +build darwin linux
package main
import (
"os"
"syscall"
"unsafe"
)
@kvaps
kvaps / envoy.yaml
Last active July 26, 2021 15:27
ACME-proxy for multiple backends on envoy
static_resources:
listeners:
- name: listener_0
address:
socket_address: { address: 0.0.0.0, port_value: 10000 }
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
@kvaps
kvaps / one_xmlrpc_client.sh
Created June 29, 2021 17:35
OpenNebula XML-RPC shell client debug script
#!/bin/bash
print_value() {
case "$1" in
string:*) echo ' <param><value><string>'${1##string:}'</string></value></param>' ;;
i4:*) echo ' <param><value><i4>'${1##i4:}'</i4></value></param>' ;;
int:*) echo ' <param><value><int>'${1##int:}'</int></value></param>' ;;
boolean:*) echo ' <param><value><boolean>'${1##boolean:}'</boolean></value></param>' ;;
array:*)
echo ' <param><value><array><data>'