Skip to content

Instantly share code, notes, and snippets.

@zeqk
zeqk / apache_airflow_sso_howto.md
Created March 5, 2025 17:09 — forked from wallyhall/apache_airflow_sso_howto.md
Apache Airflow Azure AAD SSO howto

The following instructions for enabling Azure SSO for Apache Airflow nearly take you all the way - but fall short a couple of details around the configuration of airflow itself:

https://objectpartners.com/2021/12/24/enterprise-auth-for-airflow-azure-ad

All the "Azure" instructions there can be safely followed - the resulting webserver_config.py (which can be injected into a dockerised Airflow in /opt/airflow/webserver_config.py) can be built from the following:

from __future__ import annotations

import os
@zeqk
zeqk / excel formulas.md
Created December 31, 2024 13:48 — forked from f-steff/excel formulas.md
Excel formulas to calculate IP values such as Netmask, IP range start, IP range end, Broadcast IP, Number of hosts.

Excel formulas to calculate IP values - Works in Excel and Google Sheet.

Updated 2023-12-11: Hosts calculation updated to support CIDR or 31 and 32.

Prerequisites:

  • A1 contains an IP address, such as 10.0.0.2
  • B1 contains the number of bits in the netmask (CIDR) such as 24

The below formulas then go into C1, D1 etc. to perform the various calculations. Some calculations depends on other calculations.

@zeqk
zeqk / RedirectNewtonsoftJson.ps1
Created May 2, 2023 13:39 — forked from JamesRandall/RedirectNewtonsoftJson.ps1
Powershell binding redirection
# Load your target version of the assembly
$newtonsoft = [System.Reflection.Assembly]::LoadFrom("$PSScriptRoot\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll")
$onAssemblyResolveEventHandler = [System.ResolveEventHandler] {
param($sender, $e)
# You can make this condition more or less version specific as suits your requirements
if ($e.Name.StartsWith("Newtonsoft.Json")) {
return $newtonsoft
}
foreach($assembly in [System.AppDomain]::CurrentDomain.GetAssemblies()) {
if ($assembly.FullName -eq $e.Name) {
@zeqk
zeqk / psql-with-gzip-cheatsheet.sh
Created February 3, 2023 15:16 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@zeqk
zeqk / dockerized_argocd_cli.md
Created February 1, 2023 16:24 — forked from avillela/dockerized_argocd_cli.md
Dockerized ArgoCD CLI

How to Build & Run Dockerized ArogCD CLI

This quick guide shows you how to build a Dockerized argocd CLI. The advantage of this setup is that it's platform-independent. Also, I personally found the Linux installation annoying and buggy, and this proves to be a much more streamlined approach. Interestingly enough, the MacOS and the Windows installers were way less finnicky.

Dockerfile

Save the text below to Dockerfile.argocd in a folder called docker

FROM argoproj/argocd:v1.7.6 as builder
@zeqk
zeqk / kube_service_create.sh
Created November 4, 2022 14:34 — forked from ganesh-karthick/kube_service_create.sh
PgAdmin Kubernetes service depoyment example
#!/usr/bin/env bash
kubectl create -f pgadmin.yaml
sleep 15s
kubectl logs pgadmin-76gjgvvjh-yghg
## Access pgAdmin
## https://<IP>:31560
## username/password: [email protected] / password
@zeqk
zeqk / docker-compose.yml
Created September 17, 2021 19:00 — forked from devzer01/docker-compose.yml
docker-compose mongodb
version: '3'
services:
database:
image: 'mongo'
container_name: 'my-mongo-container' # give your contatner a name
environment:
- MONGO_INITDB_DATABASE=your-database-name # database name you want to make
- MONGO_INITDB_ROOT_USERNAME=my-container-root-username # set your container root username
- MONGO_INITDB_ROOT_PASSWORD=secret # set your contatner root password
volumes:
@zeqk
zeqk / docker-compose-node-mongo.yml
Created September 17, 2021 19:00 — forked from wesleybliss/docker-compose-node-mongo.yml
Docker Compose with example App & Mongo
version: '2'
services:
myapp:
build: .
container_name: "myapp"
image: debian/latest
environment:
- NODE_ENV=development
- FOO=bar
volumes:
@zeqk
zeqk / README.md
Created June 10, 2021 20:02 — forked from thomaslarsen/README.md
Convert PEM certificate to JSON format
@zeqk
zeqk / remove_gitlab_artifacts.sh
Created March 6, 2021 03:38 — forked from carceneaux/remove_gitlab_artifacts.sh
Script for removing GitLab Job Artifacts.
#!/bin/bash
#
# Written by Chris Arceneaux
# GitHub: https://github.com/carceneaux
# Email: [email protected]
# Website: http://arsano.ninja
#
# Note: This code is a stop-gap to erase Job Artifacts for a project. I HIGHLY recommend you leverage
# "artifacts:expire_in" in your .gitlab-ci.yml
#