Skip to content

Instantly share code, notes, and snippets.

@brandsimon
brandsimon / echo.ino
Last active July 11, 2023 00:35
Digispark Attiny85 example sketches
#include <DigiCDC.h>
void setup() {
SerialUSB.begin();
}
void loop() {
if (SerialUSB.available()) {
SerialUSB.write(SerialUSB.read());
}
@brandsimon
brandsimon / Readme.md
Last active October 22, 2021 01:08
Lineage Cheeseburger secure build

A secure LineageOS Chesseburger build

  • user build instead of userdebug build
  • all signing keys are private keys
  • use LineageOS recovery

Buildsystem

Use Debian 11 and install these packages. You need ~300 GB available space.

@brandsimon
brandsimon / README.md
Last active July 12, 2020 19:46
Async-executor for multiple threads

This is just a little cpp class to execute a function parallel with different parameters over and over again. It was developed to test some c++ features.

Compile: clang++-7 -Wall x.cpp -lpthread -std=c++17

@brandsimon
brandsimon / auth.py
Created January 16, 2020 03:01
Authenticate trezor to user
"""
You can use the `authenticate_trezor` function to be sure
that your connected trezor has the private key to the provided
public key.
For example:
your trezor is password protected:
before sending your secret password to the trezor,
you can authenticate the trezor to you.
"""
import base64
#!/usr/bin/env bash
# Pipe to file, then search for duplicates
# cat keys | sort | uniq -c | sort -n
for i in $(seq 1 100); do
echo "i: ${i}" >&2
trezorctl device wipe >&2
sleep 1
trezorctl device setup --skip-backup --strength 256 >&2
sleep 1
trezorctl btc get-address -n "m/44'/1'/1'/1/2"
@brandsimon
brandsimon / no-defaults.sh
Last active August 26, 2019 00:38
VPNC-no-default-settings
#!/bin/sh
# this disables changes to /etc/resolv.conf
INTERNAL_IP4_DNS=
# this disables setting the default route and sets a route to the network
CISCO_SPLIT_INC=1
CISCO_SPLIT_INC_0_ADDR="$(echo "${INTERNAL_IP4_ADDRESS}" | cut -d. -f 1-3)".0
CISCO_SPLIT_INC_0_MASK=255.255.255.0
CISCO_SPLIT_INC_0_MASKLEN=24
# This function will add a route to the network. The cisco split inc will work fine unless you are in the network
@brandsimon
brandsimon / vpnc@.service
Last active August 26, 2019 23:37
VPNC Systemd Service
[Unit]
Description=VPNC connection to %i
# After=network-online.target
# Wants=network-online.target
[Service]
Type=forking
ExecStart=/usr/sbin/vpnc --pid-file=/run/vpnc@%i.pid /etc/vpnc/%i.conf
PIDFile=/run/vpnc@%i.pid
def print_suite(suite):
if hasattr(suite, '__iter__'):
for x in suite:
print_suite(x)
else:
print(suite)
@brandsimon
brandsimon / Pulseaudio Equalizer
Last active April 23, 2019 22:54
Pulseaudio Equalizer
Pulseaudio Equalizer
Features:
- Apply equalizer setting to every sink
- Be able to use it with module-switch-on-connect
- Switch between sinks while keeping equalizer settings
This is also an example of how to work with filter.apply and filter.apply.*.parameters
Add this to your .bash_profile and modify the control values for your desired output.