Skip to content

Instantly share code, notes, and snippets.

View konsumer's full-sized avatar

David Konsumer konsumer

View GitHub Profile
@konsumer
konsumer / generate_renoise.py
Last active January 8, 2022 16:35
Convert a bunch of wave-files into renoise instruments: I had samples of a drum VST that I recorded by playing all the notes of it, I put all the wave-files in the same dir names "extract_drums_freeze_NAME.wav". This will slice them on silence, and create a drumkit instruments for renoise.
#!/usr/bin/env python3
from pydub import AudioSegment
from pydub.silence import split_on_silence
from os import listdir, path, rename
from os.path import isfile, join
from pathlib import Path
from shutil import make_archive, rmtree
mapping = {
@konsumer
konsumer / main.rs
Last active July 14, 2022 18:13
learning rust
#[derive(Debug)]
struct VecStats {
mean: f32,
median: i32,
mode: i32
}
impl VecStats {
fn new(numbers: &Vec<i32>) -> VecStats {
VecStats {
#include <Adafruit_NeoPixel.h>
#define PIN 2 // D4 on nodemcu
#define NUMPIXELS 50
#define DELAYVAL 500
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_RGB + NEO_KHZ800);
void setup() {
pixels.begin();
@konsumer
konsumer / setup_frida_android.sh
Created December 2, 2020 13:36
Script to get frida installed on rooted device
#!/usr/bin/env bash
# get frida installed on your android device
# you should be rooted & have adb & unxz in your path
VERSION="14.0.8-android-arm64"
adb shell "su -c killall -9 frida-server"
if ! adb shell "test -f /data/local/tmp/frida-server"; then
@konsumer
konsumer / cloudSettings
Last active January 28, 2021 08:01
VSCode Settings - Use https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync to keep settings & extensions in sync
{"lastUpload":"2021-01-28T08:01:44.280Z","extensionVersion":"v3.4.3"}
-- Wideband FM broadcast radio receiver for luajit & love
-- modified from here https://luaradio.io/examples/rtlsdr-wbfm-stereo.html
-- run with
-- luajit main.lua
-- or
-- love .
local radio = require('radio')
local function playFM(frequency)
@konsumer
konsumer / openurl.js
Created July 9, 2020 19:17
frida script to open a URL on ios
function openURL(url) {
const UIApplication = ObjC.classes.UIApplication.sharedApplication()
const toOpen = ObjC.classes.NSURL.URLWithString_(url)
return UIApplication.openURL_(toOpen)
}
openURL("https://google.com/search?q=cool")
@konsumer
konsumer / 0_create_image.sh
Last active July 8, 2020 23:48
This is a basic system to modify a pi image & boot it in an emulator. Only docker is required. Instead of docker, you could also use chroot in create_image script. I like using qemu (in docker) so I can really test if the image will work. It constrains memory and runs slower. A chroot is much faster, but less similar to a real pi.
#!/bin/bash
IMG_FILE="${PWD}/yours-buster.img"
if [ ! -f "2020-05-27-raspios-buster-lite-armhf-firstboot.zip" ]; then
echo "Downloading disk image."
curl -OL https://github.com/meeDamian/raspios/releases/download/2020-05-27/2020-05-27-raspios-buster-lite-armhf-firstboot.zip || (
echo "Unable to extract."
exit 1
)
@konsumer
konsumer / personal_data_security.md
Last active June 15, 2020 05:21
Quick overview of some techniques to ensure your personal data is secured. I happily will accept suggestions, if anyone can think of other things, and am also happy to explain or help with any part.

PERSONAL DATA SECURITY

Who Am I?

I'm a programmer with a personal interest in data-security. You can find me on github as konsumer.

Layers

Personal data-security is all about securing every layer, starting with the layers that enable other layers. Keep in mind the full path of things that are high-target items (money, devices - like apple/gmail, personal communication, social-networking) and keep in mind what each item allows access to. Do your best to secure every layer as well as you can, and quickly respond to indications of breach at every layer.

@konsumer
konsumer / gpc_midi2.ino
Created May 20, 2020 00:24
Gamecube controller (or DDR Mat) to USB MIDI. Install "Nintendo" and "MIDIUSB" in arduino library-manager. Use this on a programmable-USB arduino, like Leonardo.
#include "Nintendo.h"
#include "MIDIUSB.h"
// attach gamecube controller red wire on this digital pin
#define GC_PIN 7
// MIDI controls for each pad
int ctrls[6] = { 10, 11, 12, 13, 14, 15 };
// track previous state