Skip to content

Instantly share code, notes, and snippets.

View Realiserad's full-sized avatar

Bastian Fredriksson Realiserad

View GitHub Profile
@Realiserad
Realiserad / istio_demo.md
Last active March 29, 2025 09:27
Set up Istio in MicroK8s

Deploy Istio

VM setup

Start from a minimal installation of Ubuntu Server 22.04.

In this case, I've set up a VM with two network interfaces, one NAT for connection to the internet, and one bridged network interface to connect from the host to the guest VM.

@Realiserad
Realiserad / ssemse.py
Created February 17, 2023 13:15
Bli notifierad när en bandag med Sydskånes Emse blir ledig!
#!/usr/bin/python3
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.by import By
import json
import notify2
import requests
# The message template used for notifications.
@Realiserad
Realiserad / customer-urlblacklist.conf
Created January 27, 2023 21:15
URL rewriting and whitelisting for the PrimeKey PKI Appliance
## Example of URL rewriting and whitelisting for the PrimeKey PKI Appliance.
## Installation instructions:
##
## 1. Enable SSH in WebConf.
## 2. Log in over SSH and edit /etc/httpd/extra-available/customer-urlblacklist.conf using vi.
## 3. Restart Apache for the changes to take effect
##
## systemctl restart httpd
##
## Changes to customer-urlblacklist.conf persists across reboots and upgrades but do not survive
@Realiserad
Realiserad / Create-AutoenrollmentConfiguration.ps1
Last active December 2, 2022 19:50
Cmdlet for creating a keytab and krb5.conf for EJBCA Enterprise autoenrollment
param(
[Parameter(Mandatory)]
[string]$AccountName,
[Parameter(Mandatory)]
[string]$PkiDnsName,
[switch]$GeneratePassword,
[switch]$Force
@Realiserad
Realiserad / provtider.py
Last active November 8, 2022 18:59
Scrape time slots for available driving tests from the Swedish Transport Agency's public API
# -*- coding: utf-8 -*-
# Note: The intended way of searching for available time slots is to go to https://fp.trafikverket.se/boka.
# I'm only posting this because there are some third-party profiteers out there providing this sort of service.
# Even though the API is publicly available, you may not be allowed to use it, but I'm not a lawyer. I do not
# take responsibility for how you use this script, or the legal consequences of doing so.
from subprocess import check_output
from urllib.request import urlopen
from urllib.parse import quote
@Realiserad
Realiserad / mvn-resolve.fish
Last active November 1, 2022 19:29
Resolve dependencies from a Project Object Model (POM) using Maven
function mvn-resolve --description 'Resolve Maven dependencies from a POM'
for dependency in (cat pom.xml | xq -c .project.dependencies.dependency[])
set groupId (echo $dependency | jq -r .groupId)
set artifactId (echo $dependency | jq -r .artifactId)
set artifactVersion (echo $dependency | jq -r .version)
mvn dependency:get -Ddest=./ -Dartifact=$groupId:$artifactId:$artifactVersion > /dev/null
end
end
@Realiserad
Realiserad / parse_certificate_template.py
Last active June 14, 2022 05:32
Parse a certificate template exported from AD as LDIF and convert into YAML
#
# Script for parsing certificate templates for Active Directory
# Certificate Services, exported from Active Directory as LDIF.
#
# On a Windows machine, you can perform the export using ldifde.
# For example, if you want to export a certificate template named
# "MyTemplate" residing in the "example.com" domain, you would run
# the following command:
#
# ldifde -m -v -d "CN=MyTemplate,CN=Certificate Templates,
@Realiserad
Realiserad / #secrets-monitor
Last active February 23, 2022 11:25
Monitors a directory for secrets and triggers callbacks implemented as shell scripts
The name of this gist.
@Realiserad
Realiserad / abk_login.py
Last active January 2, 2022 15:53
Förnya sparade ködagar hos AB Kristianstadsbyggen
# AB Kristianstadsbyggen kräver att man som bostadssökande loggar in
# minst en gång per år för att inte tappa sina ködagar.
#
# Följande program automatiserar inloggningen med hjälp av Selenium.
#
# Innan du kan starta programmet på din dator måste du köra följande
# kommandon (Ubuntu):
#
# pip3 install selenium
# sudo apt install firefox
@Realiserad
Realiserad / fish_greeting.fish
Last active March 21, 2023 07:32
My custom greeting for Fish
function fish_greeting -d "Greeting message on shell session start up"
echo ""
echo -en " ⏳ " (show_date_info) "\n"
echo -en " 📻 " (show_net_info) "\n"
echo -en " 💾 " (show_mem_info) "\n"
if teatime
echo -en " 🍵 Time to get a cup of tea!\n"
end
if insomnia
echo -en " 😴 Using the computer at night can cause insomnia!\n"