Skip to content

Instantly share code, notes, and snippets.

View theSoberSobber's full-sized avatar
🐢

Pavit Chhabra theSoberSobber

🐢
View GitHub Profile
@theSoberSobber
theSoberSobber / Slide Extractor Try By Clustering [Workflow]
Created November 4, 2024 11:21
Trying Slide Extraction by Clustering on Clip Embeddings in Embeddings Space
yt-dlp https://www.youtube.com/watch?v=6T46sgty4Mk -o test-2
mkdir img
git clone https://github.com/LexCybermac/smlr
ffmpeg -i test-2.mp4 -vf "fps=1" img/frame_%04d.png
pip install torch torchvision numpy Pillow transformers tqdm pathlib annoy scipy
python .\smlr.py --image_directory .\img\ --clip_model openai/clip-vit-base-patch16 --threshold 0.22 --batch_size 192
Or (didn't try)
https://colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/image_embeddings_analysis_part_1.ipynb
@theSoberSobber
theSoberSobber / reddit-acronyms.csv
Created January 14, 2025 06:31
Reddit Acronyms
Acronym Full Form
AFAIK As Far As I Know
AMA Ask Me Anything
CMV Change My View
DAE Does Anyone Else
ELI5 Explain Like I'm 5
ETA Edited To Add
FTFY Fixed That For You
FWIW For What It's Worth
IANAD I Am Not A Doctor
@theSoberSobber
theSoberSobber / Redis Locks Weird Service.js
Last active February 10, 2025 21:03
A is supposed to be someone that generates a resource and requests it to perform an action, A waits min (max of TTL, write lock acquiring time , message to quit), B is an ack verification from the resource of a task so A stops requesting more resources, C is a service that forcefully says that A should stop and the task is done, it reads the las…
import { Injectable, OnModuleInit } from '@nestjs/common';
import { InjectRedis } from '@liaoliaots/nestjs-redis';
import { Redis } from 'ioredis';
import { v4 as uuidv4 } from 'uuid';
@Injectable()
export class RedisService implements OnModuleInit {
private redisSubscriber: Redis;
constructor(@InjectRedis() private readonly redis: Redis) {}
@theSoberSobber
theSoberSobber / fetch-spy.js
Created April 6, 2025 08:22
Fetch Spy: Monkey Patching Fetch, Import at the top before using any fetch or using any Lib that uses fetch to inspect it's network requests
import { writeFileSync } from "fs";
const originalFetch = globalThis.fetch.bind(globalThis);
function safeStringifyDeep(obj, seen = new WeakSet()) {
if (obj === null || typeof obj !== 'object') return obj;
if (seen.has(obj)) return "<<Circular>>";
seen.add(obj);
@theSoberSobber
theSoberSobber / Android-Modding-Guide.md
Created May 26, 2025 19:55
My Guide to Decompiling and Recompiling modern apks with splits for cert pinning/check bypass and or any other modifications (smali).

APK Modification & Installation Guide

Quick reference for decompiling, patching, and reinstalling Android APKs with split configurations.

Prerequisites

  • Android SDK Build Tools installed
  • Java JDK installed
  • apktool installed
  • ADB connected to device
@theSoberSobber
theSoberSobber / passive_node_with_mempool_multiple_nodes_from_dns_seeds_ping_pong_keepalive.py
Created July 5, 2025 18:30
Fully Passive Bitcoin node that connects to the testnet peers by dns seeds and does handshake + asks for mempool + responds to ping's
import socket, time, struct, hashlib, threading
from io import BytesIO
import dns.resolver
TESTNET_MAGIC = b'\x0b\x11\x09\x07'
PORT = 18333
# DNS seeds
DNS_SEEDS = [
"testnet-seed.bitcoin.jonasschnelli.ch",
@theSoberSobber
theSoberSobber / docker-compose.yml
Created July 5, 2025 19:19
docker compose for pruned bitcoin node using bitcoind image for local usage
services:
bitcoind:
image: ruimarinho/bitcoin-core:latest
container_name: bitcoin-node
restart: always
ports:
- "8332:8332" # RPC port (keep for your scripts)
volumes:
- bitcoin-data:/home/bitcoin/.bitcoin
command: