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
@paulmillr
paulmillr / active.md
Last active April 23, 2024 17:32
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
@geerlingguy
geerlingguy / nvidia-gt710-arm-pi-setup.sh
Last active April 14, 2024 16:26
Set up the Nvidia GeForce GT 710 on Raspberry Pi Compute Module 4
#!/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
@danielestevez
danielestevez / gist:2044589
Last active April 10, 2024 07:51
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@alwynallan
alwynallan / Makefile
Last active April 4, 2024 04:42
Hardware PWM Controller for the Raspberry Pi 4 Case Fan
CC = gcc
RM = rm -f
INSTRUMENT_FOR_PROMETHEUS := false
ifeq ($(INSTRUMENT_FOR_PROMETHEUS),true)
CFLAGS = -Wall -DINSTRUMENT_FOR_PROMETHEUS
LIBS = -lbcm2835 -lprom -lpromhttp -lmicrohttpd
else
CFLAGS = -Wall
@geerlingguy
geerlingguy / pi-cpu-stress.sh
Last active March 28, 2024 15:20
Raspberry Pi CPU temperature and throttling test script
#!/bin/bash
# Raspberry Pi stress CPU temperature measurement script.
#
# Download this script (e.g. with wget) and give it execute permissions (chmod +x).
# Then run it with ./pi-cpu-stress.sh
#
# NOTE: In recent years, I've switched to using s-tui. See:
# https://github.com/amanusk/s-tui?tab=readme-ov-file#options
# Variables.
@geerlingguy
geerlingguy / pi-general-benchmark.sh
Last active March 23, 2024 02:38
Raspberry Pi Benchmark Suite - Phoronix
#!/bin/bash
#
# Benchmark script for Raspberry Pi OS.
#
# WARNING: This script is meant to be run as the root user.
# This script should never be run on a system/partition you
# care about. You should only run this on a system that you
# intend to use only for benchmarking and can reinstall or
# re-flash easily.
#
@geerlingguy
geerlingguy / photogrammetry.sh
Last active February 14, 2024 09:47
Photogrammetry automation script using COLMAP and OpenMVS
#!/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 / SonarDrupalKeyGenerator.php
Last active January 30, 2024 16:47
A simple PHP script to generate the XML necessary for Sonar to detect the Drupal Coder module's sniffs. See: https://drupal.org/node/2082563
<?php
/**
* @file
* Generate rules for Drupal Coding Standards Sniffs.
*
* SonarQube requires manually-entered PHP CodeSniffer rules if you use anything
* outside of the standard set of rules. In this case, there are a bunch of
* Drupal-specific sniffs that we'd like to use.
*
@geerlingguy
geerlingguy / ansible-role-test.sh
Last active January 18, 2024 17:37
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@phantomwhale
phantomwhale / Command Line
Created March 20, 2014 04:14
Passing command line arguments into Vagrant to configure Ansible Provisioning
# with a space, this doesn't work...
$ ANSIBLE_ARGS='-t elasticsearch' vagrant provision
==> default: Running provisioner: ansible...
ERROR: tag(s) not found in playbook: elasticsearch. possible values: apache,common,elasticsearch,java,passenger,postgresql,ruby
Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again.
# without the space, it now works...
$ ANSIBLE_ARGS='-telasticsearch' vagrant provision