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)
@djibe
djibe / windows11-24H2-tpm-secureboot.md
Last active October 29, 2024 19:11
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
  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
  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 November 14, 2024 19:12
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 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
@revant
revant / README.md
Last active July 28, 2024 06:24
Frappe Docker development bench in production

Install frappe-bench using docker

Clone frappe_docker

git clone https://github.com/frappe/frappe_docker.git
cd frappe_docker

Install bench using docker

@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
+