Skip to content

Instantly share code, notes, and snippets.

View konstruktoid's full-sized avatar
🤖

Thomas Sjögren konstruktoid

🤖
  • Sweden
  • 02:24 (UTC +01:00)
  • LinkedIn in/thosjo
View GitHub Profile
@konstruktoid
konstruktoid / Vagrantfile
Created November 30, 2025 00:58
Vagrantfile for testing CyberArk Conjur - https://www.conjur.org/
$prep = <<SCRIPT
set -e -o pipefail
apt-get update
apt-get install --assume-yes --no-install-recommends curl git jq
curl -fsSL get.docker.com | sh
apt-get update
apt-get install --assume-yes --no-install-recommends docker-compose-plugin
@konstruktoid
konstruktoid / installation_log.md
Last active September 15, 2025 11:25
installdependencies.sh refactor

bash -x src/Misc/layoutbin/installdependencies.sh &>> install.log

+ set -e -o pipefail
++ id -u
+ '[' 0 -ne 0 ']'
+ '[' -e /etc/os-release ']'
+ echo '--------OS Information--------'
--------OS Information--------
+ cat /etc/os-release
@konstruktoid
konstruktoid / argspec_gen.py
Last active June 4, 2025 10:42
Skeleton Ansible argument spec generator
#!/usr/bin/env python3
# ruff: noqa: T201
"""Print a skeleton Ansible argument_specs.yml file."""
import os
from pathlib import Path
import yaml
def find_yaml_files(directory: str) -> list[str]:
@konstruktoid
konstruktoid / download_artifact.py
Created November 28, 2024 21:36
Download GitHub artifact
#!/usr/bin/env python3
# ruff: noqa: E501,PERF401
#
"""Download the latest artifact from a GitHub repository."""
import zipfile
from pathlib import Path
import requests
OWNER = "konstruktoid"
@konstruktoid
konstruktoid / coreos_vagrant.sh
Last active October 9, 2024 15:04
Building an Fedora CoreOS Vagrant box
#!/bin/bash
set -eu -o pipefail
if ! command -v VBoxManage &> /dev/null; then
echo "[ERROR] VirtualBox is not installed"
exit 1
fi
if ! command -v vagrant &> /dev/null; then
@konstruktoid
konstruktoid / verabrute.sh
Created May 25, 2022 10:45
Brute force a VeraCrypt container when algorithms aren't known
#!/bin/bash
# So sorry it had to come to this, this is slow.
# Note that pim and keyfiles etc is static and needs to be modified if used.
# veracrypt --text --dismount --slot 1
set -eu -o pipefail
CONTAINER=""
MOUNTDIR=""
WORDLIST=""
@konstruktoid
konstruktoid / VBox_clean.sh
Last active April 19, 2024 10:25
Clean VirtualBox VMs, Vagrant boxes and Containers
#!/bin/bash
set -uo pipefail
CONTAINER_RUNTIME="unset"
if command -v docker >/dev/null 2>&1; then
CONTAINER_RUNTIME=docker
else
CONTAINER_RUNTIME=podman
fi
@konstruktoid
konstruktoid / ansible_forks.sh
Last active April 26, 2022 11:52
Script to calculate Ansible forks based on the number of CPUs.
#!/bin/bash -eux
if nproc &>/dev/null; then
CPUS=$(nproc)
elif grep -qc processor /proc/cpuinfo; then
CPUS=$(grep -c processor /proc/cpuinfo)
elif sysctl -n hw.ncpu &>/dev/null; then
CPUS=$(sysctl -n hw.ncpu)
else
CPUS=1
@konstruktoid
konstruktoid / genHostfile.sh
Created October 26, 2020 08:59
Generate a Ansible hosts file from running Vagrant VMs
#!/bin/bash
{
for VM in $(vagrant status | grep -iE 'running.*virtualbox' | grep "$1" | awk '{print $1}'); do
mapfile -t VAGRANT_SSH < <(vagrant ssh-config "$VM" | awk '{print $NF}')
echo "[${VAGRANT_SSH[0]}]"
echo "${VAGRANT_SSH[1]} ansible_connection=ssh ansible_port=${VAGRANT_SSH[3]} ansible_user=${VAGRANT_SSH[2]} ansible_ssh_private_key_file=${VAGRANT_SSH[7]}"
done
} > "hosts"
@konstruktoid
konstruktoid / mac_developer_certs.md
Last active March 3, 2022 00:25
Installing Developer ID certificates on Mac OS X

Installing Developer ID certificates on Mac OS X

Short guide showing how to install Developer ID certificates, when the Allow button doesn't show up under System Preferences > Security & Privacy > General or you're seeing (libkern/kext) system policy prevents loading; check the system/kernel logs for errors or try kextutil(8). in the installation logs (CMD + L).

System information

macOS Catalina
ProductName:    Mac OS X
ProductVersion: 10.15.4