Skip to content

Instantly share code, notes, and snippets.

View geerlingguy's full-sized avatar
:shipit:
Tea, Earl Grey, hot.

Jeff Geerling geerlingguy

:shipit:
Tea, Earl Grey, hot.
View GitHub Profile
@geerlingguy
geerlingguy / config.txt
Created December 13, 2023 15:56
Mame Gear config
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1
@geerlingguy
geerlingguy / Template.md
Created May 11, 2023 03:37
Template for new Jeff Geerling videos

Project Title Here


Notes

TODO.


Metadata

@geerlingguy
geerlingguy / txt-file-compile.sh
Created April 26, 2023 18:04
AI scripts for vlog footage batch transcription
#!/bin/bash
# Bash function to append contents of a given text file to an output file.
file_compile() {
file=$1
filename=$(basename "$file")
output_file="txt-file-output.txt"
printf "Adding contents of: $filename\n"
@geerlingguy
geerlingguy / setup.yml
Created December 27, 2022 04:49
Pi Rack Pro setup script for the Pis in the Pi Rack Pro
# Run this playbook with ansible-playbook -i inventory setup.yml
# In the inventory file, create a group named [rpi] with all the Pis in it
---
- hosts: rpi
become: true
vars:
lcd_library_repo: 'https://github.com/geerlingguy/SKU_RM0004.git'
lcd_library_version: 'jeff-custom'
@geerlingguy
geerlingguy / handbrake-batch.sh
Created October 24, 2022 14:13
Handbrake CLI batch transcoding script
#!/bin/bash
#
# This script requires HandBrakeCLI. On macOS, at least, you need to download
# and install it separately from Handbrake.
#
# See: https://handbrake.fr/downloads2.php
if [ -z "$1" ] ; then
TRANSCODEDIR="."
else
@geerlingguy
geerlingguy / cache-purge.yml
Last active November 30, 2022 19:26
Cache purge script to clear Nginx + Cloudflare cache for a given set of URLs.
---
- hosts: webserver
become: true
gather_facts: false
vars:
# API token should be created with cache_purge permissions.
cloudflare_purge_zone: [zone id from cloudflare]
cloudflare_purge_token: "{{ lookup('env','CLOUDFLARE_PURGE_TOKEN') }}"
cloudflare_purge_body:
@geerlingguy
geerlingguy / stable-diffusion-webui-on-ubuntu.txt
Last active October 14, 2022 04:05
Install Stable Diffusion WebUI on Ubuntu 22.04 with Nvidia GPU
# First install Docker and docker-compose following this guide:
# https://docs.docker.com/engine/install/ubuntu/
#
# Make sure you add your user to the `docker` group:
sudo usermod -aG docker $USER
# ...then log out and log back in to make that take effect. (I actually had to reboot, le sigh)
# Second install the NVIDIA Container Toolkit following this guide:
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#setting-up-nvidia-container-toolkit
@geerlingguy
geerlingguy / stable-diffusion-ubuntu-2204-nvidia
Last active October 10, 2022 08:51
Install Stable Diffusion on an Nvidia GPU PC running Ubuntu 22.04
# Note: This will only work on (which?) GPUs.
# Install Conda (latest from https://docs.conda.io/en/latest/miniconda.html#linux-installers)
wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh
bash Miniconda3-py39_4.12.0-Linux-x86_64.sh
# follow the prompts, restart your Terminal session, and run `conda` to confirm it installed.
# Install git and curl, and clone the stable-diffusion repo
sudo apt install -y git curl
cd Downloads
@geerlingguy
geerlingguy / stable-diffusion-ubuntu-2004-amd.sh
Last active March 15, 2024 06:52
Install Stable Diffusion on an AMD GPU PC running Ubuntu 20.04
# Note: This will only work on Navi21 GPUs (6800/6900+).
# See: https://github.com/RadeonOpenCompute/ROCm/issues/1668#issuecomment-1043994570
# Install Conda (latest from https://docs.conda.io/en/latest/miniconda.html#linux-installers)
wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh
bash Miniconda3-py39_4.12.0-Linux-x86_64.sh
# follow the prompts to install it, and run `conda` to make sure it's working.
# Install git and curl, and clone the stable-diffusion repo
sudo apt install -y git curl
@geerlingguy
geerlingguy / arducam-hawk-eye-setup.sh
Last active December 9, 2023 17:23
ArduCam Hawk-Eye 64MP camera setup
# Download the pivariety driver install script and make it executable
wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
chmod +x install_pivariety_pkgs.sh
# Install libcamera dev and apps
./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps
# Install the Hawk-Eye kernel driver
./install_pivariety_pkgs.sh -p 64mp_pi_hawk_eye_kernel_driver