Skip to content

Instantly share code, notes, and snippets.

turingbirds / ltspice_high_precision.rst
Last active December 4, 2023 19:46
ltspice options for high precision simulation/data export
View ltspice_high_precision.rst

ltspice options for high precision simulation/data export

Uses backward Euler integration (maxord=1 option), which can be very slow.

Set maximum iteration counts: DC iteration count limit (itl1, default: 100), DC transfer curve iteration count limit (itl2, default: 50), and transient analysis time point iteration count limit (itl4, default: 10) [ltwiki]_.

.OPTIONS maxord=1
turingbirds /
Created June 16, 2023 14:46
Extract blocks from block diagonal matrix
import numpy as np
def extract_block_diagonal_blocks(A):
assert A.shape[0] == A.shape[1], "matrix A should be square"
N = A.shape[0]
A_mirrored = A + A.T # make the matrix symmetric so we only have to check one triangle
blocks = []
View Bessel filter design.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Linux installation

Linux installation notes

A giant ball of yarn containing notes on how to set up Debian/KDE Linux, with tips on useful software and commands.

Increase console font size

setfont /usr/share/consolefonts/Lat7-Terminus28x14.psf
turingbirds / Git cheatsheet.markdown
Last active January 10, 2023 22:10
Git cheatsheet
View Git cheatsheet.markdown

Git cheatsheet

Set up Git

git config --global ""
git config --global "John Doe"
turingbirds / GNUPG
Last active September 20, 2022 10:15
GPG (GNUPG) Cheatsheet


Setting up: key generation

This generates a public/private keypair.

$ gpg --gen-key

$ gpg --list-secret-keys

turingbirds / bwedge.scad
Last active March 15, 2022 13:24
Beveled wedge shape for OpenSCAD
View bwedge.scad
// Beveled wedge shape for OpenSCAD
// Written by C.A.P. Linssen <>, Sept 2018
// This software is distributed under the "CC0 1.0 Universal (CC0 1.0)" license.
// You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <>.
// module bwedge
turingbirds / Agilent 82357B GPIB interface programming on Ubuntu Linux.rst
Last active March 11, 2022 11:43
Agilent 82357B GPIB interface programming on Ubuntu Linux
View Agilent 82357B GPIB interface programming on Ubuntu Linux.rst

GPIB interfacing using Agilent 82357B on Ubuntu Linux

I initially had some problems installing on my laptop, so decided to boot Ubuntu 12.04.5 LTS, 3.13.0-32-generic from USB and work from there.

For an automated installation script, see (and gpib.conf) below. The rest of this document describes the actions of the installation script step-by-step.

First, get the packages that are necessary to support Python bindings:

turingbirds / moore_penrose_pseudoinverse.c
Last active February 16, 2022 10:21
Compute the (Moore-Penrose) pseudo-inverse of a libgsl matrix in plain C.
View moore_penrose_pseudoinverse.c
* Compute the (Moore-Penrose) pseudo-inverse of a libgsl matrix in plain C.
* Compile uding:
* gcc moore_penrose_pseudoinverse.c -lgsl -lblas
* Dependencies:
* - libgsl (GNU Scientific Library)
* - libblas (Basic Linear Algebra Subprograms)
turingbirds /
Created April 30, 2020 10:32
Manually launch xscreensaver; disable auto-activate
# I do not want my screensaver to auto-activate after a timeout.
# For some reason, you *have* to select a nonzero, finite timeout value for xscreensaver (there's no "infinity").
# I only want my screensaver to active when I lock my system by pressing [Meta]+[L].
# This hotkey is set up to launch this script, which
# - starts the xscreensaver daemon,
# - activates the screensaver (with lockscreen enabled),
# - waits for it to terminate (unlocking logs an "UNBLANK" event),
# - then kills the xscreensaver daemon.