Skip to content

Instantly share code, notes, and snippets.

From 52d57cf70ca70f55378112f6eeb5708fb7680a6b Mon Sep 17 00:00:00 2001
From: stephematician <[email protected]>
Date: Wed, 19 Mar 2025 13:59:21 +1100
Subject: [PATCH] linux-v4l2: Fix virtual camera start failure
Add function that tries to reset v4l2loopback output for module versions
from 0.12.5 to 0.12.7. If successful, then set flag that STREAMON and
STREAMOFF are necessary each time the device is opened/closed.
---
plugins/linux-v4l2/v4l2-output.c | 57 ++++++++++++++++++++++++++++++--
@GingerGraham
GingerGraham / bash_logging.md
Last active October 11, 2025 04:42
Bash Logging

Bash Logging Module

A flexible, reusable logging module for Bash scripts that provides standardized logging functionality with various configuration options.

Features

  • Standard syslog log levels (DEBUG, INFO, WARN, ERROR, CRITICAL, etc.)
  • Console output with color-coding by severity
  • Optional file output
  • Optional systemd journal logging
@mkpolkowski
mkpolkowski / CountYoutubeVideosTime.js
Last active February 12, 2025 18:00 — forked from RafalJDev/CountYoutubeVideosTime.js
Count all videos time duration on youtube channel
//You need to run this in javascript console inside chrome
//Assumptions:
//1. Will count only "expanded" videos on page, you may first need to run script to scroll to last video or do it manually
//2. Tested on chrome, ubuntu, 2019
//3. Time format: hh:mm:ss
// Assuming you have your domlists as an array-like object
const domlists = document.querySelectorAll("ytd-rich-item-renderer");
@brayevalerien
brayevalerien / monokai.md
Last active October 21, 2025 22:21
Monokai theme color codes

Monokai theme color codes

Intro

This document lists the colors used in the Monokai Pro theme with the Classic filter. Please check the Monokai Pro website for more informations.

Colors

Monokai Pro with Classic filter colors:

Preview Hexadecimal RGB
Activity Bar Background activity bar background preview #272822 (39, 40, 34)
Activity Bar Foreground activity bar foreground preview #f8f8f2 (248, 248, 242)

A metatable in Lua defines various extraneous behaviors for a table when indexed, modified, interacted with, etc. They are Lua's core metaprogramming feature; most well known for being useful to emulate classes much like an OOP language.

Any table (and userdata) may be assigned a metatable. You can define a metatable for a table as such:

-- Our sample table
local tab = {}
-- Our metatable
local metatable = {
 -- This table is then what holds the metamethods or metafields
@sopa0
sopa0 / linux_lutemod.md
Last active February 3, 2025 22:13
Running Lutemod on Linux with Proton

Running the Lutemod on Linux and Proton

Installing the Lutemod

Visit this page and download the clientside-mod-autoloader

You should receive a file named similarly to zz_clientmodloadingmap_425.zip

Unzip the contents of the archive, you should be getting a file named zz_clientmodloadingmap_425.pak

@jirihnidek
jirihnidek / flock_example.py
Created June 21, 2021 13:56
File locking using fcntl.flock using Python
"""
Example of using fcntl.flock for locking file. Some code inspired by filelock module.
"""
import os
import fcntl
import time
def acquire(lock_file):
@un-def
un-def / luaversion.lua
Last active July 21, 2025 07:36
A simple function to detect Lua version
local luaversion = function()
if ({false, [1] = true})[1] then -- luacheck: ignore 314
return 'LuaJIT'
elseif 1 / 0 == 1 / '-0' then
return 0 + '0' .. '' == '0' and 'Lua 5.4' or 'Lua 5.3'
end
local f = function() return function() end end
return f() == f() and 'Lua 5.2' or 'Lua 5.1'
end
@ansemjo
ansemjo / aur-package-hooks.md
Last active April 30, 2025 20:04
Git hooks for AUR package repositories to test your PKGBUILD before pushing.

AUR package hooks

These hooks are meant to be used in Git repositories that track PKGBUILD files for the Arch User Repository. Place them in .git/hooks/pre-{commit|push} and make sure they're executable.

pre-commit

This hook simply updates the .SRCINFO before every commit by running:

@ArtBIT
ArtBIT / GRUB_INIT_TUNE.md
Last active October 5, 2025 06:37
A collection of GRUB init tunes