Skip to content

Instantly share code, notes, and snippets.

View kbingham's full-sized avatar

Kieran Bingham kbingham

View GitHub Profile
@kbingham
kbingham / eth.network
Created July 11, 2017 08:39 — forked from kylemanna/eth.network
How to prevent systemd-networkd from breaking nfsroots
# /etc/systemd/network/eth.network
# Pass nfsroot=... on the kernel command line as you'd expect
[Match]
Name=eth*
KernelCommandLine=!nfsroot
[Network]
DHCP=v4
[DHCPv4]
@kbingham
kbingham / uvc-gadget.sh
Created May 15, 2018 08:18
UVC ConfigFS Gadget configuration tool
#!/bin/sh
set -e
#set -x
CONFIGFS="/sys/kernel/config"
GADGET="$CONFIGFS/usb_gadget"
VID="0x0525"
PID="0xa4a2"
SERIAL="0123456789"
@kbingham
kbingham / noscript-tracking.go
Created May 7, 2019 08:18 — forked from wybiral/noscript-tracking.go
Tracking cursor position in real-time with remote monitoring (without JavaScript)
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
#/bin/bash
CONFIG_HZ=$1
# The output of timeconst.sh is parsed by sed to remove the
# following diff from each comparison
# --- BC
# +++ SH
# @@ -1,4 +1,4 @@
From:
https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/arm/96b_wistrio/96b_lscon.dtsi
/*
* Copyright (c) 2019 Linaro Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
#!/bin/sh
CONTAINER="$1"
shift
XFORWARD="-e DISPLAY=$DISPLAY.0 -v /tmp/.X11-unix:/tmp/.X11-unix"
#
# We can now run in 'arm64' containers:
# docker run -it --rm multiarch/alpine:aarch64-edge
#!/bin/sh
TARGETIP=$1
DEV=${2:-/dev/media0}
ssh $TARGETIP -o StrictHostKeyChecking=no \
-tC \
media-ctl -d $DEV --print-dot 2>/dev/null | \
grep -v bash | \
tee /tmp/$TARGETIP-mc.dot | \
@kbingham
kbingham / lcdebug
Created April 22, 2020 15:57
lcdebug wrapper helper
#!/bin/bash
# We default to enabling the most debug
# (that's why we're being used right)
FILTER="*"
LEVEL="0"
while [[ $# -gt 0 ]]
do
@kbingham
kbingham / build-all.sh
Created June 9, 2020 11:19
Multiple build script for libcamera
#!/bin/bash
# Stop on errors
set -e
function build() {
echo "Building for $1"
export BUILDDIR=build-$1
export CC=$2
@kbingham
kbingham / vimc-capture.sh
Last active August 11, 2020 10:34
Configure and capture multiple streams from VIMC
#!/bin/bash
MEDIA=/dev/$(grep VIMC /sys/bus/media/devices/media*/model | sed 's/.*\(media[0-9]*\).*/\1/g')
function v4l2_dev() {
grep "$1" /sys/class/video4linux/video*/name | sed 's#.*\(video[0-9]*\)/.*#\1#g'
}
RAW0=/dev/$(v4l2_dev "Raw Capture 0")
RAW1=/dev/$(v4l2_dev "Raw Capture 1")