Skip to content

Instantly share code, notes, and snippets.

View darconeous's full-sized avatar
🦀

Robert Quattlebaum darconeous

🦀
View GitHub Profile
@darconeous
darconeous / main.c
Created March 25, 2018 05:10
ATTiny LED Twinkler
/* ATTiny LED Twinkler
*
* This is come code I wrote a while back to "twinkle"
* four GPIO outputs that would drive LEDs. It was designed
* to be run on an eight-pin ATTiny13 chip. It works
* quite well, even considering how inefficient it is.
*
* - Robert Quattlebaum, 2012
*/
@darconeous
darconeous / playground.rs
Last active May 17, 2019 23:52 — forked from rust-play/playground.rs
Code shared from the Rust Playground
/// Demonstration of a way to do polymorphic property lookup of standardized
/// collections of properties via simple traits and getter methods. This
/// approach could be extended to do things like fetch a list of the supported
/// keys, or expose aritrary traits via a property interface.
/// This is the trait that will be our general-purpose property interface. It
/// is intended to be used as a trait object.
///
/// This trait is implemented automatically by the `impl_super_trait!` macro,
@darconeous
darconeous / playground.rs
Last active May 29, 2019 17:56 — forked from rust-play/playground.rs
Code shared from the Rust Playground
/// Demonstration of compile-time key-value type safety.
///
/// This program demonstrates how you use Rust generics to encode type
/// information into the keys for a key-value store. This allows for
/// type-safe access to data in the store, preventing things like writing
/// strings to keys that should only contain integers. Attempting to
/// do so results in a compile-time error.
///
/// The example code is at the top of this file, the implementation details
/// are below the example.
@darconeous
darconeous / playground.rs
Last active July 2, 2019 01:55 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use futures::prelude::*;
use pin_utils::unsafe_pinned;
use std::ops::Deref;
use std::pin::Pin;
use std::sync::Arc;
/// A container for a single object with lifetime that is bound to that of an `Arc`.
/// This is useful for passing around boxed futures that have a lifetime that is limited
/// to that of the object that created it.
///
@darconeous
darconeous / tesla-key-card-protocol.md
Last active November 4, 2025 02:44
Tesla Key Card Protocol

Tesla Key Card Protocol

Researched by Robert Quattlebaum [email protected].

Last updated 2020-02-03.

Image of Tesla Key Card Image of Tesla Model 3 Key Fob

@darconeous
darconeous / Curve25519-Curve448-Terminology.md
Last active February 9, 2020 00:41
Curve25519/Curve448 Terminology

Curve25519/Curve448 Terminology

Curve25519: A well-known Montgomery curve designed for ECC at a 128-bit security level.

X25519: The name of the scalar-point multiplication function for points on Curve25519 when performing ECDH. It is also commonly used as a shorthand for ECDH-using-Curve25519.

EdDSA:

@darconeous
darconeous / quick_install.sh
Created March 17, 2020 21:46
Installer script for ledger-u2f-javacard
#!/bin/sh
GP=${GP-java -jar gp.jar}
set -v
set -e
# This is for the ACR122U to put it into
# a nice state where it won't time out on us.
$GP -d -v -a ff0041ff00 -a ff00520000 || true
@darconeous
darconeous / rect-starlink-cable-hack.md
Last active November 4, 2025 17:21
Hacking the Rectangular Starlink Dishy Cable
@darconeous
darconeous / fm-discriminator.md
Last active April 20, 2023 20:34
Extracting the fundamental frequency from a time-domain signal

Extracting the fundamental frequency from a time-domain signal

"Extracting the fundamental frequency from a time-domain signal" is basically a long-winded way of saying "demodulating the baseband signal from FM-encoded signal". Well, that's still long winded, but I digress.

In an FM radio, the contraption that accomplishes this task is referred to as a "discriminator". So the task here is to implement a software-based frequency discriminator. There are a few different ways

@darconeous
darconeous / tcprepl.py
Created September 21, 2022 00:23
Micropython TCP/telnet REPL
# REPL Prompt over TCP socket.
# Use `$ telnet <ip-addr>` to connect.
import network
import os
import socket
import sys
listen_s = None
client_s = None