Skip to content

Instantly share code, notes, and snippets.

View axeal's full-sized avatar

Alex Seymour axeal

View GitHub Profile
@superseb
superseb / k3s-etcd-commands.md
Last active June 5, 2024 20:52
k3s etcd commands

k3s etcd commands

etcd

Setup etcdctl using the instructions at https://github.com/etcd-io/etcd/releases/tag/v3.4.13 (changed path to /usr/local/bin):

Note: if you want to match th etcdctl binaries with the embedded k3s etcd version, please run the curl command for getting the version first and adjust ETCD_VER below accordingly:

curl -L --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/server-client.crt --key /var/lib/rancher/k3s/server/tls/etcd/server-client.key https://127.0.0.1:2379/version
@superseb
superseb / rke2-commands.md
Last active July 3, 2024 02:07
RKE2 commands

RKE2 commands

  • Updated on May 29 to accommodate etcd container not having /bin/sh available anymore.

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@stefancrain
stefancrain / setup.sh
Created March 18, 2020 14:52
Setup NVIDIA drivers and nvidia-container-runtime for docker on debian / ubuntu 18.04
#!/bin/bash
# https://github.com/NVIDIA/nvidia-docker#ubuntu-16041804-debian-jessiestretchbuster
curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \
sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo chmod 644 /etc/apt/sources.list.d/nvidia-container-runtime.list
@mattmattox
mattmattox / rke_recovery.sh
Last active May 28, 2024 22:09
Recovering cluster.yml and cluster.rkestate from kubeconfig
#!/bin/bash
echo "Building cluster_recovery.yml..."
echo "Working on Nodes..."
echo 'nodes:' > cluster_recovery.yml
kubectl --kubeconfig kube_config_cluster.yml -n kube-system get configmap full-cluster-state -o json | jq -r .data.\"full-cluster-state\" | jq -r .desiredState.rkeConfig.nodes | yq r - | sed 's/^/ /' | \
sed -e 's/internalAddress/internal_address/g' | \
sed -e 's/hostnameOverride/hostname_override/g' | \
sed -e 's/sshKeyPath/ssh_key_path/g' >> cluster_recovery.yml
echo "" >> cluster_recovery.yml
@giovtorres
giovtorres / virt-install-centos
Last active March 15, 2023 09:57
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
@sheffler
sheffler / ex1.py
Created September 22, 2011 19:53
Twisted11 Basic Auth using Password Dictionary
#!/usr/bin/env python
from zope.interface import implements
from twisted.cred import portal, checkers, credentials, error as credError
from twisted.internet import defer, reactor
from twisted.web import static, resource
from twisted.web.resource import IResource
from twisted.web.http import HTTPChannel
from twisted.web import server
from twisted.web.guard import HTTPAuthSessionWrapper