Skip to content

Instantly share code, notes, and snippets.

@dafta
dafta / usb-ether.sh
Last active September 13, 2024 22:23
Steam Deck USB Ethernet
#!/bin/sh
if [ "$UID" -ne 0 ]; then
echo "This script needs to be executed as root"
exit 1
fi
vendor_id="0x3000" # Valve
product_id="0x28DE"
serial_number="$(dmidecode -s system-serial-number)" # The Steam Deck's serial number
@justinschuldt
justinschuldt / raspberry-pi-zero_as_webcam.md
Last active November 4, 2024 13:41
Directions for setting up a RaspberryPi to act as a generic USB webcam

hardware/software

Webcam parts:

  • Raspberry Pi Zero W Rev 1.1
  • Raspberry Pi Camera v2 (8-megapixel)
  • Raspberry Pi High Quality Camera (12.3-megapixel)
  • Raspbian Buster Lite 2020-02-13

Webcam works with:

  • Windows 10
  • Windows 10 "Camera" app
@atomkirk
atomkirk / ios-camera.html
Created March 13, 2020 04:49
iOS Safari Camera API
<video id="player" autoplay muted playsinline> </video>
<button id="capture">Capture</button>
<canvas id="canvas" width=320 height=240></canvas>
<script>
const player = document.getElementById('player');
const canvas = document.getElementById('canvas');
const context = canvas.getContext('2d');
const captureButton = document.getElementById('capture');
const constraints = {
#include "Arduino.h"
#include "esp_camera.h"
#include "ESPAsyncWebServer.h"
typedef struct {
camera_fb_t * fb;
size_t index;
} camera_frame_t;
#define PART_BOUNDARY "123456789000000000000987654321"
@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"
@alexellis
alexellis / k8s-pi.md
Last active September 24, 2024 14:36
K8s on Raspbian
@mattandneil
mattandneil / build.xml
Last active November 14, 2022 18:18
Salesforce Organization Destroy - Ant Script
<macrodef name="destroy" description="Destroys all metadata in an organization - Revision 23">
<attribute name="username" />
<attribute name="password" />
<attribute name="serverurl" default="https://login.salesforce.com" />
<attribute name="tempDir" default="temp/destroy" description="Directory to write metadata." />
<attribute name="apiVersion" default="43.0" />
<sequential>
@birkir
birkir / gps-plugin.js
Last active February 11, 2020 21:57
GPS Plugin for BMW ibus interface
/**
* This plugin will emit events with GPS coordinates
*
* const gps = new GPSPlugin();
* gps.on('gps', ({ lat, lng, alt }) => console.log(lat, lng, alt));
* MINI.addPlugin(gps);
*/
class GPSPlugin {
/**
#!/bin/bash
set -e
# Send a private message to someone on slack
# from the command line.
# Print a usage message and exit.
usage(){
local name=$(basename "$0")
@DirectXMan12
DirectXMan12 / ansi_print.py
Last active July 31, 2024 17:46
ANSI Escape Sequences Tester
from __future__ import print_function
import sys
import six
import contextlib
import os
try:
from __builtin__ import raw_input
except ImportError: