Skip to content

Instantly share code, notes, and snippets.

View cpietsch's full-sized avatar
💭
in the void

Christopher Pietsch cpietsch

💭
in the void
View GitHub Profile
@cpietsch
cpietsch / combine.sh
Created September 29, 2024 10:01
bash command to recursive combine js/ts files into one file to use as context for LLMS like GPT
find path/to/folder -type f \( -name "*.(js|ts)" -o -name "*.ts" \) -print0 |
while IFS= read -r -d '' file; do
echo "## $(basename "$file")"
cat "$file"
done
} > codebase.txt
@cpietsch
cpietsch / ff.sh
Created July 2, 2024 09:37
ffmpeg folder to video
#!/bin/bash
# Default values
parent_folder="/home/jovyan/stable-diffusion-webui/outputs/txt2img-images"
framerate=10
output_format="mp4"
image_format="jpg"
# Function to display usage
usage() {
@cpietsch
cpietsch / down.sh
Created February 24, 2024 20:10
download civicai models on command line
curl -JL --remote-name -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" https://civitai.com/api/download/models/XXX
@cpietsch
cpietsch / extract.sh
Created August 16, 2023 15:39
bash script to extract automatic1111 output image metadata and generate a csv
#!/bin/bash
# Path to the directory containing folders with images
base_dir="/home/jovyan/stable-diffusion-webui/outputs/txt2img-images"
# Path to the ExifTool executable
exiftool_path="/home/jovyan/Image-ExifTool-12.65/exiftool"
# Loop through each folder in the base directory
for folder in "$base_dir"/*; do
@cpietsch
cpietsch / convert.py
Created August 16, 2023 15:38
Here we convert all the automatic1111 pngs into jpgs and add the custom metadata
import os
from PIL import Image
from PIL import ExifTags
import glob
def convert_png_to_jpg(png_path, jpg_path):
png_files = glob.glob(os.path.join(png_path, '**/*.png'), recursive=True) #[:1]
# print(png_files)
for png_file in png_files:
@cpietsch
cpietsch / Artillery.ini
Created July 23, 2023 18:05
Artillery prusaslic3r ini
###############
# AUTHOR: Szabolcs Hornyak / [email protected]
# https://szabolcs.eu/2020/12/29/prusaslicer-sw-x1-genius/
###############
## Artillery Hornet printer profile is based on PR https://github.com/slic3r/slic3r-profiles/pull/14 created by https://github.com/newbeetle
# Print profiles for the Artillery printers.
[vendor]
@cpietsch
cpietsch / install.md
Created January 18, 2023 12:35
Lovelace Optimization for Stable Diffusion on Linux (Automatic1111/InvokeAI)

Lovelace Optimization for Stable Diffusion

Currently you will need to hotfix/manually update some packages in order to get the performance you deserve when using a lovelace gpu (4080/4090/etc)

Automatic1111

I am attesting that this GitHub handle cpietsch is linked to the Tezos account tz1X4sxpgg5X6aag4Mf1TmdWTrDbx3jBFwyT for tzprofiles
sig:edsigttRYKYY5rFmaLSW2S6zGJJC5dUcF7LVy24fR4P5kvQ3JVxgXfftChT4oH8FcbQaehLAhGYdPcYcEyRy8jDLDgF7WFqbyDN
@cpietsch
cpietsch / command
Created May 17, 2022 19:19
e3dc post history to firebase
jq -ncM "$(cat ./input.jq)" | ./e3dc -splitrequests | jq -cM "$(cat ./output.jq)" | jq '.result.DB_HISTORY_DATA + {"date":{".sv": "timestamp"}}' | curl -X POST -d @- https://XXXX.europe-west1.firebasedatabase.app/history.json
sources:
- https://knx-user-forum.de/forum/%C3%B6ffentlicher-bereich/knx-eib-forum/diy-do-it-yourself/1614158-neue-library-f%C3%BCr-rscp-kommunikation-mit-e3dc-speicher-inkl-kommandozeilen-utility
@cpietsch
cpietsch / steps.sh
Created May 17, 2022 18:43
compile jq for arm64 (raspberry pi)
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-1.6.tar.gz
tar xvfz jq-1.6.tar.gz
cd jq-1.6/
autoreconf -vfi
modules/oniguruma
autoreconf -vfi
cd ../..
./configure --with-oniguruma=builtin
make -j8
sudo make install