Skip to content

Instantly share code, notes, and snippets.

@todbot
todbot / synthio_midi_synth.py
Last active September 26, 2024 16:43
pretty usable MIDI-controlled synth using synthio in CircuitPython
# synthio_midi_synth.py - pretty usable MIDI-controlled synth using synthio in CircuitPython
# 11 May 2023 - @todbot / Tod Kurt
# Uses cheapie PCM5102 DAC on QTPY RP2040
# Video demo: https://www.youtube.com/watch?v=N-PbbWWDE6k
# Features:
# - midi velocity controls attack rate (gentle press = slow, hard press = fast)
# - notes have small random detune on all oscillators to reduce phase stacking
# - adjustable number of detuned oscillators per note 1-5 (midi controller 83)
# - five selectable waveforms: saw, squ, sin, noisy sin, noise (midi controller 82)
# - vibrato depth on mod wheel (midi controller 1)
@machuu
machuu / WSL2_VPN_Workaround_Instructions.md
Last active November 16, 2024 13:12
Workaround for WSL2 network broken on VPN

Overview

Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active.

The root cause seems to be that WSL2 and the VPN use the same IP address block, and the VPN routing clobbers WSL2's network routing.

This problem is tracked in multiple microsoft/WSL issues including, but not limited to:

@ofen
ofen / _helper.tpl
Last active May 12, 2023 08:40
Helm helper to convert label map to comma-separated string
{{/*
Convert labels to string like: key1="value1", key2="value2", ...
*/}}
{{- define "chart.external_labels" -}}
{{- $list := list -}}
{{- range $k, $v := .Values.external_labels -}}
{{- $list = append $list (printf "%s=\"%s\"" $k $v) -}}
{{- end -}}
{{ join ", " $list }}
{{- end -}}
@olih
olih / jq-cheetsheet.md
Last active November 18, 2024 01:10
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active November 10, 2024 05:28
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

#cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/stuff
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: fleet-metadata.service
command: start
@micw
micw / install_jenkins_plugin.sh
Last active August 11, 2023 06:14
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins
@ianmas-aws
ianmas-aws / gist:8840850
Last active August 29, 2015 13:56
How use the command line to find out which tags are associated with an EC2 instance
Try this - it requires that you have the AWS command line tools installed and that your instance has either been assigned an IAM role with sufficent permissions, or that your AWS command line tools have been set up with the right credentials. You should use IAM roles if you want to get this info at first boot, which I suspect is what you want to use this for?
aws ec2 describe-instances --region eu-west-1 --output text --instance-ids `curl -s http://169.254.169.254/latest/meta-data/instance-id` | grep TAGS
If you create an IAM role called AllowDescribeInstances with the following policy this and assign it to your instances, this is the minimum permissions set that is required.
{
"Version": "2012-10-17",
"Statement": [