Skip to content

Instantly share code, notes, and snippets.

View chadmayfield's full-sized avatar

Chad Mayfield chadmayfield

View GitHub Profile
@Mazyod
Mazyod / README.md
Last active September 18, 2025 09:14
Ollama Models Import/Export Utility

Ollama Model Import/Export Utility

A Go utility for importing and exporting Ollama models as compressed archives.

Overview

This utility allows you to package Ollama models into portable tar.gz archives and restore them on other systems. It preserves the complete model structure including manifests, configuration blobs, and layer data.

How It Works

@izabera
izabera / magic_namerefs.md
Last active July 8, 2025 15:10
magic namerefs

namerefs (introduced in bash 4.0) act as aliases for other variables

var=meow
declare -n ref=var

echo $ref  # prints meow

ref=moo
echo $var  # prints moo
@jwbee
jwbee / jq.md
Last active July 15, 2025 12:12
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is

@willccbb
willccbb / grpo_demo.py
Last active November 2, 2025 13:27
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
"""
citation:
@misc{brown2025grpodemo,
title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models},
author={Brown, William},
@huytd
huytd / wordle.md
Last active October 29, 2025 21:41
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@sviridoff
sviridoff / ubuntu-dnsmasq-adblock.md
Last active September 21, 2025 10:06
Ad-blocking with dnsmasq on Ubuntu

Ubuntu dnsmasq adblock

Ad-blocking with dnsmasq on Ubuntu configuration

Install dnsmasq:

sudo apt update
sudo apt install dnsmasq
@usayamadx
usayamadx / ExportKindle.js
Last active October 13, 2025 21:17 — forked from jkubecki/ExportKindle.js
Amazon Kindle Export
// init
let xhr = new XMLHttpRequest()
let domain = 'https://read.amazon.com/'
let items = []
let csvData = ""
// function
function getItemsList(paginationToken = null) {
let url = domain + 'kindle-library/search?query=&libraryType=BOOKS' + ( paginationToken ? '&paginationToken=' + paginationToken : '' ) + '&sortType=recency&querySize=50'
xhr.open('GET', url, false)
@joseluisq
joseluisq / resize_disk_image.md
Last active October 21, 2025 14:46
How to resize a qcow2 disk image on Linux

How to resize a qcow2 disk image on Linux

This example takes olddisk.qcow2 and resizes it into newdisk.qcow2, extending one of the guest's partitions to fill the extra space.

1. qcow2 format

1.1. Verify the filesystems of olddisk.qcow2

@krzys-h
krzys-h / encrypt.sh
Last active September 9, 2025 09:50
Encrypt existing partitions with LUKS2 on Ubuntu 20.04
#!/bin/bash
# Encrypt an existing partition with LUKS2 on Ubuntu 20.04 LTS
# DISCLAIMER: USE AT YOUR OWN RISK AND MAKE BACKUPS
# Made for my personal use and has almost NO error checking!!
# Based on instructions from:
# https://wiki.archlinux.org/index.php/dm-crypt/Device_encryption#Encrypt_an_existing_unencrypted_filesystem
DISK="$1"
@prologic
prologic / LearnGoIn5mins.md
Last active August 12, 2025 02:24
Learn Go in ~5mins