Skip to content

Instantly share code, notes, and snippets.

View MrKevinWeiss's full-sized avatar

Kevin "Tristate Tom" Weiss MrKevinWeiss

  • HAW Hamburg
  • Hamburg
View GitHub Profile
"""Script to try to identify missing configs in the kconfig files.
It is important to run this on a clean repo, I usually just clone fresh in /tmp
This prevents build artifacts and downloaded vendor/packages from getting scanned.
"""
import os
import pathlib
import argparse
@MrKevinWeiss
MrKevinWeiss / inet-nm-demo.md
Last active September 14, 2023 09:06
inet-nm-demo

INET-NM Demo

tags: HAW Hamburg Work Demo

Intro

Problems

  • RIOT has nice board abstractions but when using multiple boards, managing which one is which can be an issue.
  • Keeping inventory of which boards are available, used, or missing can be difficult when in a shared office.
  • Having boards remotely available for both developer and CI use becomes hard to control requiring some coordination.
@MrKevinWeiss
MrKevinWeiss / new-board-inserted.sh
Created April 20, 2023 09:31
Check new boards and create exports
select_line() {
local file="$1"
local lines=()
local selected_line=""
# Read the file into an array
while read -r line; do
lines+=("$line")
done < "$file"
@MrKevinWeiss
MrKevinWeiss / combine-report.py
Last active March 30, 2023 21:09
combine-report
import argparse # Importing argparse module to handle command line arguments
import json # Importing json module to work with JSON files
import os # Importing os module to work with file paths and directories
import re # Importing re module to work with regular expressions
from pathlib import (
Path, # Importing Path class from pathlib module to work with file paths
)
from PyPDF2 import PdfMerger # Importing PyPDF2 PdfMerger class
@MrKevinWeiss
MrKevinWeiss / test.py
Last active March 15, 2023 12:34
USB power switcher test - Hardcoding is fun
"""Tests the HUC9002V1EBL with RIOT OS and a bunch of nucleo boards.
Note that the usb type 3 cable had some issues with the charging ports (1-3).
Using a usb type A connector fixed it (purchased separately).
"""
import sys
import subprocess
import os
from time import sleep
@MrKevinWeiss
MrKevinWeiss / git-hash-of-files.py
Created December 13, 2022 13:19
Calculate the git blob hash of
#!/usr/bin/python3
"""Hashes the contents of files matching git.
Example of how to get the get hash allowing `git cat-file -p <hash>` to work.
The output of the files should match `git ls-tree HEAD -r -t`.
"""
from sys import argv
from hashlib import sha1
import plotly.express as px
import random
from statistics import mean, stdev, variance
import pandas as pd
output_measurements = []
for freq in range(100, 1000):
freq /= 10
make RIOT_CI_BUILD=1 CC_NOCOLOR=1 --no-print-directory -C ./examples/arduino_hello-world clean all --jobs 7
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Berlin:/etc/localtime:ro' -v '/home/weiss/wd/RIOT:/data/riotbuild/riotbase:delegated' -v '/home/weiss/.cargo/registry:/data/riotbuild/.cargo/registry:delegated' -v '/home/weiss/.cargo/git:/data/riotbuild/.cargo/git:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles' -e 'BOARD=arduino-mega2560' -e 'CC_NOCOLOR=1' -e 'RIOT_CI_BUILD=1' -e 'DISABLE_MODULE=' -e 'DEFAULT_MODULE=' -e 'FEATURES_REQUIRED=' -e 'FEATURES_BLACKLIST=' -e 'FEATURES_OPTIONAL=' -e 'USEMODULE=arduino' -e 'USEPKG=' -w '/data/riotbuild/riot
@MrKevinWeiss
MrKevinWeiss / exmapleapi.py
Last active June 30, 2022 11:55
for marcel
from statistics import mean, stdev
class PhilipExtIf(PhilipBaseIf):
def _get_stats(self, vals: list):
"""Calculate stats of a list of values.
Returns:
dict containing stats: