Skip to content

Instantly share code, notes, and snippets.

View mjkpolo's full-sized avatar
🗿
deeply closeted functional programmer

Marco Kurzynski mjkpolo

🗿
deeply closeted functional programmer
View GitHub Profile
@mjkpolo
mjkpolo / m1_qemu.md
Last active January 11, 2023 19:52
running qemu for linux on m1

Download qemu

brew install qemu

Setup a directory

mkdir ~/qemu
@mjkpolo
mjkpolo / start_vm.sh
Last active January 11, 2023 19:50
starting qemu for building and running
#!/bin/bash -e
NPROC=4
SOURCE=$(dirname -- $( readlink -f -- $0 ))
DISK=ubuntu.qcow2
cp $(dirname $(which qemu-img))/../share/qemu/edk2-aarch64-code.fd $SOURCE
cp $(dirname $(which qemu-img))/../share/qemu/edk2-arm-vars.fd $SOURCE
if [ "$1" == "build" ]
then
#include <assert.h>
#include <signal.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
@mjkpolo
mjkpolo / joystick.py
Created December 16, 2023 16:06
BLE Linux python-evdev joystick
from evdev import UInput, ecodes, AbsInfo
import asyncio
from bleak import BleakClient, BleakError
gearshift_uuid = "64bb31a7-432a-4d12-a646-efa0df31c789"
rotary_uuid = "4d9ef14c-e4f7-48c6-9cdc-8ded226b067d"
rumble_uuid = "798449fc-e2a1-4fa2-9e17-b77f87c98499"
accel_uuid = "f10d896b-a37c-43b7-b702-b324da1cfb99"
brake_uuid = "e62e34d0-3d83-4b9e-b3ff-0ab6f957a3be"
clutch_uuid = "c0a12cc1-302a-4847-819b-1e76a549611c"