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 / 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 / Template.md
Created May 11, 2023 03:37
Template for new Jeff Geerling videos

Project Title Here


Notes

TODO.


Metadata

@geerlingguy
geerlingguy / k8s-cluster-resources.sh
Created February 27, 2019 23:54
Monitor overall Kubernetes cluster utilization and capacity.
#!/bin/bash
#
# Monitor overall Kubernetes cluster utilization and capacity.
#
# Original source:
# https://github.com/kubernetes/kubernetes/issues/17512#issuecomment-367212930
#
# Tested with:
# - AWS EKS v1.11.5
#
@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 / dashcam-time-lapse.sh
Last active August 10, 2023 06:06
Create a time lapse video from a set of real-time dash cam clips.
#!/bin/bash
#
# Batch Time-Lapse creation script.
#
# This script can be used to speed up, trim, and finally concatenate tens or
# even hundreds of video clips, e.g. from a dash cam. You can do other things,
# too, but the main things this script does include:
#
# 1. Copy across and speed up video clips from an input dir to an output dir.
# 2. Trim off the first x frames of each of the copied/sped up clips.
@geerlingguy
geerlingguy / desktop.yml
Created March 21, 2020 19:14
Playbook for local stuff
---
- hosts: localhost
connection: local
gather_facts: no
roles:
- name: gtk
tags: ['gtk']
- name: gnome_shell
@geerlingguy
geerlingguy / Dockerfile
Created December 14, 2018 22:46
BLT Docker Image Dockerfile
# Note: Your base image should contain all the PHP extensions required by your project.
FROM my/base-drupal-container:latest
# Set the project machine name here.
ENV PROJECT my-blt-project
# Copy the deployment artifact into place.
COPY deploy/ /var/www/$PROJECT
# Copy the Drupal container settings file into place.
@geerlingguy
geerlingguy / blt-artifactory.sh
Last active August 16, 2023 12:34
BLT Artifactory - Build BLT deployment artifacts with Docker
#!/bin/bash
#
# BLT Deployment Artifact generator using a local Docker image.
#
# Source: https://gist.github.com/geerlingguy/85b816ed7aff378ea2700b82ebde81c8
#
# This script should be run from within the BLT project directory root. If it is
# run elsewhere, the project_dir should be updated accordingly.
name="blt-artifactory"
@geerlingguy
geerlingguy / aws-sts-token
Created September 19, 2018 16:05
AWS STS Token update playbook for MFA
#!/usr/bin/env ansible-playbook -c local
#
# AWS STS token update playbook.
#
# Updating AWS session tokens with STS can be a pain. But MFA is good. So let's
# automate the management of the .aws/credentials file to make it not painful!
#
# Usage:
#
# 1. Save this to a file like /usr/local/bin/aws-sts-token
@geerlingguy
geerlingguy / crawler_detect.php
Created May 7, 2014 18:48
Detect crawlers/bots/spiders in PHP (simple and fast)
<?php
/**
* Check if the given user agent string is one of a crawler, spider, or bot.
*
* @param string $user_agent
* A user agent string (e.g. Googlebot/2.1 (+http://www.google.com/bot.html))
*
* @return bool
* TRUE if the user agent is a bot, FALSE if not.