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 / solana-healthcheck.sh
Created July 9, 2024 11:40
Solana healthcheck
#!/bin/bash
catchupKey=$1
# Check catchup
if [ -n "$catchupKey" ]; then
catchupInfo=$(solana catchup --output json-compact "$catchupKey" http://127.0.0.1:8899/ 2>&1)
if ! echo "$catchupInfo" | grep -q 'has caught up'; then
echo "$catchupInfo"
exit 1
fi
------
lxc
------
fix centos EOL repos
https://stackoverflow.com/a/70930049/2931267
fix old systemd in lxc container
https://forum.proxmox.com/threads/how-to-proxmox-7-cgroupv2-centos-7-upgrade-systemd-without-systemd-unified_cgroup_hierarchy-0.94253/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: test
namespace: test
spec:
clusterNetwork:
pods:
cidrBlocks:
@kvaps
kvaps / fix.sh
Last active November 15, 2023 14:14
LINSTOR fix wrong storage pool in version before 1.25 (error: Storage driver 'LVM_THIN' not allowed for volume.)
# make backup
kubectl get crds | grep -o ".*.internal.linstor.linbit.com" | xargs kubectl get crds -ojson > crds.json
kubectl get crds | grep -o ".*.internal.linstor.linbit.com" | xargs -i{} sh -xc "kubectl get {} -ojson > {}.json"
---
# collect resources in weird states:
cat resources.internal.linstor.linbit.com.json | jq '.items[] | select(.spec.resource_flags>1024) | "\(.spec.resource_name) \(.spec.node_name) \(.spec.resource_flags)"' -r > list.txt
# reset them to 0:
@kvaps
kvaps / loop.sh
Created October 16, 2023 22:27
mydumper/myload
#!/bin/bash
set -e -o pipefail
user=root
password=hackme
host=127.0.0.1
port=3306
dbs=$(mysql -u$user -p$password -h$host -P$port -e 'SHOW DATABASES;' | tail -n+2)
@kvaps
kvaps / talos-build.sh
Created August 16, 2023 08:48
How to build talos with custom kernel extensions
# Builds pkg
cd ./pkgs
make USERNAME=kvaps/talos PLATFORM=linux/amd64 PUSH=1
# Builds extensions with specific PKGS
cd ./extensions
make installer USERNAME=kvaps/talos PLATFORM=linux/amd64 PUSH=1 PKGS=v1.4.1-14-ge911ac5-dirty
# Builds talos (clean)
cd ./talos
@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