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
# 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

Install aria2c:

sudo apt install aria2 -y

Use below command to utilize full bandwidth:

aria2c --file-allocation=none -c -x 10 -s 10 -d "mydir" URL --check-certificate=false

-c allows continuation of download if it gets interrupted, -x 10 and -s 10 allow up to 10 connections per server, and -d "mydir" outputs file to directory mydir.

import torch
import torchvision
from torchvision import transforms
from torch.utils.data import DataLoader
data_path = './Archive_jpg/'
transform_img = transforms.Compose([
transforms.Resize((480, 640)),
# transforms.CenterCrop(256),
import redis
import fakeredis
import ujson
from contextlib import suppress
class RedisClient:
def __init__(self, host=None, port=6379, db=0, prefix='libtorrent'):
self.prefix = prefix
self.host = host