Skip to content

Instantly share code, notes, and snippets.

#![no_main]
#![no_std]
use panic_probe as _;
use core::{cell::RefCell, ops::Deref};
use cortex_m::interrupt::{Mutex, free};
use cortex_m_rt::entry;
use stm32f4xx_hal::{
gpio::{Alternate, PA8, PC6},
pac::{interrupt, Interrupt, Peripherals, TIM1, TIM8},

k8s Adventure

Context

  • Running Mac OS X on Apple M1 (arm64)

kubectl

brew install kubernetes-cli

k8s Adventure

Context

  • Running Mac OS X on Apple M1 (arm64)

kubectl

brew install kubernetes-cli
import WebSocket from 'ws'
const parseWsPacket = (str) => {
const cleanerRgx = /~h~/g
const splitterRgx = /~m~[0-9]{1,}~m~/g
return str
.replace(cleanerRgx, '')
.split(splitterRgx)
.map((p) => {
if (!p) return false
@brandonros
brandonros / preact+htm.html
Last active February 18, 2022 04:02
Preact + htm template strings example (no JSX, no transpiling, unpkg imports)
<!doctype html>
<html>
<head>
</head>
<body>
<script type="module">
import * as Preact from 'https://unpkg.com/[email protected]/dist/preact.module.js'
import htm from 'https://unpkg.com/[email protected]/dist/htm.module.js'
const html = htm.bind(Preact.createElement)
// 1. starting balance: $10000, add $1000 every 7 days
// 2. first trade: buy $1000 worth of SPY on 2021-01-04 at the open price
// 3. all subsequent trades: buy $1000 worth of SPY every 7 days
// 4. include dividend revinesting
// 5. what is account value as of 2021-12-23 using closing price
const assert = require('assert')
const rows = [
{
#/bin/sh
# download from https://dl-cdn.alpinelinux.org/alpine/edge/releases/x86_64/netboot/
qemu-system-x86_64 \
-m 512 \
-kernel ~/Downloads/alpine-edge-x86_64/vmlinuz-lts \
-initrd ~/Downloads/alpine-edge-x86_64/initramfs-lts \
-append "console=ttyS0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/" \
-nographic
#!/bin/sh
# download from https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/
qemu-system-aarch64 \
-M virt,highmem=off \
-m 512M \
-cpu host \
-accel hvf \
-kernel ~/Downloads/alpine-edge-aarch64/vmlinuz-lts \
-initrd ~/Downloads/alpine-edge-aarch64/initramfs-lts \
-append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/" \
from ghidra.program.model.data import PointerDataType
def create_pointer(address):
try:
currentProgram.getListing().createData(toAddr(address), PointerDataType())
except:
pass
functionManager = currentProgram.getFunctionManager()
f = askFile("Give me a file to open", "Go baby go!")
@brandonros
brandonros / gist:4aa6ae51d0f925671d034446947df555
Last active March 23, 2025 16:50
BMW UDS function descriptions
10 01;setDefaultSession
10 02;setProgrammingSession
10 03;setExtendedDiagnosticSession
11 01;hardReset
14 FF FF FF,31 01 0F 06,31 01 40 00 00,31 01 40 00 05,31 01 40 00 01;Clear all DTCs (clear DTC,clear Infospeicher,ZFS ***8211; DM_Lock,clear ZFS ***8211; DM_Clear,ZFS ***8211; DM_Unlock)
14 FF FF FF;Clear DTC
19 02 0C;ReadDTC(0C)
19 0A;ReadSupportedDTC
22 10 0A;readEnergyMode
22 10 0E;readExtendedMode