Skip to content

Instantly share code, notes, and snippets.

View badowhp's full-sized avatar
🏠
Working from home

Hipolit Badowski badowhp

🏠
Working from home
View GitHub Profile
@badowhp
badowhp / SimpleHTTPServerWithUpload.py
Last active May 4, 2024 01:13 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@badowhp
badowhp / prefix.sh
Created March 4, 2024 14:59
prefix ci cd output, exectue your command with | prefix.sh
#!/bin/sh
# Set the environment prefix
ENV_PREFIX="[test]"
# Process each line of input, prefixing with the environment name
while IFS= read -r line; do
echo "${ENV_PREFIX} ${line}"
done

Template from: Michael Kehoe

Postmortem Template

Summary

Incident Summary
Incident Number Incident Severity
Postmortem Date War-room Required
SRE Lead Developer Lead
@badowhp
badowhp / python.yml
Created April 3, 2023 23:49
Example of a GitHub Actions pipeline using a matrix in the jobs section of the workflow
name: build and test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
Hierarchy in tmux: session > window > pane.
Prefix for commands and help:
Ctrl-b and sth: issue a command to tmux, inside tmux.
Ctrl-b and ?: see all commands.
Session commands:
tmux: creates a new session and enters it.
tmux new -s sessionname: creates a session with the specified name.
tmux ls: lists all sessions.
@badowhp
badowhp / rancher-keycloak-idp-configuration.md
Created January 19, 2023 12:42 — forked from PhilipSchmid/rancher-keycloak-idp-configuration.md
Rancher v2.X KeyCloak Authentication Backend Configuration

Rancher v2.X KeyCloak Authentication Backend Configuration

Ranchers official documentation about how to configure the Rancher <> KeyCloak setup is fine but definitely not sufficient to successfully configure it (https://rancher.com/docs/rancher/v2.x/en/admin-settings/authentication/keycloak/). That's the reason why here every single required step is documented down here.

KeyCloak Configuration

I simply use the default master realm for the Rancher client. Nevertheless, it would sometimes absolutely make sense to use a custom KeyCloak realm.

  1. Login as admin on https://keycloak.example.com/. Important: It's crucial that in KeyCloak the same username exists as you use as admin user on Rancher. Since I just use the admin account in this guide, this prerequisite is already achieved.
  2. Create a new client under https://keycloak.example.com/auth/admin/master/console/#/realms/master/clients
    • Client ID: https://rancher.example.com/v1-saml/keycloak/saml/metadata
@badowhp
badowhp / remove_bloat.ps1
Created November 30, 2022 21:04
pswh script to remove unnecessary Windows 10 Bloatware
Get-AppxPackage *Microsoft.3dbuilder* | Remove-AppxPackage
Get-AppxPackage *AdobeSystemsIncorporated.AdobePhotoshopExpress* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsAlarms* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Asphalt8Airborne* | Remove-AppxPackage
Get-AppxPackage *microsoft.windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsCamera* | Remove-AppxPackage
Get-AppxPackage *king.com.CandyCrushSodaSaga* | Remove-AppxPackage
Get-AppxPackage *Microsoft.DrawboardPDF* | Remove-AppxPackage
Get-AppxPackage *Facebook* | Remove-AppxPackage
Get-AppxPackage *BethesdaSoftworks.FalloutShelter* | Remove-AppxPackage