Skip to content

Instantly share code, notes, and snippets.

View imneonizer's full-sized avatar
:octocat:
Developing for the python community!

Nitin Rai imneonizer

:octocat:
Developing for the python community!
View GitHub Profile
import av
import cv2
import numpy as np
import time
from collections import deque, OrderedDict
from threading import Thread, Lock, Event
from IPython.display import display, clear_output, Image as DispImage
class RTSPBatchDecoder:
import cv2
import av
import numpy as np
from IPython.display import display, clear_output, Image as DispImage
def imshow(frame):
"""
Display a frame inline in Jupyter; each call replaces the previous one.
No matplotlib, no ipywidgets required.
"""
@imneonizer
imneonizer / docker_ps_alias.sh
Last active September 6, 2025 10:07
docker ps output formatting for clean preview
#!/bin/bash
# Function to print colored docker ps table
print_colored_docker_ps() {
# List of readable color codes
local colors=(31 32 33 34 35 36 91 92 93 94 95 96)
declare -A project_colors
# Print table header
printf "%-12s\t%-30s\t%-40s\t%s\n" "CONTAINER ID" "NAMES" "IMAGE" "STATUS"
# usage: python crack_pdf_password.py --pdf EAadhaar.pdf --age 70
import itertools
import multiprocessing
from multiprocessing import Manager, Pool
from tqdm import tqdm
from PyPDF2 import PdfReader
import time
import threading
import argparse
@imneonizer
imneonizer / pc_power_button.ino
Last active July 26, 2025 15:44
PC Power Button
// Wiring Diagram
// Motherboard Power LED Header
// +-----------------------+
// | |
// | [ + ] ─────┬───[1kΩ]──┬──→ D1 (GPIO5 on ESP)
// | | |
// | | [10kΩ]
// | | |
// | GND |
// | | ↓
@imneonizer
imneonizer / reactStateManagement.jsx
Last active February 19, 2025 15:27
Automatic State Management in Next JS / React JS without any predefined schema.
// YT Tutorial: https://youtu.be/im3rWaN_2Qo
import { useReducer } from "react";
const readObject = (obj, path) => {
let val = null;
if (path.includes(".")) {
path
.split(".")
.map((path) => (val = val ? val[path] || null : obj[path] || null));
return val;
@imneonizer
imneonizer / detect_medimtx_stream_availability.js
Created March 8, 2024 08:17
Check if the stream served by mediamtx is available (paste it in the console window in browser for that stream)
// Find the video element that is supposed to play the stream
const videoElement = document.querySelector('video');
if (videoElement) {
const stream = videoElement.srcObject;
// Check if the stream is available and active
if (stream instanceof MediaStream && stream.active) {
// Get video tracks from the stream
const videoTracks = stream.getVideoTracks();
@imneonizer
imneonizer / .vscode_settings.json
Created May 7, 2023 17:35
Python black formatter vs code settings
{
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"python.formatting.blackPath": "<path-to-black-formatter>"
}
@imneonizer
imneonizer / docker-compose-test-gpu.yml
Last active May 7, 2023 15:02
Nvidia GPU test using docker-compose
version: "3.8"
services:
app:
image: nvidia/cuda:11.6.2-base-ubuntu20.04
command: nvidia-smi
deploy:
resources:
reservations:
devices:
@imneonizer
imneonizer / OpenCVMedia.py
Created April 18, 2023 14:52 — forked from kueblert/OpenCVMedia.py
aiortc opencv webcam stream
import asyncio
import fractions
import logging
import threading
import time
from typing import Optional, Set, Tuple
import av
from av import AudioFrame, VideoFrame
from aiortc.mediastreams import AUDIO_PTIME, MediaStreamError, MediaStreamTrack