Skip to content

Instantly share code, notes, and snippets.

@gekart
gekart / print-object.py
Created March 21, 2023 09:04
Display compressed Git object contents
#!/usr/bin/python3
import zlib
import hashlib
import sys
if len(sys.argv) != 2:
print("Usage:", sys.argv[0], " <path-to-git-object>")
exit(-1)
@gekart
gekart / PolyMono.js
Last active April 29, 2020 21:55
MIDI Fx PolyMono for Logic Pro X: Send MIDI notes of chords to a mono synth voice by voice
// PolyMono: Play polyphonic material on external mono synths
// Logic Pro X MIDI-FX Scripter script to separate single notes (voices) out of chords
//
// Install: On a MIDI track click on MIDI-FX and select Scripter,
// paste this script into the script window and hit Run Script,
// save script as PolyMono.
//
// How to use: create a polyphonic track (e.g. a chord progression using a poly plugin),
// drop PolyMono Scripter MIDI-FX on the track,
// set polyphony to max notes played at once,
@gekart
gekart / molg.py
Last active March 28, 2020 09:42
KORG monologue Preset Pretty Printer
# Use this file to parse the structure of your monologue programs and libraries (sound banks)
# this makes it easy to understand and document a finished sound
# run "python molg.py test.moldprog" to print the sound in a program name test.moldprog
# or "python molg.py test.molglib 1" to print the second sound in the bank named test.molglib
import struct, sys, zipfile
""" def bit_on_off(flags):
bit_list = []
for i in range(15):
@gekart
gekart / aws-cheatsheet.sh
Created September 19, 2019 18:05
AWS Cheatsheet
aws sts assume-role --role-arn arn:aws:iam::<account-id-role>:role/<role-name> --role-session-name <session-name>
--serial-number arn:aws:iam::<account-id-user>:mfa/<username> --token-code <digits>
@gekart
gekart / aws-clis-install.sh
Last active September 19, 2019 14:47
AWS install all important CLI parts for developing
pip3 install awscli
pip3 install awsebcli --upgrade --user
brew tap aws/tap
brew install aws-sam-cli
npm install -g @aws-amplify/cli
npm install -g aws-cdk
brew install httpie
pip3 install chalice
brew install amazon-ecs-cli
@gekart
gekart / kubernetes.sh
Last active July 17, 2019 16:38
kubernetes notepad
kubectl get componentstatuses
source <(kubectl completion bash)
openssl genrsa -out ca.key 2048
openssl req -x509 -new -nodes -key ca.key -subj "/CN=${MASTER_IP}" -days 10000 -out ca.crt
openssl genrsa -out server.key 2048
cat > csr.conf <<EOF
[ req ]
default_bits = 2048
@gekart
gekart / mnlgxd.py
Last active March 2, 2023 06:27
KORG minilogue xd PROG file parser and pretty printer
# Use this file to parse the structure of your minilogue programs and libraries (sound banks)
# this makes it easy to understand and document a finished sound
# run "python mnlgxd.py test.mnlgxdprog" to print the sound in a program name test.mnlgxdprog
# or "python mnlgxd.py test.mnlgxdlib 1" to print the second sound in the bank named test.mnlgxdlib
import struct, sys, zipfile, fpdf
fileStructure = [
("MAGIC", "<4s"),
("PROGRAM NAME", "12s"),
@gekart
gekart / gist:943ca945ba03f1727eeeda7576287caf
Created November 6, 2018 11:31
AWS Instance Creation Userdata for a 2048 Demo
#!/bin/bash -x
yum install -y httpd git
cd /var/www/html
rm -rf *
git clone https://github.com/gabrielecirulli/2048.git .
service httpd start
chkconfig httpd on