Skip to content

Instantly share code, notes, and snippets.

View butangero's full-sized avatar

Travis Smith butangero

  • Getweave.com
  • Lehi, UT, USA
View GitHub Profile
@butangero
butangero / Mock Exam 1.md
Created July 26, 2024 18:06 — forked from luckylittle/Mock Exam 1.md
Prometheus Certified Associate (PCA)

Mock Exam

1

Q1. The metric node_cpu_temp_celcius reports the current temperature of a nodes CPU in celsius. What query will return the average temperature across all CPUs on a per node basis? The query should return {instance=“node1”} 23.5 //average temp across all CPUs on node1 {instance=“node2”} 33.5 //average temp across all CPUs on node2.

node_cpu_temp_celsius{instance="node1", cpu="0"} 28
node_cpu_temp_celsius{instance="node1", cpu="1"} 19
node_cpu_temp_celsius{instance="node2", cpu="0"} 36
node_cpu_temp_celsius{instance="node2", cpu="1"} 31
@butangero
butangero / kssh
Created October 24, 2023 20:47 — forked from jason-kane/kssh
Shell wrapper for exec-ing into a kubernetes container with friendly terminal settings
#!/bin/sh
if [ "$1" = "" ]; then
echo "Usage: kshell <pod>"
exit 1
fi
COLUMNS=`tput cols`
LINES=`tput lines`
TERM=xterm
kubectl exec -i -t $@ env COLUMNS=$COLUMNS LINES=$LINES TERM=$TERM bash
@butangero
butangero / github-drawio-demo.md
Created August 28, 2023 18:43 — forked from philip-gai/github-drawio-demo.md
How to integrate diagrams.net (draw.io) with your GitHub repo

Embedding Diagrams in GitHub Markdown

This explains and demos how to use diagrams.net (draw.io) diagrams in your GitHub repo.

  • See repo for more details

Benefits of using diagrams.net in GitHub repositories

  1. Diagrams are stored in your repository with your code and docs
  2. Diagram access is controlled by GitHub repository access
@butangero
butangero / self-signed-certificate-with-custom-ca.md
Created January 19, 2023 17:49 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@butangero
butangero / osx_setup.md
Created December 17, 2021 18:09 — forked from millermedeiros/osx_setup.md
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

#!/usr/bin/env bash
# This script clones all repos in a GitHub org
# It requires the GH CLI: https://cli.github.com
# It can be re-run to collect new repos and pull the latest changes
set -euo pipefail
USAGE="Usage: gh-clone-org <user|org>"
@butangero
butangero / clone-all-twitter-github-repos.sh
Created April 30, 2021 15:04 — forked from caniszczyk/clone-all-twitter-github-repos.sh
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@butangero
butangero / readme.md
Created March 12, 2019 20:53 — forked from noahcoad/readme.md
Code Minecraft with Python on Mac OSX

Code Minecraft with Python on Mac OSX

Here's a step-by-step to get started scripting Minecraft with Python on Mac OSX

@butangero
butangero / resetting-csync2-cluster.md
Created March 3, 2016 22:00 — forked from scottsb/resetting-csync2-cluster.md
Guide to Resetting a csync2 Cluster

Guide to Resetting a csync2 Cluster

Introduction

These are possible steps to reset a csync2 cluster that has been seriously fubared. This is an apocalyptic approach and should only be used when more surgical fixes (like correcting an individual conflict) aren't workable.

Use Cases

@butangero
butangero / tmux-cheatsheet.markdown
Created October 16, 2015 03:28 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname