This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set up a Raspberry Pi 4 as a USB-C Ethernet Gadget | |
# Based on: | |
# - https://www.hardill.me.uk/wordpress/2019/11/02/pi4-usb-c-gadget/ | |
# - https://pastebin.com/VtAusEmf | |
if ! $(grep -q dtoverlay=dwc2 /boot/config.txt) ; then | |
echo "Add the line dtoverlay=dwc2 to /boot/config.txt" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Requires 'media-ctl' to parse the media devices | |
# Requires 'dot' to generate the media-graph png files. | |
# Identify all V4L2 devices | |
for v in /sys/class/video4linux/{v4l,video}*; | |
do | |
vn=`basename $v` | |
name=`cat $v/name` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Stop on errors | |
set -e | |
function build() { | |
echo "Building for $1" | |
export BUILDDIR=build-$1 | |
export CC=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# We default to enabling the most debug | |
# (that's why we're being used right) | |
FILTER="*" | |
LEVEL="0" | |
while [[ $# -gt 0 ]] | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
*/ | |
/ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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 @@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tracking cursor position in real-time without JavaScript | |
// Demo: https://twitter.com/davywtf/status/1124146339259002881 | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"strings" | |
) |