Skip to content

Instantly share code, notes, and snippets.

View ddmitov's full-sized avatar

Dimitar D. Mitov ddmitov

View GitHub Profile
import os
import json
def lambda_handler(event, context):
json_region = os.environ['AWS_REGION']
return {
"statusCode": 200,
"headers": {
"Content-Type": "application/json"
@ddmitov
ddmitov / shrinkpdf.sh
Created August 12, 2024 13:12
Bash script for shrinking the size of PDF files
#!/bin/sh
gs -q -dNOPAUSE -dBATCH -dSAFER \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.3 \
-dPDFSETTINGS=/screen \
-dEmbedAllFonts=true \
-dSubsetFonts=true \
-dColorImageDownsampleType=/Bicubic \
-dColorImageResolution=72 \
@ddmitov
ddmitov / llama_cpp_deterministic.sh
Last active April 11, 2026 15:20
Demonstrator of deterministic output from llama.cpp
#!/usr/bin/env bash
# This script demonstrates deterministic output from llama.cpp.
# Place it in an empty directory, run it and it will:
# 1. Clone llama.cpp
# 2. Build llama-cli, it takes a few minutes
# 3. Download a small model
# 4. Run the same prompt twice with the same settings
# 5. Compare the outputs and print whether they are identical