Skip to content

Instantly share code, notes, and snippets.

@LeonStoldt
LeonStoldt / installation.md
Last active August 30, 2022 16:25
Installing Stable Diffusion (incl. Web UI) - Local Docker Setup

Stable Diffusion

Aug 30 2022

This guide explains steps that I've done to install Stable Diffusion with a web interface.

Tested on:

  • OS: Linux-x86_64 (Ubuntu 22.04.1 LTS) VM
  • Nvidia Driver Version: 515.65.01
  • Graphics Card: NVIDIA GeForce RTX 3090
@LeonStoldt
LeonStoldt / check.sh
Last active October 1, 2022 12:23
Pi-hole Domain Queried Alert (Telegram Notification)
#!/bin/bash
# This script scans all queried domains of pihole for a provided list of domains and sends a telegram alert message if a defined url was queried.
# It is far away from perfect or performance optimized and was created as a quick solution to solve a simple problem.
# Check out the documentation of pihole for pihole related information: https://docs.pi-hole.net/
# Check out the documentation of telegram for telegram related information: https://core.telegram.org/
#
# How to use:
# > you need to have jq installed (check out jq here: https://wiki.ubuntuusers.de/jq/)
# copy the script to your workspace and replace all references like directories, hosts, domains, token and ids with your personal (access) information.
# Make the file executable (chmod +x check.sh)
@LeonStoldt
LeonStoldt / conclusion.md
Created November 17, 2021 07:31
Postgres Optimization and Performance Tuning

Postgres Optimization and Performance Tuning

based on the following article: An Introduction to PostgreSQL Performance Tuning and Optimization

Resource Usage

  • huge pages: Enabling on Linux will give a performance boost to PostgreSQL (VMPeak / HugePageSize = 4310)
  • max_connections: optimal number is roughly 4 times the number of CPU cores. The recommended number is the GREATEST(4 x CPU cores, 100). Beyond this number, a connection pooler such as pgbouncer should be used. avoid setting max_connections too high as it will increase the size of various data structures in Postgres which can result in CPU cycles being wasted
  • shared_buffers: variable by workload - starting Point: LEAST(RAM/2, 10GB).
  • work_mem: ((Total RAM - shared_buffers)/(16 x CPU cores))
  • maintenance_work_mem: 1GB good start
  • effective_io_concurrency: SSD = 200, HDD = Number of Disks
@LeonStoldt
LeonStoldt / auto-unlock-array.md
Last active November 10, 2022 14:02
Unraid array auto startup with keyfile exchange for decryption

Unraid array auto startup with keyfile exchange for decryption

Warning: I am not an Unraid Expert an my Knowledge of auto array startup decryption and Unraid events depends on the mentioned article below and some StackOverflow entries. This configuration and settings might not be the most secure settings you can apply for this scenario. It works for me for now and I am still learning and improving my setup. The configuration is oriented to the suggestes way of an Unraid Community developer combined with try-and-error of myself.

tested Unraid Versions 6.8.x, 6.10.x and 6.11.x - it should work with Unraid Versions >=6.4 Use Case: decrypt HDD in array by exchanging keyfile from another Unraid server in the same network. File to change: /boot/config/go (on the system where you want to decrypt HDD)