Skip to content

Instantly share code, notes, and snippets.

View beriberikix's full-sized avatar
🐶
I have no idea what I'm doing

Jonathan Beri beriberikix

🐶
I have no idea what I'm doing
View GitHub Profile
@beriberikix
beriberikix / QEMU_cheat_sheat.md
Last active December 21, 2023 22:12
QEMU cheat sheet for the most basic setup

Create system drive

qemu-img create -f qcow2 alpine.qcow2 16G

Install image

Linux

@beriberikix
beriberikix / Dockerfile
Last active February 5, 2023 16:34
Attempts at using USB/IP VHCI in a container
FROM ubuntu:jammy
RUN \
apt update \
&& apt install -y kmod linux-tools-virtual usbutils
# docker run -it --cap-add=ALL --privileged -v /lib/modules/`uname -r`/kernel/drivers/usb/usbip:/lib/modules/`uname -r` usbip:latest
# modprobe usbip-core
# modprobe vhci-hcd
# usbip list -r <server>
# sudo usbip attach -r <server> -b <bus ID>
@beriberikix
beriberikix / oss_embedded_tools.md
Last active May 16, 2022 16:06
Open Source and source available tools for embedded
@beriberikix
beriberikix / speedrun.sh
Created October 3, 2021 23:10
Golioth speedrun with Zephyr & ESP32-C3 (RISC-V WiSOC)
#!/bin/bash
# demo scripted based on https://github.com/paxtonhare/demo-magic
########################
# include the magic
########################
. demo-magic.sh
# hide the evidence
@beriberikix
beriberikix / gist:9664a00270715605d97d0acbb260c864
Last active April 10, 2021 21:12
Crib notes for litestream on a Raspberry Pi 3
1. Flash Raspberry OS with Raspberry Pi Imager (make sure to use the [Settings](https://www.raspberrypi.org/blog/raspberry-pi-imager-update-to-v1-6/)!)
2. ssh pi@hostname.local
3. sudo apt update & sudo apt full-upgrade
4. sudo apt install sqlite
5. curl https://dl.min.io/server/minio/release/linux-arm/minio --create-dirs -o $HOME/minio-binaries/minio
6. chmod +x $HOME/minio-binaries/minio
7. export PATH=$PATH:$HOME/minio-binaries/
8. minio --help
9. export MINIO_ROOT_USER=minioadmin \
export MINIO_ROOT_PASSWORD=minioadmin \
@beriberikix
beriberikix / client.go
Created September 22, 2020 16:36
go-coap client
package main
import (
"context"
"log"
"os"
"time"
"github.com/plgd-dev/go-coap/v2/udp"
)
@beriberikix
beriberikix / coreapi-async.yaml
Last active December 17, 2021 16:05
Working samples for adapting OpenAPI/AsyncAPI for CoRE
asyncapi: 2.0.0
info:
title: Example CoREAPI based on AsyncAPI
version: 0.0.0
coreapi: 0.0.0 #!OAS
servers:
- url: '{scheme}://example.com'
variables:
scheme:
enum:
- 'coap'
- 'coaps'
- 'coap+tcp'
- 'coaps+tcp'
@beriberikix
beriberikix / gist:a827ec31f62705f13054895fa8cda0ad
Last active March 31, 2020 21:32
Knative on minikube with Kourier
export KNATIVE_VERSION="0.13.0"
# Not sure the minimum but this works for helloworld
minikube start --cpus=4 --memory=4096 --addons=ingress
# Install Knative Serving
kubectl apply --filename "https://github.com/knative/serving/releases/download/v$KNATIVE_VERSION/serving-crds.yaml"
kubectl apply --filename "https://github.com/knative/serving/releases/download/v$KNATIVE_VERSION/serving-core.yaml"
# Configure the magic xip.io DNS name
import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate {
var webView: WKWebView!
override func loadView() {
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView.uiDelegate = self