Skip to content

Instantly share code, notes, and snippets.

View lawik's full-sized avatar

Lars Wikman lawik

View GitHub Profile
@lawik
lawik / gist:df61c7d37939df1258a67fa4b7573a49
Last active February 6, 2025 08:04
VAD Silero Membrane Elixir
Mix.install([
{:ortex, "== 0.1.9"},
:req,
{:nx, "== 0.7.0"},
{:membrane_core, "~> 1.0"},
{:membrane_file_plugin, "~> 0.17.0"},
{:membrane_portaudio_plugin, "~> 0.19.2"},
{:membrane_ffmpeg_swresample_plugin, "~> 0.20.2"},
{:membrane_mp3_mad_plugin, "~> 0.18.3"},
{:membrane_mp3_lame_plugin, "~> 0.18.2"}
@lawik
lawik / gist:c3d6417b23ff77366edf9b228682d9df
Created August 20, 2024 09:45
Brutal kioskboard injection
(function(a,b){"function"==typeof define&&define.amd?define([],function(){return b(a)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=b(a):a.KioskBoard=b(a)})("undefined"==typeof global?"undefined"==typeof window?this:window:global,function(a){'use strict';if("undefined"!=typeof a||"undefined"!=typeof a.document){var b,c,d=function(){return"#KioskBoard-VirtualKeyboard{box-sizing:border-box!important;position:fixed;z-index:2000;width:100%;max-width:1440px;background:#e3e3e3;background:linear-gradient(to right bottom,#eee,#ebebeb,#e8e8e8,#e6e6e6,#e3e3e3);-webkit-box-shadow:inset 1px 1px 0 rgba(255,255,255,.25),0 0 20px -8px rgba(0,0,0,.15);box-shadow:inset 1px 1px 0 rgba(255,255,255,.25),0 0 20px -8px rgba(0,0,0,.15);padding:25px 20px 20px;left:0;right:0;margin:auto}#KioskBoard-VirtualKeyboard.kioskboard-placement-bottom{top:unset;bottom:0;border-radius:10px 10px 0 0}#KioskBoard-VirtualKeyboard.kioskboard-placement-top{top:0;bottom:unset;border-radius:0 0 10px 10px}#KioskBoard-VirtualK
@lawik
lawik / console
Created July 7, 2024 20:15
RPi CM4 secure boot init panic :)
RPi: BOOTLOADER release VERSION:e608a69d DATE: 2024/04/15 TIME: 14:12:14
BOOTMODE: 0x06 partition 0 build-ts BUILD_TIMESTAMP=1713186734 serial 2f2a72cf boardrev b03141 stc 477024
PM_RSTS: 0x00001000
part 00000000 reset_info 00000000
uSD voltage 3.3V
Initialising SDRAM 'Samsung' 16Gb x1 total-size: 16 Gbit 3200
DDR 3200 0 0 16 152
Boot mode: SD (01) order f2564
@lawik
lawik / gist:82c52aa8b02d3f3ed9a85d66b677a9a9
Last active July 7, 2024 15:07
RPi4 Secure Boot Kernel Panic, again
RPi: BOOTLOADER release VERSION:e608a69d DATE: 2024/04/15 TIME: 14:12:14
BOOTMODE: 0x06 partition 0 build-ts BUILD_TIMESTAMP=1713186734 serial 2f2a72cf boardrev b03141 stc 477024
PM_RSTS: 0x00001000
part 00000000 reset_info 00000000
uSD voltage 3.3V
Initialising SDRAM 'Samsung' 16Gb x1 total-size: 16 Gbit 3200
DDR 3200 0 0 16 152
Boot mode: SD (01) order f2564
SD HOST: 200000000 CTL0: 0x00800000 BUS: 400000 Hz actual: 390625 HZ div: 512 (256) status: 0x1fff0000 delay: 276
@lawik
lawik / live_live.ex
Created January 16, 2024 14:00
Membrane live streaming, old stream files
defmodule UnderjordWeb.LiveLive do
use UnderjordWeb, :live_view
@impl true
def mount(%{"name" => name}, session, socket) do
index_path = Path.join(["/livestream", name, "index.m3u8"])
local_path = Path.join("priv/static/", index_path)
started? = case File.stat(local_path) do
{:ok, _} -> true
_ -> false
@lawik
lawik / init.vim
Created September 27, 2021 05:15
set hidden
set hlsearch
set mouse=a
set wildignorecase
set wildmenu
set wildmode=longest,list,full
set signcolumn=yes
set tabstop=4
set expandtab
set shiftwidth=4
@lawik
lawik / gist:5109f622c317c1584aaa353c8ad27c35
Created August 19, 2018 12:41
Cocoa chocolate cake - Very filling
1 dl wheat flour
1/2 dl coconut flour
1 dl cane sugar (called raw cane sugar in swedish)
1 dl coconut sugar
3-4 tablespoons, cocoa powder
1-2 dl oat cream (or some similar cream replacement, soy might work)
100 gram dark chocolate (70% or more is often vegan, cocoa butter is vegan)
100 gram coconut oil
1 teaspoon, vanilla powder (the stuff from vanilla beans)
1 teaspoon, baking soda/powder (the one that is not pure bicarbonate, not sure of translation)
@lawik
lawik / client.py
Last active October 6, 2015 07:32
Grossly simplified client
from newrelic import agent as nr
class ReqRepClient(object):
def send(self, tracking_id, method, data):
transaction = nr.current_transaction()
with nr.ExternalTrace(transaction, 'reqrep', url=self.server_endpoint, method=method):
return self._send(tracking_id, method, data)
def _send(self, tracking_id, method, data):
pass