Skip to content

Instantly share code, notes, and snippets.

View r41d's full-sized avatar

Lennart Buhl r41d

View GitHub Profile
deb http://deb.debian.org/debian stretch main
deb-src http://deb.debian.org/debian stretch main
deb http://deb.debian.org/debian-security/ stretch/updates main
deb-src http://deb.debian.org/debian-security/ stretch/updates main
deb http://deb.debian.org/debian stretch-updates main
deb-src http://deb.debian.org/debian stretch-updates main
# Dependencies:
# 1. Repo: https://github.com/adafruit/Adafruit_CircuitPython_HID
# Install: copy adafruit_hid folder to lib/ folder on the Pi Pico
# 2. Repo: https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel
# Install: copy neopixel.py folder to lib/ folder on the Pi Pico
import time
import board
import digitalio
from neopixel import NeoPixel
import usb_hid
@r41d
r41d / MPextract.sh
Last active July 30, 2025 15:10
Scripts for handling Google Pixel MotionPicture files
#!/bin/bash
for mp in `ls -1 PXL_*.MP.jpg`; do
# Find out where in the file the video part starts
# old string: "\x00\x00\x00\x18\x66\x74\x79\x70\x6d\x70\x34\x32"
extractposition=$(grep --binary --byte-offset --only-matching --text -P "\x00\x00\x00\x1c\x66\x74\x79\x70\x69\x73\x6f\x6d" $mp | sed 's/^\([0-9]*\).*/\1/')
# Extract the video
dd if="$mp" skip=1 bs=$extractposition of="$(basename -s .jpg $mp).mp4"
done