Skip to content

Instantly share code, notes, and snippets.

View lattice0's full-sized avatar
🦀

Lattice 0 lattice0

🦀
View GitHub Profile
@jpouellet
jpouellet / qvm-port-forward.sh
Last active February 1, 2024 12:50
Forwards a specified port to a specified VM, auto-detecting its NetVM chain. (Qubes OS)
#!/bin/sh
# Inspired by https://gist.github.com/daktak/f887352d564b54f9e529404cc0eb60d5
ip() { qvm-ls --raw-data ip -- "$1"; }
netvm() { qvm-prefs -g -- "$1" netvm; }
forward() {
local from_domain=$1
local to_domain=$2
@crearo
crearo / fragment_shader_NV12_to_RGB.frag
Last active December 5, 2025 13:35
A fragment shader to convert NV12 to RGB.
/** A fragment shader to convert NV12 to RGB.
* Input textures Y - is a block of size w*h.
* texture UV is of size w*h/2.
* Remember, both U and V are individually of size w/2*h/2, but they are interleaved.
* The layout looks like this :
* ----------
* | |
* | Y | size = w*h
* | |
* |________|
@DD3Boh
DD3Boh / gist:6c51fd3c5f91b1042e956771483714de
Created July 19, 2017 14:59
How to merge a newer CAF tag in an android kernel
First go here:
https://wiki.codeaurora.org/xwiki/bin/QAEP/release
This site gives information about all msm soc release details with tag + android version
Search your msm here.. Check the latest one and look for correct android version and mark that tag.
Now open one of the following links (dependent on your linux kernel version)
@Jim-Bar
Jim-Bar / YUV_formats.md
Last active September 10, 2026 11:24
About YUV formats

About YUV formats

First of all: YUV pixel formats and Recommended 8-Bit YUV Formats for Video Rendering. Chromium's source code contains good documentation about those formats too: chromium/src/media/base/video_types.h and chromium/src/media/base/video_frame.cc (search for RequiresEvenSizeAllocation(), NumPlanes() and those kinds of functions).

YUV?

You can think of an image as a superposition of several planes (or layers in a more natural language). YUV formats have three planes: Y, U, and V.

Y is the luma plane, and can be seen as the image as grayscale. U and V are reffered to as the chroma planes, which are basically the colours. All the YUV formats have these three planes, and differ by the different orderings of them.

@XueshiQiao
XueshiQiao / h264format.md
Last active June 8, 2025 22:39
H.264 Annex B format and AVCC format

AnnexB format:

([start code] NALU) | ( [start code] NALU) |

AVCC format:

([extradata]) | ([length] NALU) | ([length] NALU) |
@lattice0
lattice0 / gist:c23561ff62af5647c4ac0f3d8d26a739
Last active March 28, 2024 06:29
Vstarcam raspberry pi IP finder and HTTP port
#Give an IP address in the range of the camera to the eth0 interface
sudo ip address add 192.168.1.133/24 dev eth0
#First, scan the eth0 interface to find all the IPs connected to it
nmap -e eth0 192.168.1.0/24
#Now that you found the camera's IP, scan which ports are open to find the HTTP port (suupose the IP is ...189)
nmap -e eth0 192.168.1.104 -p 0-65535
#SSH and foward the HTTP port of the discovered camera

OK, so today I was looking at Writer monad, a very basic Monad.

In its essence, it's just a Monad that outputs (e.g. log) something,
The "Variation three: Output" Monad from the original Monads for functional programming, 92 paper is very lean:

type M a = (Output, a)
type Output = String
@alexishida
alexishida / referencia_rtsp_cameras_dvr_nvr.md
Last active September 1, 2026 04:44
RTSP dvr intelbras e outros para acesso direto home assistant

Referência RTSP para Câmeras IP, DVRs e NVRs

Documento consolidado de endpoints RTSP conhecidos para câmeras IP, DVRs e NVRs.

Importante: endpoints RTSP podem variar conforme modelo, linha, OEM, firmware e região. Não assuma que um endereço funciona para todos os equipamentos de uma mesma marca.


Tabela-resumo RTSP

@flowolf
flowolf / README.md
Last active September 17, 2025 04:31
Homeassistant Samsung smart TV IR codes

Homeassistant IR codes for Samsung Smart TV

IR codes came from here

code was adapted from here

run:

python3 ir_codes.py ./samsung_tv_codes.csv