Skip to content

Instantly share code, notes, and snippets.

@lennart
lennart / kick_manual.sh
Created May 20, 2020 18:41
manual kick script (stock axiom beta firmware)
#!/bin/bash
cd "${0%/*}" # change into script dir
. ./cmv.func
. ./hdmi.func
. ./i2c0.func
./fclk_init.sh
./zynq_info.sh
@lennart
lennart / capistrano-deploy-and-rollback.log
Last active March 27, 2020 13:31
Log of a deploy and rollback with multiple asset manifests
# Logfile created on 2020-03-27 14:25:53 +0100 by logger.rb/66358
INFO ---------------------------------------------------------------------------
INFO START 2020-03-27 14:25:53 +0100 cap staging deploy
INFO ---------------------------------------------------------------------------
DEBUG [9303ea55] Running /usr/bin/env which passenger as user@staging.example.com
DEBUG [9303ea55] Command: /usr/bin/env which passenger
DEBUG [9303ea55] Finished in 0.381 seconds with exit status 1 (failed).
DEBUG [34ddfb7b] Running ~/.rvm/bin/rvm version as user@staging.example.com
DEBUG [34ddfb7b] Command: ~/.rvm/bin/rvm version
DEBUG [34ddfb7b] rvm 1.29.7-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
@lennart
lennart / miteinander_map.rb
Created March 18, 2020 14:26
simplify location lookup (pseudo-implementation)
require 'json'
GRID_STEP_SIZE = 100 # meters
# https://stackoverflow.com/questions/12966638/how-to-calculate-the-distance-between-two-gps-coordinates-without-using-google-m
def distance(loc1, loc2)
rad_per_deg = Math::PI/180 # PI / 180
rkm = 6371 # Earth radius in kilometers
rm = rkm * 1000 # Radius in meters
@lennart
lennart / lvbootstrap
Last active October 30, 2016 00:12
diy shell script explanation of base image creation to run systemd-nspawn containers from btrfs subvolumes
#!/bin/sh
log=3
fence="s/.*/ &/"
echo "# How to make a new base image"
echo "for containers."
echo
echo "Create a new logical volume:"
echo
lvcreate --help 2> /dev/null | head -n $log | sed "$fence"
d1 $ n (weave' 8 (run 4) [
rev . slow 2 . offadd 0.25 12,
slow 4 . offadd 0.5 7,
iter 4
]) # s "supercomparator"
@lennart
lennart / .gitignore
Last active June 15, 2016 09:42
Simple Testing for Tidal MIDI
.cabal-sandbox
dist
test
*~
@lennart
lennart / k81x_conf.c
Created May 29, 2016 16:30 — forked from anonymous/k81x_conf.c
Invert fn keys for Logitech K81x series (Linux)
/*
* Copyright 2012 Mario Scholz <mario@expires-2013.mail.trial-n-error.net>
*
* based on pairing_tool.c from Benjamin Tissoires <benjamin.tissoires@gmail.com>
* see also https://lkml.org/lkml/2011/9/22/367
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
@lennart
lennart / SyncSC.hs
Last active May 29, 2016 09:32
Record Tidal patterns from SuperCollider (HW output or SuperDirt outBus)
module Recorder where
import Sound.Tidal.Tempo (Tempo(..), clocked)
import Sound.Tidal.Stream (logicalOnset')
import Sound.OSC.FD
import Sound.OSC.Datum
import Control.Concurrent
import Control.Concurrent.MVar
init :: IO ((IO (), IO ()))
init = do s <- openUDP "127.0.0.1" 57130
@lennart
lennart / documented.sh
Last active May 25, 2016 17:35
Finding undocumented things in Tidal
# within the tidalcycles.github.io repo do
find _functions/ -type f -iname "*.md" -print0 | xargs -0 -n1 basename | cut -d. -f1 | sort | grep -v index > documented.txt
@lennart
lennart / midi-pattern-test.tidal
Last active May 17, 2016 09:14
midi pattern test for tidal 0.6 / 0.7
let simple = "SimpleSynth virtual input"
-- 0.6 style setup
import Sound.Tidal.MIDI.Output
import Sound.Tidal.SimpleSynth
keyStreams <- midiproxy 1 simple [(keys, 1), (keys, 2), (keys, 3), (keys, 4)]
[m1,m2,m3,m4] <- sequence keyStreams
-- > 0.7 init