Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
ALBUMS="claatin1 claatin2 claatin3 allboommm1 allboommm2 silver dancecore"
JS_PREAMBLE="\
var Amplitude = {}; \
Amplitude.init = (x) => { console.log(JSON.stringify(x)) }; \
"
for ALBUM in $ALBUMS ; do
@strfry
strfry / gist:422b83f7d6e695c9bc1d55f3b4d2a6d1
Last active April 13, 2024 19:31
v4l2loopback example
#!/bin/sh -e
# Dependencies
apt install -y v4l2loopback-dkms v4l2loopback-utils gstreamer1.0-plugins-good
apt install -y gstreamer1.0-plugins-bad # h264parse
apt install -y gstreamer1.0-libav # H.264
# Reset module state
modprobe -r v4l2loopback
modprobe v4l2loopback

How to create a Wake-on-LAN API Endpoint with OpenWRT LuCI

Disclaimer

I'm stuck on OpenWRT 18.06, and these info may soon be obsoleted by newer versions, and/or the more detailed ACL scheme in LuCI2.

Motivation

The motivation So i have this server at home, that serves http://hq.strfry.org , which i sometimes switch off at night.

@strfry
strfry / README.md
Last active April 10, 2024 13:21
Deploys FreeBSD on a Hetzner cloud server

Deploys FreeBSD on a Hetzner cloud server

Prerequisites:

  • A Hetzner Cloud API Token (Pass in via APIKEY)
  • jq
  • sshpass

Usage

Replace server_id variable with your hetzner server Id
; 8086 Snek
;
; Based on Invaders in 512 bytes by Oscar Toledo G. (c) Copyright 2015-2019 Oscar Toledo G.
; https://github.com/nanochess/Invaders
;
; Using PUSHA and POPA the code can be smaller, not enabled by
; default.
;
%ifndef pure8088 ; Define as 0 to create a 80186/80286 binary


This October the Tox developer community will be holding it's third annual Conference in the @metalabvie in the heart of Vienna, Austria.
The Event will be 3 full days, from Friday 11th October to Sunday 13th October.

We will talk about Tox, and other security related and interesting topics.
If you would like to attend, meet the Tox devs, do some live hacking, or just socialize, get your free ticket (and reserve a T-shirt) here:
  https://pretix.eu/ZMetalab/ToxCon2019/
You can find the exact address on your ticket!

module brimmed_text(txt, font, width) {
linear_extrude(4)
text(txt, font=font, size=33);
translate([0, 0, 3.9])
linear_extrude(0.1)
square([width, 5]);
@strfry
strfry / example_basic_2.c
Created January 7, 2019 22:29
RPi mmal decode example, modified for latency measurement
// compile: cc example_basic_2.c -I /opt/vc/include -I /opt/vc/include/interface/vcos/pthreads -I /opt/vc/include/interface/vmcs_host/linux -I /opt/vc/src/hello_pi/libs/ilclient -I /opt/vc/include/interface/mmal/ -L /opt/vc/lib -lmmal -lmmal_core -lmmal_components -lmmal_util -lmmal_vc_client -lvcos -lpthread -lbcm_host -lm
// run: ./a.out /opt/vc/src/hello_pi/hello_video/test.h264
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
mkdir -p /tmp/alpine
sudo apk --root /tmp/alpine --initdb add --repositories-file=/etc/apk/repositories --keys-dir /etc/apk/keys/ --cache-dir /var/cache/apk alpine-base
sudo mount -o bind /proc [/tmp/alpine/proc/](file:///tmp/alpine/proc)
sudo cp /etc/apk/repositories /etc/apk/keys/ /tmp/alpine/etc/apk/
sudo cp [/etc/resolv.conf](file:///etc/resolv.conf) /tmp/alpine/etc
apk add alpine-sdk git autoconf automake libtool motif-dev flex bison
git clone <https://www-soc.lip6.fr/git/alliance.git>
cd alliance/alliance/src && [./autostuff](file:///home/strfry/Notebooks/Notes/C3D2/LibreSilicon/Alliance_Tutorial/autostuff)