Skip to content

Instantly share code, notes, and snippets.

@lsjostro
lsjostro / talos-geniso-nocloud.sh
Last active May 6, 2023 17:22
talos iso convert to nocloud platform
docker run --rm -i -w /work -v "$PWD":/work --entrypoint sh ghcr.io/siderolabs/imager:v1.4.0 -c '
installer iso --arch amd64 --output . &&
xorriso -osirrox on -indev ./talos-amd64.iso -extract / /tmp &&
rm -f ./talos-amd64.iso &&
sed -i 's/talos.platform=metal/talos.platform=nocloud/g' /tmp/boot/grub/grub.cfg &&
grub-mkrescue --compress=xz --output=./talos-amd64-nocloud.iso /tmp'
@dubpirate
dubpirate / pascal_to_snake.py
Last active July 11, 2024 14:41
Convert Pascal Case to Snake Case with Python and Regex.
import re
def to_snake(pascal:str) -> str:
"""Converts a Pascal case string to snake case.
"""
magic = re.findall('[A-Z]+[a-z]*', pascal)
snake = '_'.join(magic)
snake = snake.lower()
return snake
variable "proxmox_host_node" {
type = string
}
variable "proxmox_password" {
type = string
sensitive = true
}
@AAkindele
AAkindele / aks-agw-ingress-tls-notes.md
Created August 26, 2021 17:58
AKS, App Gateway Ingress, and Key Vault TLS secrets

Rough notes for AKS App Gateway ingress tls

Rough notes on setting up Application Gateway Ingress Controller for AKS. This also takes advantage of key vault and Azure Key Vault Provider for Secrets Store CSI Driver. The Ingress resource will be configured to use a tls Kubernetes secret that is create via the csi driver. In this setup, TLS is terminated at the App Gateway. App Gateway does support end-to-end TLS if that is required.

Setup preview extensions

# add az cli preview extensions
az extension add --name aks-preview
@mdrakiburrahman
mdrakiburrahman / list_synapse_files_recursively.py
Created December 24, 2020 21:16
Recursively listing Data Lake files with `display` implemented
def deep_ls(path: str, max_depth=1):
"""
List all files and folders in specified path and
subfolders within maximum recursion depth.
"""
# List all files in path and apply sorting rules
li = mssparkutils.fs.ls(path)
# Return all files
@sergey-dryabzhinsky
sergey-dryabzhinsky / sysctl-proxmox-tune.conf
Last active July 9, 2024 19:57
Most popular speedup sysctl options for Proxmox. Put in /etc/sysctl.d/
###
# Proxmox or other server kernel params cheap tune and secure.
# Try it if you have heavy load on server - network or memory / disk.
# No harm assumed but keep your eyes open.
#
# @updated: 2020-02-06 - more params used, adjust some params values, more comments on params
#
### NETWORK ###
@devisnotnull
devisnotnull / installing_kubernetes_on_proxox.md
Last active January 1, 2024 12:33
Installing Kubernetes on Proxox, Herzner

Installing Kubernetes on Proxox

For this example i shall be using a dedicated server from Hertzner.https://www.hetzner.de/en/. A shout out to hetzner if your looking for cheap and beefy dedicated hosting then these guys are your best bet.

Setting up the Hertzer server

This guide assumes your server has Debian 8 (Jessie installed)

Config when tested

@alces
alces / ansible_local_playbooks.md
Last active July 6, 2024 09:49
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@hvanderlaan
hvanderlaan / deploy-lxc-alpine.sh
Last active January 12, 2021 12:50
lxc deploy alpine linux ansible ready
#!/bin/bash
# file : deploy-lxc-alpine.sh
# purpose: deploy a new alpine container that is ready for ansible management
#
# author : harald van der laan
# date : 2016/04/19
# version: v1.0
lxcName=${1}
@jumanjiman
jumanjiman / harden.sh
Last active July 4, 2024 20:41
hardening script for an alpine docker container
#!/bin/sh
# Copyright 2020 Paul Morgan
# License: GPLv2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
set -x
set -e
#
# Docker build calls this script to harden the image during build.
#
# NOTE: To build on CircleCI, you must take care to keep the `find`
# command out of the /proc filesystem to avoid errors like: