Skip to content

Instantly share code, notes, and snippets.

View prydin's full-sized avatar

Pontus Rydin prydin

View GitHub Profile
@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
@prydin
prydin / thd_mat.py
Created October 6, 2024 01:46
THD calculation
import math
import numpy as np
import scipy as sci
from numpy.linalg.linalg import solve
from scipy.signal import correlate, fftconvolve
import matplotlib.pyplot as plt
import cmath
def parabolic(f, x):
@prydin
prydin / dac.v
Created April 15, 2024 00:57
Delta/sigma-DAC
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 03/09/2024 02:08:14 PM
// Design Name:
// Module Name: dac
// Project Name:
// Target Devices:
@prydin
prydin / am.m
Created April 1, 2024 23:46
AM Detection example
# Generate test signal
t = linspace(0,120*pi, 1000)
baseband = cos(t/40)
carrier = cos(t)
modulated = carrier .* baseband
# Downshift and split into I and Q
fq_offset = 1.05 # Carrier and LO are off by 5%
i = cos(t*fq_offset) .* modulated
q = sin(t*fq_offset) .* modulated