Skip to content

Instantly share code, notes, and snippets.

View dark-vex's full-sized avatar

Daniele De Lorenzi dark-vex

  • Milan
  • 08:18 (UTC +01:00)
View GitHub Profile
@alfredopalhares
alfredopalhares / README.md
Last active November 14, 2024 10:43
Script to diff un-updatebale Statefulsets fiesl

List un-updatabale file Kubernetes Statefulset

https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets

There are some cases that you might be trying to update a statefulset and you get this error:

Error: cannot patch "my-statefulset" with kind StatefulSet: StatefulSet.apps "my-statefulset" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden && cannot patch "my-statefulset-tracking" with kind StatefulSet: StatefulSet.apps "my-statefulset-tracking" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

And while you can diff a file manually beteween you update and the yaml that you can fecth: kubectl -n my-ns get sts my-statefulset -o yaml

@dark-vex
dark-vex / PVE-HP-ssacli-smart-storage-admin.md
Created May 28, 2024 10:33 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@toddysm
toddysm / manual-authentication-with-acr.txt
Last active December 10, 2025 16:26
Authenticating with Azure Container Registry (ACR)
# As per the instructions at https://github.com/Azure/acr/blob/main/docs/AAD-OAuth.md
# Prep: Set env variables
registry="<USE_YOUR_REGISTRY_HERE>"
tenant="<USE_YOUR_TENANT_HERE>"
subscription="<USE_YOUR_SUBSCRIPTION_HERE>"
scope="registry:catalog:*"
# Step 1: Get AAD access token
aad_access_token=`az account get-access-token --subscription $subscription --query "accessToken" --output tsv`
echo $aad_access_token
# Step 2: Get a refresh token for ACR
@fideloper
fideloper / certbot.sh
Last active November 2, 2025 09:08
Certbot on Ubuntu, wildcard subdomains via CloudFlare DNS challenge
# Used on Ubuntu 18.04 and 20.04
# Find instructions for other OSes here: https://certbot.eff.org/instructions
# Install Certbot via Snaps
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
# Install DNS CloudFlare plugin
sudo snap set certbot trust-plugin-with-root=ok
@a1994sc
a1994sc / cloudflared.yaml
Created November 9, 2021 03:13
cloudflared - k3s
---
apiVersion: apps/v1
#kind: Deployment
kind: DaemonSet
metadata:
name: cloudflared
namespace: ingress
labels:
group: cloudflare
spec:
INGRESS:
HELM v3: https://kubernetes.github.io/ingress-nginx
Values.yaml:
---
controller:
config:
http-snippet: |-
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
@lg
lg / adding-tailscale-to-edgerouter.md
Last active October 26, 2025 05:37
Add tailscale to an EdgeRouter and surviving system upgrade

Adding tailscale to an EdgeRouter (and surviving system upgrades)

I suggest you run sudo bash on all of these so you're the root user.

Installing

  1. Download tailscale and put the files in /config/. Find the latest stable or unstable version for your EdgeRouter's processor (ex. ER4 is mips and ERX is mipself)
sudo bash    # if you havent already
@superseb
superseb / k3s-etcd-commands.md
Last active November 3, 2025 12:55
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

This the procedure for generating ignition configs for govcloud using th 4.3 installer (which actively thwarts attempts to do this)

Create install-config.yaml

apiVersion: v1
baseDomain: sjennings.me
# disconnected install requires local mirror
# oc adm release mirror
imageContentSources:
- mirrors:
@mrpeardotnet
mrpeardotnet / PVE-HP-ssacli-smart-storage-admin.md
Last active December 12, 2025 15:43
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation