Skip to content

Instantly share code, notes, and snippets.

@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 26, 2024 06:29
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 April 1, 2024 13:02
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

@bitsandbooks
bitsandbooks / code.py
Last active February 16, 2020 20:23
Simple Game Show Buzzer in CircuitPython for Circuit Playground Express
#!/usr/bin/env python
"""
Simple Game Show Buzzer in CircuitPython for Circuit Playground Express
Author: Rob Dumas
License: MIT
Copyright 2020 Elk Grove Village Public Library.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@bitsandbooks
bitsandbooks / el-user.yml
Last active June 17, 2021 19:40
Elk Lab Ansible
---
- hosts: 127.0.0.1
connection: local
tasks:
- name: ensure personalized dconf settings
dconf:
key: "{{ item.key }}"
value: "{{ item.value }}"
state: present