Skip to content

Instantly share code, notes, and snippets.

View prydin's full-sized avatar

Pontus Rydin prydin

View GitHub Profile
@prydin
prydin / ptr.ps1
Created September 28, 2026 20:45
Great PTR records
<#
.SYNOPSIS
Creates PTR records in reverse lookup zones for every A record in a forward zone.
.DESCRIPTION
Reads all A records from the forward zone (default: vcf.lab), finds the most
specific matching reverse lookup zone for each IP address, and adds a PTR record
pointing back to the host's FQDN.
- Existing PTR records that already point to the correct host are skipped.
@prydin
prydin / vcfa-api-example.py
Created September 23, 2026 18:14
Simple VFCA Interaction
"""
Simple example: authenticate to VCFA (VMware Cloud Foundation Automation) 9.1
and list the VM App blueprints in a project.
Fill in the constants below and run: python list_blueprints.py
"""
import requests
# --- Configuration ---
@prydin
prydin / r2r.v
Created June 30, 2026 12:20
R2R simulation
`timescale 1ns / 1ps
module sig_mag_cell(
input [3:0] in,
output [3:0] out,
input sign,
input cin,
output cout
);
@prydin
prydin / cp_registry.md
Created April 21, 2026 19:34
Run a Docker registry on a VCF Operations Collector node

Configure a Private Registry on a VCF Operations Collector/Cloud Proxy for the vCommunity Management Pack for Disconnected Sites

Adapted from an original by Sean Cummins

The VCF Operations Coommunuty Management pack adds lots of useful new metrics to VCF Operations. This Management Pack was created using the VCF Operations SDK, which relies on Docker. Typically, the Collectors would contact a public registry to pull the images, but this doesn't work in air-gapped high-security sites. This document discusses a workaround.

Preparing the images

@prydin
prydin / dac-sim.py
Created April 3, 2026 17:34
Simple sigma-delta DAC simulation
import numpy as np
import scipy.signal as signal
from matplotlib import pyplot as plt
def gen_sine(fs, f, periods):
n = int(fs*(periods/f))
t = np.linspace(start=0, stop=periods/f, num=n)
return t, np.sin(t*f*2*np.pi)
def upsample(t, x, ratio):
@prydin
prydin / mirror_mania.asc
Last active April 30, 2025 14:45
Mirror Mania
Version 4
SHEET 1 1992 864
WIRE -1936 -1360 -2064 -1360
WIRE -1520 -1360 -1936 -1360
WIRE -1200 -1360 -1520 -1360
WIRE -976 -1360 -1200 -1360
WIRE -480 -1360 -976 -1360
WIRE -400 -1360 -480 -1360
WIRE 64 -1360 -400 -1360
WIRE 432 -1360 64 -1360
@prydin
prydin / noise.py
Created January 9, 2025 15:19
Low noise preamp simulation
import numpy as np
noise_db = -80 # Noise added by each amplifier
gain_db = 60 # Closed loop gain
cycles = 2
resolution = 1000
length = np.pi * 2 * cycles
signal = np.sin(np.arange(0, length, length / resolution))
raw_noise = 10**(noise_db / 20)
@prydin
prydin / part0.v
Last active December 20, 2024 00:16
ESC Part 0
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 12/17/2024 08:29:18 AM
// Design Name:
// Module Name: main
// Project Name:
// Target Devices:
Version 4
SHEET 1 5264 1236
WIRE 272 -80 272 -112
WIRE 1600 -80 1600 -112
WIRE -496 -64 -496 -144
WIRE 208 -32 128 -32
WIRE 1536 -32 1456 -32
WIRE 128 16 128 -32
WIRE 272 32 272 16
WIRE 1600 32 1600 16
@prydin
prydin / thermo_amp.asc
Created October 14, 2024 13:30
Thermocouple amplifier
Version 4
SHEET 1 880 680
WIRE -448 -80 -560 -80
WIRE -416 -80 -448 -80
WIRE -320 -80 -336 -80
WIRE 96 -80 -320 -80
WIRE -560 -48 -560 -80
WIRE -320 -32 -320 -80
WIRE -576 48 -576 32
WIRE -560 80 -560 32