Skip to content

Instantly share code, notes, and snippets.

@bitsandbooks
bitsandbooks / README.md
Last active September 6, 2025 13:29
Ansible-ready Debian VMs with Terraform, Proxmox, and Cloud-init

The Goal

To create a Debian VM that is ready for Ansible using Terraform/OpenTofu, Proxmox VE, and Cloud-init.

Requirements

You will need to:

  • have a running Proxmox server whose console you can reach, via either web GUI or SSH
  • have Snippets enabled on at least one storage location with your customized ci-user.yml and ci-net.yml file in it
@bitsandbooks
bitsandbooks / vdev_id.conf
Last active January 18, 2025 16:07
Creating a ZFS pool
# General Settings
# My pool lives behind an IBM M1015 host bus adapter, which comes with
# two SAS ports, each of which supports four SAS or SATA disks. These
# settings apply to it.
multipath no
topology sas_direct
phys_per_port 4
slot phy
# Aliases
# NOTE: **NEVER** use sda, sdb, sdc; these can change between boots.
@bitsandbooks
bitsandbooks / flashbook.py
Last active October 24, 2023 16:23
Flash Book Generator
#!/usr/bin/env python3
# This script generates a simple PDF "flash book" (such as one through which
# you might browse at a tattoo parlor) from a folder of SVG files. Each item is
# on a separate page, with its file name written beneath. This makes it easy to
# re-create the flash book whenever SVGs are added, deleted, or renamed.
#
# NOTES AND RECOMMENDATIONS:
#
# - `flashbook.py` must be executable. If it is not, you may need to use
@bitsandbooks
bitsandbooks / docker-compose.yml
Last active June 22, 2023 22:20
Docker Compose for services
---
version: "3.8"
secrets:
OPENVPN_LOCATION:
file: "/path/to/secrets/openvpn-location.txt"
OPENVPN_USER:
file: "/path/to/secrets/openvpn-user.txt"
OPENVPN_PASSWORD:
file: "/path/to/secrets/openvpn-password.txt"
@bitsandbooks
bitsandbooks / README.md
Last active March 21, 2025 05:57
Kickstart Files

Kickstart Files

These files are here to install a minimal environment (i.e., no desktop) for Fedora Linux 38 and Rocky Linux 9. They're designed to partition a single disk device, creating a UEFI partition, a /boot partition, and logical volumes for an 8 GB swap partition, and the majority of the space for a single / volume.

Usage

The files are designed so you need only change a few minor things to make it work for you:

  • Set a hostname in the network options
  • Specify the storage device for the ignoredisk and bootloader options (usually something like sda, vda, or nvme0n1)
@bitsandbooks
bitsandbooks / code.py
Last active September 17, 2022 20:06
CircuitPython with the CPX
#!/usr/bin/python
# CPX Light Effects program. Copyright (c) 2022 by Elk Grove Village Public Library.
# Licensed under the [GNU General Public License, version 3](https://www.gnu.org/licenses/gpl-3.0.en.html).
from adafruit_circuitplayground.express import cpx
import time
wait_time = 0.05
pixel_count = 10
{
"version":"2",
"templates":[
{
"type":1,
"title":"Nginx",
"description":"High performance web server",
"categories":[
"webserver"
],
@bitsandbooks
bitsandbooks / README.md
Last active June 10, 2023 10:16
Mksha - generate $6$ shadow password hashes on macOS

Mksha

Mksha is a tiny Python 3 script to generate SHA-512 ($6$) password shadows on macOS, which truncates them by default.

Instructions

  1. Make sure mksha.py is executable: chmod u+x /path/to/mksha.py
  2. Symlink mksha.py as mksha in a folder on your $PATH: ln -s /path/to/mksha.py /usr/local/bin/mksha

You can now use the mksha command in your Terminal.

@bitsandbooks
bitsandbooks / names.txt
Last active August 30, 2025 09:33
Names from "Toast of London" and "Toast of Tinseltown"
Iqbal Achieve
Nina Armenian
Forrest Ash
Martin Aynuss
Kikini Bamalam
Dominic Bambercrunch
Whack Barnet
Danny Bear
Weech Beacon
Derek Bildings
@bitsandbooks
bitsandbooks / ubuntu-focal-autoinstall-virtualbox.md
Last active August 27, 2022 17:46
Ubuntu 20.04 with Autoinstall using VirtualBox [DRAFT]

Ubuntu 20.04 + Autoinstall + VirtualBox

Intro

This guide will explain how to set up a [VirtualBox][] VM running [Ubuntu 20.04][] and, using the new [autoinstall][] tool and cloud-init, install OpenSSH server, add a group and a user, who can then connect to the machine via SSH. This was done on a 2016 MacBook Pro running macOS 10.15 "Catalina" and VirtualBox 6.1.6 (with the VirtualBox Guest Additions installed).

You will also need a group name, a username, a password hash and an SSH key pair.

How Autoinstall Works