Skip to content

Instantly share code, notes, and snippets.

View lulf's full-sized avatar

Ulf Lilleengen lulf

View GitHub Profile
@lulf
lulf / output.json
Created March 14, 2023 11:26
output
evaluate pattern: vuln::not-affected
{
"name": "vuln::not-affected",
"input": "<collapsed>",
"satisfied": false,
"rationale": [
{
"name": "list::none",
"input": [
{
{
"name": "vulnerabilities::not-affected",
"input": {
"bomFormat": "CycloneDX",
"components": [
{
"bom-ref": "pkg:maven/io.quarkus/quarkus-arc@2.16.2.Final?type=jar",
"description": "Build time CDI dependency injection",
"externalReferences": [
{
# Dependencies
cargo install --git https://github.com/lulf/cargo-call-stack.git --branch weird-output
# Static RAM (.bss)
cargo size --release
# Stack (MAX stack usage listed on top)
cargo call-stack --bin basic --format top
git clone https://github.com/lulf/embassy.git
cd embassy/examples/stm32wl
cargo call-stack --bin lorawan
HOST=${1:-"localhost"}
echo "Generating CA key"
openssl ecparam -genkey -name prime256v1 -noout -out ca-key-ec.pem
openssl pkcs8 -topk8 -nocrypt -in ca-key-ec.pem -out ca-key.pem
echo "Generating CA cert"
openssl req -x509 -new -SHA256 -nodes -key ca-key.pem -days 3650 -out ca-cert.pem -batch
echo "Generating server key"
@lulf
lulf / error.txt
Created May 23, 2022 08:45
BT mesh error
ERROR panicked at 'Multiple tasks waiting on same portal', /home/lulf/.cargo/git/checkouts/nrf-softdevice-03ef4aef10e777e4/91a59a1/nrf-softdevice/src/util/portal.rs:88:26
└─ panic_probe::print_defmt::print @ /home/lulf/.cargo/registry/src/github.com-1ecc6299db9ec823/panic-probe-0.3.0/src/lib.rs:91
────────────────────────────────────────────────────────────────────────────────
stack backtrace:
0: HardFaultTrampoline
<exception entry>
1: cortex_m::asm::inline::__udf
at /home/lulf/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.4/src/../asm/inline.rs:181:5
2: cortex_m::asm::udf
at /home/lulf/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.4/src/asm.rs:43:5
@lulf
lulf / shared.rs
Last active May 16, 2022 08:26
Shared tcp stack traits
/// Documentation
pub trait TcpClient: embedded_io::Io {
/// Documentation
type TcpConnection<'m>: Read + Write + Close
where
Self: 'm;
/// Future returned by `connect` function.
type ConnectFuture<'m>: Future<Output = Result<Self::TcpConnection<'m>, Self::Error>> + 'm
where
@lulf
lulf / commands.sh
Created February 9, 2022 10:08
Add file
cd /home/lulf/dev/drogue-iot/burrboard/firmware
git pull --rebase
git add src/firmware.rs
git commit -m 'Add missing file'
git push
use cortex_m_rt::entry;
use embassy_stm32::{
gpio::{Input, Level, Output, Pull, Speed},
interrupt,
};
#[entry]
fn main() -> ! {
let p = embassy_stm32::init(Default::default());
let mut led = Output::new(p.PB14, Level::Low, Speed::VeryHigh);
import serial
import sys
ser = serial.Serial('/dev/ttyUSB0', 115200, timeout = 2) # open first serial port
print("Using", ser.portstr) # check which port was really used
count = 0
while True:
ser.write(b"PING\n") # write a string