Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Tea, Earl Grey, hot.

Jeff Geerling geerlingguy

:shipit:
Tea, Earl Grey, hot.
View GitHub Profile
@geerlingguy
geerlingguy / arducam-hawk-eye-setup.sh
Last active Aug 1, 2022
ArduCam Hawk-Eye 64MP camera setup
View arducam-hawk-eye-setup.sh
# 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
@geerlingguy
geerlingguy / cm4-fan.sh
Last active Apr 30, 2022
Fan controller script for the CM4 IO Board EMC2301 and PWM fans
View cm4-fan.sh
#!/bin/bash
#
# Jeff Geerling's super-rudimentary fan controller script for the CM4.
#
# Use:
# 1. Download this script to a path like `/opt/cm4-fan.sh`
# 2. Run it with: `nohup bash /opt/cm4-fan.sh`
# 3. Profit!
#
# You should wrap it in a systemd unit file if you want it to persist and come
@geerlingguy
geerlingguy / systembuttons.py
Last active Oct 17, 2021
Python 3 version of Null 2 systembuttons.py
View systembuttons.py
#!/usr/bin/python3
# Shutdown and volume control
import keyboard
import time
import os
INITIAL_VOLUME = "25%"
def shutdown():
@geerlingguy
geerlingguy / photogrammetry.sh
Last active May 24, 2021
Photogrammetry automation script using COLMAP and OpenMVS
View photogrammetry.sh
#!/bin/bash
# Photogrammety automation script.
#
# Based on https://peterfalkingham.com/2018/04/01/colmap-openmvs-scripts-updated/
# Adapted from https://www.instructables.com/Free-Photogrammetry-on-Mac-OS-From-Photos-to-3D-Mo/
#
# See full guide on Jeff Geerling's blog:
# TODO
#
# Usage:
@geerlingguy
geerlingguy / increase-pci-bar-space.sh
Last active Mar 2, 2022
Increase the BAR memory address space for PCIe devices on the Raspberry Pi Compute Module 4
View increase-pci-bar-space.sh
#!/bin/bash
# The default BAR address space available on the CM4 may be too small to allow
# some devices to initialize correctly. To avoid 'failed to assign memory'
# errors on boot, you can increase the range of the PCIe bus in the Raspberry
# Pi's Device Tree (a .dtb file specific to each Pi model).
#
# You should probably read up on Device Trees if you don't know what they are:
# https://www.raspberrypi.org/documentation/configuration/device-tree.md
#
@geerlingguy
geerlingguy / nvidia-gt710-arm-pi-setup.sh
Last active Sep 10, 2021
Set up the Nvidia GeForce GT 710 on Raspberry Pi Compute Module 4
View nvidia-gt710-arm-pi-setup.sh
#!/bin/bash
# Attempt to set up the Nvidia GeForce GT 710 on a Pi CM4.
#
# I have tried both armv7l and aarch64 versions of the proprietary driver, in
# addition to the nouveau open source driver (which needs to be compiled into
# a custom Raspberry Pi kernel).
#
# tl;dr - None of the drivers worked :P
@geerlingguy
geerlingguy / minecraft.yml
Created Sep 24, 2020
Minecraft installation on Kubernetes via Ansible and Helm
View minecraft.yml
# Minecraft Server deployment for Kubernetes clusters via Ansible's Helm module.
#
# The Helm module is part of the Kubernetes collection. Install it with:
#
# ansible-galaxy collection install community.kubernetes
#
# Then run the playbook:
#
# ansible-playbook main.yml
#
@geerlingguy
geerlingguy / travis-ci-docker-upgrade.sh
Last active Aug 12, 2020
Upgrade Docker CE version in Travis CI environments
View travis-ci-docker-upgrade.sh
#!/bin/bash
#
# See: https://docs.travis-ci.com/user/docker/#installing-a-newer-docker-version
#
# Add the following in your .travis.yml file to upgrade Docker prior to your build:
#
# before_install:
# - curl https://gist.githubusercontent.com/geerlingguy/ce883ad4aec6a5f1187ef93bd338511e/raw/36612d28981d92863f839c5aefe5b7dd7193d6c6/travis-ci-docker-upgrade.sh | sudo bash
#
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@geerlingguy
geerlingguy / mariadb.yml
Last active Aug 4, 2022
Wordpress in Kubernetes K3s on Raspberry Pi
View mariadb.yml
# This manifest assumes 'wordpress' namespace is already present:
#
# kubectl create namespace wordpress
#
# Apply the manifest with:
#
# kubectl apply -f mariadb.yml
---
apiVersion: v1
kind: Secret
@geerlingguy
geerlingguy / drupal.yml
Last active Jun 5, 2022
Drupal in Kubernetes K3s on Raspberry Pi
View drupal.yml
# This manifest assumes 'drupal' namespace is already present:
#
# kubectl create namespace drupal
#
# Apply the manifest with:
#
# kubectl apply -f drupal.yml
---
kind: ConfigMap
apiVersion: v1