Instantly share code, notes, and snippets.

@turingbirds
turingbirds / bwedge.scad
Last active Sep 6, 2018
Beveled wedge shape for OpenSCAD
View bwedge.scad
// Beveled wedge shape for OpenSCAD
// Written by C.A.P. Linssen <charl@itfromb.it>, 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 <http://creativecommons.org/publicdomain/zero/1.0/>.
// module bwedge
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.
@turingbirds
turingbirds / ltspice_high_precision.rst
Last active May 20, 2018
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
turingbirds / Agilent 82357B GPIB interface programming on Ubuntu Linux.rst
Last active Jan 2, 2019
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 gpib_install.sh (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
turingbirds / moore_penrose_pseudoinverse.c
Last active Nov 16, 2018
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
turingbirds / GNUPG Cheatsheet.md
Last active Feb 12, 2019
GPG (GNUPG) Cheatsheet
View GNUPG Cheatsheet.md

GNUPG CHEATSHEET

Setting up: key generation

This generates a public/private keypair.

$ gpg --gen-key
$ gpg --list-secret-keys
@turingbirds
turingbirds / invoke.py
Last active Aug 29, 2015
Execute a child program in a new process
View invoke.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Execute a child program in a new process"""
import os
import subprocess
def exec_binary(cmd_line_list, cwd=None, stdout=None, stderr=None, verbose=False):
"""Invoke an executable file.
@turingbirds
turingbirds / upload.php
Last active Oct 9, 2018
a simple php upload script
View upload.php
<?php
header("Content-Type: text/html; charset=utf-8");
function display_filesize($filesize) {
if (is_numeric($filesize)) {
$decr = 1024;
$step = 0;
$prefix = array('Byte','KB','MB','GB','TB','PB');