Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🏳️‍🌈 💻 🏳️‍🌈

Amy Tobey tobert

💭
🏳️‍🌈 💻 🏳️‍🌈
View GitHub Profile
@tobert
tobert / otel-cli-ideas.sh
Last active Mar 30, 2021
span & event ideas for otel-cli
View otel-cli-ideas.sh
#!/bin/bash
# otel-cli-ideas.sh - some ideas I'm playing with for otel-cli to cover some
# use cases where manual spans or exec don't quite do the trick
#
# another cool outcome is you could run this without the collector in some
# cases without spamming your OTLP endpoint...
#
# I hope to OSS otel-cli under Apache 2 in early April 2021.
# maybe it could background itself and wait for events on a unix socket?
View opentelemetry-collector.yaml
receivers:
otlp:
protocols:
grpc:
endpoint: "127.0.0.1:55680"
# opentelemetry-ruby only supports http for now
http:
endpoint: "127.0.0.1:55681"
processors:
@tobert
tobert / otel-test-forking-cli.rb
Last active Mar 5, 2021
a quick & dirty test script for testing some otel code
View otel-test-forking-cli.rb
#!/usr/bin/env ruby
# run the otel collector with otlp/http enabled and turn on debug logging
# so you can see it print spans as they go through...
#
# configuration:
# export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:55681
#
# first iteration I thought I had an easy repro because I had set
# OTEL_RUBY_BSP_START_THREAD_ON_BOOT=false
# so don't do that :) It's almost never what you want.
View xhyve-systemrescue.sh
#!/bin/bash
# start up my Arch machine
# for this to work I had to extract kernel & initramfs from the ISO
# which is a surprisingly a pain in the butt on OSX but easy enough
# to find on Google, tldr add 2K of zeroes to the front of the ISO
# then it'll mount just fine
# to make root disk:
# dd if=/dev/zero of=root.img conv=sparse bs=1000000 count=20000
@tobert
tobert / main.go
Created Jan 1, 2019
silly example
View main.go
func main() {
input := []string{
"a",
"b",
"c",
"foo",
}
data := make(map[string][]string)
@tobert
tobert / gradients.pl
Created Jul 3, 2018
An old perl hack for generating a colored grid of cluster load from load averages collected by collectd in RRD files.
View gradients.pl
#!/usr/bin/perl
# this needs a serious cleanup/rewrite - it was hacked together
# very quickly for a completely different purpose many years ago
# and has grown in the worst organic way since
# but ... it does work fairly well so it persists
# Copyright 2007-2011 A Tobey <tobert@gmail.com>
use strict;
use warnings;
@tobert
tobert / yamlpath.py
Created Feb 6, 2018
a quick & dirty yaml path printer for embedding in shell scripts
View yamlpath.py
#!/bin/env python3
#
# this is NOT a human-facing tool
#
# This is to replace the legacy data files being used to populate
# variables in a shell script and instead get them from the vars
# files even though that still feels weird.
#
# Example:
# azs=$(yamlpath.py roles/cassandra/vars/clusters.yml clusters/multitenant-us-east-1/availability_zones)
@tobert
tobert / LinuxMIDISynth.md
Created Nov 28, 2017
MPKmini2 MIDI + fluidsynth CLI only
View LinuxMIDISynth.md

Akai MPK Mini 2 + Fluidsynth + Linux synthesizer

This is a quick & dirty way to attach an Akai MPK mini 2 USB MIDI controller to Linux so the Linux machine can act as its synthesizer. This approach should work for any modern USB MIDI instrument.

Rationale

I looked around on the web and, surprisingly, I didn't find any simple options for quickly starting Fluidsynth up and wiring it to a MIDI controller for simple keyboard usage. There are a few out there that involve using Qsynth which is cool but I didn't want a GUI for something relatively simple.

Shell Session

@tobert
tobert / linux-dnsmasq-mitm.sh
Created Jun 15, 2017
Instructions + iptables script for MITM laptop for tcpdump and/or wireshark
View linux-dnsmasq-mitm.sh
#!/bin/bash
# put this in /etc/dnsmasq.conf then start/restart it
# modify the interface= to point at the ethernet port the device is connected to
# optionally, set MAC address in the dhcp-host line to be the MAC of the device
#interface=enp0s31f6
#dhcp-range=192.168.102.9,192.168.102.20,255.255.255.0,12h
#dhcp-host=70:58:12:a8:e5:35,192.168.102.10
# set INTERNET_INTERFACE to the laptop's internet access interface, e.g. wifi interfaces