Skip to content

Instantly share code, notes, and snippets.

@moritzmhmk
moritzmhmk / NodeOnPiZero.md
Created June 10, 2019 13:37
Install Node On Raspberry Pi Zero (armv6)

Find the latest LTS release. Currently the LTS version is 10.x and the latest release can be found here (choose the file ending with -linux-armv6l.tar.xz).

Download that file: wget https://nodejs.org/dist/latest-v10.x/node-v10.16.0-linux-armv6l.tar.xz

Unpack the file: tar -xvf node-v10.16.0-linux-armv6l.tar.xz

Copy the content over to /usr/local: sudo cp -r node-v10.16.0-linux-armv6l/* /usr/local/

@moritzmhmk
moritzmhmk / Monokai.terminal
Created April 14, 2018 11:27
Monokai macOS Terminal Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlueColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECYw
LjIxOTYwNzg0MzEgMC40NzQ1MDk4MDM5IDAuOTM3MjU0OTAyABABgALSEBESE1okY2xh
c3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiEhRYTlNPYmplY3RfEA9OU0tleWVkQXJjaGl2
@moritzmhmk
moritzmhmk / Config.in
Created March 21, 2018 20:43
python-evdev buildroot
config BR2_PACKAGE_PYTHON_EVDEV
bool "python-evdev"
help
Bindings to the Linux input handling subsystem.
https://github.com/gvalkov/python-evdev
$fn=64;
difference() {
cylinder(r=15, h=3, center=true);
difference() {
cylinder(r=15-2.5, h=40, center=true);
cylinder(r=15-2.5-4.5, h=40, center=true);
rotate([0,0,0]) translate([15/2,0,0]) cube([15,30,40], center=true);
rotate([0,0,180+110]) translate([15/2,0,0]) cube([15,30,40], center=true);
}
@moritzmhmk
moritzmhmk / stm32f103c8t6.lib
Created January 18, 2018 23:34
STM32F103C8T6 KiCad
EESchema-LIBRARY Version 2.3
#encoding utf-8
#
# STM32F103C8T6
#
DEF STM32F103C8T6 U 0 40 Y Y 1 F N
F0 "U" 200 0 60 H V C CNN
F1 "STM32F103C8T6" 0 0 60 H V C CNN
F2 "" 200 0 60 H I C CNN
F3 "" 200 0 60 H I C CNN
@moritzmhmk
moritzmhmk / rpi_camera_v4l2_ffmpeg.md
Last active December 17, 2024 12:05
using raspberry pi camera with ffmpeg (hardware accelerated)

Using Raspberry Pi Camera with ffmpeg

Capturing video from the rpi camera with ffmpeg can vary from less than 5% to 100% of the CPU (rpi zero) depending on ffmpeg using the hardware acceleration or not.

On many github issues one finds the suggestion of using h264_omx codec to use the gpu - but it does not ship with the default ffmpeg on Raspbian.

Instead I found that one can use the v4l2 driver provided by raspbian to get hardware accelerated h264 output. Also setting the video size will save one from using a (cpu) scale filter.

ffmpeg

capture h264 video from rpi camera

#include <Wire.h>
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
#include <LiquidCrystal_I2C.h>
// addr, En, Rw, Rs, d4, d5, d6, d7, backlight, backlighPolarity
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, 0); // Set the LCD I2C address
void setup()
{
pinMode(A2, OUTPUT);
@moritzmhmk
moritzmhmk / miniDV.md
Created April 14, 2017 18:12
miniDV conversion

read and print recorded date

for i in "$@"
do
	echo $i `mediainfo "$PWD/$i" | grep "Recorded date"`
done

concat multiple files