Skip to content

Instantly share code, notes, and snippets.

View tobert's full-sized avatar
💭
🏳️‍🌈 💻 🏳️‍🌈

Amy Tobey tobert

💭
🏳️‍🌈 💻 🏳️‍🌈
View GitHub Profile
@tobert
tobert / LinuxMIDISynth.md
Created November 28, 2017 23:31
MPKmini2 MIDI + fluidsynth CLI only

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 / gist:8063382
Created December 20, 2013 23:36
Switching clock from TSC to HPET on Linux.
tobert@spaceghost /sys/devices/system/clocksource/clocksource0 $ cat /proc/cpuinfo |grep 'model name' |head -n 1
model name : Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
tobert@spaceghost /sys/devices/system/clocksource/clocksource0 $ cat /proc/version
Linux version 3.11.4-gentoo (root@sysresccd) (gcc version 4.6.4 (Funtoo 4.6.4) ) #1 SMP Mon Oct 7 05:33:55
tobert@spaceghost /sys/devices/system/clocksource/clocksource0 $ cat available_clocksource
tsc hpet acpi_pm
tobert@spaceghost /sys/devices/system/clocksource/clocksource0 $ cat current_clocksource
tsc
tobert@spaceghost /sys/devices/system/clocksource/clocksource0 $ echo hpet |sudo tee current_clocksource
hpet
@tobert
tobert / cassandra_hugepages.md
Last active February 16, 2023 16:39
Hugepages + Cassandra

Add these flags to cassandra-env.sh

-XX:+UseLargePages # enable huge page support in the JVM
-XX:LargePageSizeInBytes=2m # tell the JVM to ask for 2MB hugepages
-XX:+AlwaysPreTouch # make sure the JVM initializes all of its memory to avoid fragmentation

Then to allow the JVM to allocate huagepages, the kernel needs to be told how many huge pages to create. This is done by setting vm.nr_hugepages. In order to use these reserved pages, a non-root process needs to be part of a Unix group that will be allowed

@tobert
tobert / reclaimWin10.ps1
Created April 3, 2017 19:49
locally customized version of the Win10 setup script
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
@tobert
tobert / cpuinfo.txt
Created March 29, 2014 01:55
Spaceghost System Info
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
stepping : 7
microcode : 0x14
cpu MHz : 1640.765
cache size : 8192 KB
physical id : 0
@tobert
tobert / env.sh
Last active November 27, 2022 08:53
cassandra-env.sh excerpt to *disable* JMX security
# jmx: metrics and administration interface
#
# add this if you're having trouble connecting:
# JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=<public name>"
myip=$(ip -4 addr show eno1 |awk '/inet /{ gsub(/\/[0-9]+/, ""); print $2 }')
JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=$myip"
#
# see
@tobert
tobert / gist:10200065
Created April 8, 2014 22:04
traceroute from my Linux machine to 8.8.8.8
atobey@zorak ~ $ traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 homeportal (192.168.42.1) 9.817 ms 9.816 ms 9.812 ms
2 50-0-37-1.dsl.static.sonic.net (50.0.37.1) 47.140 ms 47.146 ms 48.199 ms
3 gig1-35.cr1.lsatca11.sonic.net (70.36.243.137) 48.182 ms 48.184 ms 49.345 ms
4 0.xe-5-1-0.gw.pao1.sonic.net (69.12.211.1) 59.457 ms 59.809 ms 61.355 ms
5 ae2.0.gw.equinix-sj.sonic.net (50.0.2.14) 63.367 ms 63.370 ms 80.505 ms
6 eqixsj-google-gige.google.com (206.223.116.21) 73.541 ms 77.821 ms 77.818 ms
7 216.239.49.168 (216.239.49.168) 79.379 ms 216.239.49.170 (216.239.49.170) 84.256 ms 216.239.49.168 (216.239.49.168) 83.373 ms
8 209.85.250.60 (209.85.250.60) 68.261 ms 209.85.246.38 (209.85.246.38) 69.341 ms 69.338 ms
@tobert
tobert / otel-cli-ideas.sh
Last active August 18, 2022 11:58
span & event ideas for otel-cli
#!/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?
@tobert
tobert / backup-docker-cassandra.sh
Created October 28, 2014 18:16
Quick & dirty cassandra-in-docker backup script
#!/bin/bash
# A quick & dirty backup script for Cassandra running inside Docker.
# Assumes /var/lib/cassandra is mounted in the container as /var/lib/cassandra because
# docker inspect {{ .Volumes }} is not shell-friendly. (doable, but meh)
# Also assumes Cassandra was started with 'docker run --name cassandra'.
export PATH=$PATH:/home/atobey/bin:/usr/local/bin
set -e
@tobert
tobert / talk-agenda-trace.sh
Last active March 15, 2022 05:28
a silly script to generate a trace of our agenda
#!/bin/bash
svc="SRECon"
# turns out the date doesn't matter much for this exercise since
# we don't show it
# but it is important for /finding/ these spans once you've sent them
# so pick a date/time earlier today while testing :)
talk_start="2022-03-14T20:00:00.00000Z"
talk_end="2022-03-14T20:40:00.00000Z"