Skip to content

Instantly share code, notes, and snippets.

View kholia's full-sized avatar
🎯
Focusing

Dhiru Kholia kholia

🎯
Focusing
View GitHub Profile
@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)
@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
@moyix
moyix / copilot_fmt_plug.c
Last active February 2, 2023 13:39
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

Conceptual SBOM model for an APT-based Linux distribution

This is a draft of an entirely exploratory learning exercise to generate SBOMs from first principles that can accompany an APT-based Linux distribution, which in this context is either a disk or a container image obtained from any source including runtime instances, packaged images, debootstraps, etc. Input and comments welcome: Twitter and also on the CNCF, CycloneDX, CDF, Sigstore and other Slacks.

Status

Here's the current version of the output (SPDX) which features:

  • Identifying information for the primary component (at this time, the debian:latest container image)
  • purl identifiers for each binary package in the image
@VinDuv
VinDuv / smol-penguins.diff
Created January 23, 2021 17:37
Display the boot logo at a smaller size for low-power CPUs
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 8268bbee8..708c1846e 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -45,6 +45,8 @@
#define FBPIXMAPSIZE (1024 * 8)
+#define RESIZE_RATIO 75
+
@nstarke
nstarke / find-compressed-data.py
Last active May 17, 2023 10:39
Find Compressed Data without Compression Header
#!/usr/bin/env python3
#
# find-compressed-data.py
#
# A small script to bruteforce embedded compressed data that might not have a header
# Useful for raw binary firmware images that do not contain a standard
# binary header (ELF, PE, MACH-O).
#
# I included a limt on size at 16KB because this has a tendency to create
@kevinelliott
kevinelliott / 01 - Reverse Engineer WebSDR @ Twente WebSocket Audio to SDR IQ.md
Last active January 17, 2024 20:48
Effort to Reverse Engineer WebSDR @ Twente

Trying to figure out how to capture the audio from the WebSDR @ Twente.

http://websdr.ewi.utwente.nl:8901

Mirror the websdr site

wget --mirror http://websdr.ewi.utwente.nl:8901

Current Efforts

The ruby script will successfully pull down the audio IQ, however the IQ cannot be played in Audacity. I believe this is because the audio is encoded or otherwise slightly mangled to deter us.

@kholia
kholia / Backup stock uBitx's calibration values.txt
Last active January 4, 2022 15:10
Backup stock uBitx's calibration values
We couldn’t find that file to show.