Skip to content

Instantly share code, notes, and snippets.

View amotl's full-sized avatar

Andreas Motl amotl

  • $PYTHONPATH
View GitHub Profile
@amotl
amotl / README.rst
Last active October 2, 2019 10:40
HTTP PUT file uploads from Shaka Packager to Nginx
@amotl
amotl / one-minor-glitch.rst
Last active November 8, 2018 23:38
Issues with HTTP PUT file uploads from Shaka Packager to Nginx

One minor glitch

Problem

While everything seems to be fine with .m3u8 and .aac uploads, all .ts video files end up on the server with zero length.

Investigation

@amotl
amotl / Caddyfile
Last active April 14, 2022 13:23
HTTP PUT file uploads from Shaka Packager to Caddy
#
# Caddy HTTP configuration for HTTP upload and beyond
#
# Documentation:
#
# https://caddyserver.com/docs/http-caddyfile
# https://caddyserver.com/docs/root
# https://caddyserver.com/docs/browse
# https://caddyserver.com/docs/http.upload
#
@amotl
amotl / 01-requests-only.txt
Last active January 31, 2019 02:51
Shaka Packager HTTP upload logs showing unordered output
[0130/005457:VERBOSE1:http_file.cc(170)] Sending request to URL http://media.example.org/upload/6029-video-480-0024.ts
[0130/005502:VERBOSE1:http_file.cc(170)] Sending request to URL http://media.example.org/upload/6029-video-720.m3u8
[0130/005502:VERBOSE1:http_file.cc(170)] Sending request to URL http://media.example.org/upload/6029.m3u8
[0130/005503:VERBOSE1:http_file.cc(170)] Sending request to URL http://media.example.org/upload/6029-video-720-0017.ts
[0130/005510:VERBOSE1:http_file.cc(170)] Sending request to URL http://media.example.org/upload/6029-video-480.m3u8
[0130/005510:VERBOSE1:http_file.cc(170)] Sending request to URL http://media.example.org/upload/6029.m3u8
[0130/005511:VERBOSE1:http_file.cc(170)] Sending request to URL http://media.example.org/upload/6029-video-480-0025.ts
[0130/005514:VERBOSE1:http_file.cc(170)] Sending request to URL http://media.example.org/upload/6029-video-480.m3u8
[0130/005515:VERBOSE1:http_file.cc(170)] Sending request to URL http://media.example.org/upload/6029.m3u8
[
@amotl
amotl / i2s-recorder-basic.ino
Last active April 15, 2022 15:50
Basic audio recorder for ARM Cortex-M0 and ICS43432 I2S microphone
/**
*
* Basic I2S recorder
* Based on wjmb's Feather M0 Beehive LoRa code
*
* Minimum example for trying to reproduce problems when
* reading the ICS43432 using I2S without using TTN at all.
*
* License: GPL
*
@amotl
amotl / 01-build-summary.txt
Last active May 13, 2021 13:30
HX711 library spring cleaning
offgrid:HX711 amo$ make build-all
Environment atmega [SUCCESS]
Environment feather_328 [SUCCESS]
Environment huzzah [SUCCESS]
Environment lopy4 [SUCCESS]
Environment feather_m0 [SUCCESS]
Environment feather_m4 [SUCCESS]
Environment bluepill [SUCCESS]
@amotl
amotl / minimal-websocket-plus.py
Last active March 11, 2019 18:22
Minimal websocket server partly based on the "Mode" library
#!/usr/bin/env python3
# Based on https://mode.readthedocs.io/ - thanks, Ask!
import asyncio
import websockets
from mode import Service
class MainService(Service):
async def on_start(self) -> None:
print('Im starting now')
@amotl
amotl / dynamic-callable.py
Created March 11, 2019 18:21
Dynamic method callable with Python
#!/usr/bin/env python
class Acme:
def add_foo(self):
print("Adding foo")
def add_bar(self):
print("Adding bar")
@amotl
amotl / README.md
Last active March 18, 2019 18:46
USPTO PatFT direct access test

USPTO PatFT direct access test

Purpose: Check direct unwalled access to USPTO PatFT worldwide.

@amotl
amotl / transcode-nicer.sh
Created March 18, 2019 20:13
Increase scheduling priority for ffmpeg and packager processes
#!/bin/bash
# https://www.tecmint.com/set-linux-process-priority-using-nice-and-renice-commands/
processnames="ffmpeg packager"
niceness="-10"
for name in $processnames; do
echo "Renicing $name"
pids=$( pidof $name )
for pid in $pids; do