Skip to content

Instantly share code, notes, and snippets.

View diskerror's full-sized avatar

Reid Woodbury Jr. diskerror

View GitHub Profile
@diskerror
diskerror / Self-Signed Cert.md
Last active February 15, 2025 23:54
Debian 12, NGINX Self-Signed Certificate

This is not an expert setup. Instructions were gathered from many other sources. These worked for me.

Generate Keys

This will need to be run for each domain on this server. The exact names or suffixes don't matter but you must use the correct file name in the correct places. They can all be the same. Run:

sudo openssl req -x509 -newkey rsa:4096 -sha512 -days 3650 -nodes -out /etc/ssl/localcerts/NAME1.pem -keyout /etc/ssl/private/NAME2.key

and fill in prompts. The domain name must be exact.

Generate DH Parameters

@diskerror
diskerror / serialization_test.php
Last active July 30, 2025 18:36 — forked from pandeyanshuman/php_serialization_perf_test.php
PHP Serialization Performance Testing - Native, JSON, BSON, igbinary, MsgPack, and Swoole
#!/usr/bin/env php
<?php
/**
* Performance Testing of various serialization formats.
*
* References:
* - https://gist.github.com/Rican7/6457237
* - http://spage.fi/php_serialization_performance
*
* @copyright 2016 Pandey Anshuman Kishore
@diskerror
diskerror / set_hostname.sh
Created September 27, 2024 07:24
Script to change hostname on Debian and generating new ssh keys. Created for configuring cloned virtual machines.
#!/bin/bash
# Script to change hostname on Debian and generating new ssh keys.
# Created for configuring cloned virtual machines.
if [[ "root" != $(whoami) ]]
then
echo "must be root"
exit
fi
@diskerror
diskerror / hash_test.php
Last active July 4, 2025 22:04
PHP hash function test expanded from comment on PHP online manual.
#!/usr/bin/env php
<?php
// Tested with PHP versions 8.1, 8.2, 8.3, and 8.4-dev.
define('ITERATIONS', 1000);
define('RANDOM_BYTES', random_bytes(4096));
define('PROGRESS_FMT', "\r%-64s");
$results = [];

As of today, February 1, 2025, the ISO provided by Proxmox is the release version (my wording) and not the "no subscription" version. This version is very tightly locked down, understandably. I have an older "no subscription" instance (development?) and have been able to install a few extra utilities like aptitude, vim-nox, htop, and screen.

I am setting up a new machine, new instance, to replace hardware that is 10–15 years old. To make the new instance is just like the old I disabled the repository source in /etc/apt/sources.list.d/ceph.list and /etc/apt/sources.list.d/pve-enterprise.list. Then added the file /etc/apt/sources.list.d/pve-install-repo.list with one line:

deb [ arch=amd64 ] http://download.proxmox.com/debian/pve bookworm pve-no-subscription

and ran the commands apt-get update and apt-get upgrade --reinstall. The token "arch=amd64" works here because one system has two Intel X5690s and the new system has an Intel i7-10700K.

@diskerror
diskerror / backup.sh
Last active June 24, 2025 01:01
Backup MacOS X 10.6 to ZFS dataset on Debian 12.7 (Proxmox VE 8.4).
#!/bin/bash
# The backup machine is called 'msi'
# and there's an entry in .ssh/config (/opt/local/etc/ssh/ssh_config)
# that points to its IP address.
# The zpool is mounted at '/mnt/main'.
# The target dataset is 'main/macbook_backup'.
# This script is run as root with cron.
# Both the local and remote user is 'reid'.
# See below for contents of '/backup_exclude' (from default TimeMachine excludes).