Skip to content

Instantly share code, notes, and snippets.

View kholia's full-sized avatar
🎯
Focusing

Dhiru Kholia kholia

🎯
Focusing
View GitHub Profile
@peterbmarks
peterbmarks / wsprgen.py
Last active October 29, 2025 20:39
Python code to generate WSPR tones using pyaudio
#!/usr/bin/env python3
# Pure python code to generate WSPR audio tones
#
# Heavily based on https://github.com/PH0TRA/wspr which drove an AD9851
# I removed that code and replaced it with audio generation using pyaudio
# wsprgen.py CALLSIGN GRID dBPower BASE_AUDIO_FREQUENCY
# genwsprcode from https://github.com/PH0TRA/wspr/blob/master/genwsprcode.py
import genwsprcode as g
import pyaudio
@moyix
moyix / Makefile
Created March 8, 2024 05:26
Claude 3 writes a fuzzer
all: gifread gifread.asan gifread.ubsan gifread.coverage
gifread: gifdec.c gifread.c gifdec.h
$(CC) $(CFLAGS) -o $@ gifdec.c gifread.c $(LDFLAGS)
gifread.asan: gifdec.c gifread.c gifdec.h
$(CC) $(CFLAGS) -g -fsanitize=address -o $@ gifdec.c gifread.c $(LDFLAGS)
gifread.ubsan: gifdec.c gifread.c gifdec.h
$(CC) $(CFLAGS) -g -fsanitize=undefined -o $@ gifdec.c gifread.c $(LDFLAGS)
@andreagrandi
andreagrandi / pelican2hugo.py
Last active May 16, 2025 15:02
Python script to migrate posts from Pelican to Hugo
# Migration script from Pelican to Hugo
import os, re, shutil
from pathlib import Path
INPUT_FOLDER = "content"
OUTPUT_FOLDER = "content-hugo"
# Custom sort key function
def sort_key(path):
# Extract the base filename without the extension
@schauveau
schauveau / README-TAPO-Linux.md
Last active September 20, 2025 03:28
Notes about TP-Link Tapo C500 and Linux

TP-Link Tapo C500 and Linux

Those are my notes about using the TP-Link Tapo C500 camera in my Linux environment.

More precisely, my Linux system are

  • a Debian Testing desktop pc
  • a few raspberry pi
  • an Asustor NAS that is running a highly customized Linux

Tapo C500 technical summary

@djibe
djibe / windows11-24H2-tpm-secureboot.md
Last active November 29, 2025 22:25
Install Windows 11 24H2 without TPM and Secure Boot requirements

Install Windows 11 24H2 without TPM and Secure Boot requirements

  1. Create a Windows 11 ISO with Microsoft's Media Creation Tool
  2. Install Setup Patchium and run it (or try latest Rufus version directly and patch from there)
  3. Home tab: Select ISO, wait during processing
  4. Go to Install > Uncheck Remove upgrade and Check Disable Windows 11 compatibility restrictions, click Apply
  5. Optional: To install without a Microsoft account, go to Install OOBE tab. Click Integrate lumOOBE. This will break sysinstall.
  6. Click on Create ISO button
  7. Use Rufus or Ventoy (prefered) to run installation from a USB drive
@thekitchenscientist
thekitchenscientist / mistral_chat.py
Created October 17, 2023 07:46
Simple chat using dolphin-2.1-mistral-7b with a 16k context window, streamlit and llama_cpp
# -*- coding: utf-8 -*-
"""
Spyder Editor
@author: thekitchenscientist
"""
# Import streamlit library
import streamlit as st
from llama_cpp import Llama

Building Chrome V8 on Windows

In order to be able to build v8 from scratch on Windows for x64, please follow the following steps.

These instructions were updated to work with Windows 11 Build 10.0.22621, but this should also work on WInodws 10

NOTE: While the Chrome team does provide decent documentation, there are some nuances and other additional steps that must be done for v8 to compile on Windows.

Documentation:

#example from https://pramode.in/2016/10/05/random-bitstream-using-lfsr/
from migen import *
MAX_PERIOD = 50000
def new_val(lfsr):
bit = ((lfsr >> 0) ^ \
(lfsr >> 2) ^ \
(lfsr >> 3) ^ \
(lfsr >> 5)) & 1
@satmandu
satmandu / gist:37ce878ba5c3e002b7cb6c3a47aa598a
Last active September 1, 2025 08:18
Extract macos dmg with pkg inside from Linux (ubuntu 22.04)
# Install build prereqs:
sudo apt-get install build-essential libxml2-dev libssl-dev zlib1g-dev
# You can extract a dmg using 7z thus: 7z x File.dmg
# This installs tools like lsbom to see what is inside bom files
git clone https://github.com/hogliux/bomutils && cd bomutils && make && sudo make install
# Now install xar so you can extract the pkg file
curl -OLf https://opensource.apple.com/tarballs/xar/xar-425.2.tar.gz
tar fxv xar-425.2.tar.gz
cd xar-xar-425.2/xar/
curl -OLf https://raw.githubusercontent.com/macports/macports-ports/master/archivers/xar/files/xar-1.8-openssl-1.1.patch
@moyix
moyix / copilot_fmt_plug.c
Last active September 2, 2025 13:41
JtR cracker for Copilot slur list hash format
/*
* Copilot cracker for JtR. Hacked together during August of 2021 by
* Brendan Dolan-Gavitt <mooyix at gmail.com>
*
* This software is Copyright (c) 2021, Brendan Dolan-Gavitt <mooyix at gmail.com>
* and it is hereby released to the general public under the following terms:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted.
*
* Most of the file ripped off from pst_fmt_plug.c by Dhiru Kholia