Skip to content

Instantly share code, notes, and snippets.

View rrichards's full-sized avatar
💭
Rocking the CLI

Ryan Richards rrichards

💭
Rocking the CLI
  • R3 Technologies, Inc.
  • Oklahoma City, OK
  • X @rrichards
View GitHub Profile
@rrichards
rrichards / README.md
Created March 26, 2020 20:58 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@rrichards
rrichards / grafana custom.ini
Created February 20, 2020 09:34 — forked from mvadu/grafana custom.ini
nginx config for using grafana, Influxdb via reverse proxy with authentication
# The full public facing url
#root_url = %(protocol)s://%(domain)s:%(http_port)s/
root_url = http://localhost:80/grafana/
@rrichards
rrichards / ami-clean.sh
Created January 14, 2020 17:28 — forked from jdowning/ami-clean.sh
Script to clean up Ubuntu EC2 instance before packaging as an AMI
#!/bin/bash
# This script cleans up your EC2 instance before baking a new AMI.
# Run the following command in a root shell:
#
# bash <(curl -s https://gist.github.com/justindowning/5921369/raw/ami-clean.sh)
function print_green {
echo -e "\e[32m${1}\e[0m"
}
@rrichards
rrichards / ami-clean.sh
Created January 14, 2020 17:28 — forked from garlandkr/ami-clean.sh
Clean-up an Amazon EC2 instance before creating an AMI
#!/bin/bash
# Run this script with:
# bash <(curl -s https://gist.github.com/garlandkr/e80674b49270b0199fa6/raw/ami-clean.sh
function print_green {
echo -e "\e[32m${1}\e[0m"
}
print_green 'Clean Yum'
@rrichards
rrichards / puma.rb
Created December 19, 2019 21:35 — forked from danielalvarenga/puma.rb
Puma config for rails 5 api
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
# More: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#threads
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count
@rrichards
rrichards / puma.rb
Created December 19, 2019 21:35 — forked from danielalvarenga/puma.rb
Puma config for rails 5 api
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
# More: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#threads
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count
@rrichards
rrichards / gist:5b2a4a942f9e77b73f7efe77a7afa1ce
Created October 30, 2019 10:22 — forked from hummus/gist:8592113
aws cli + jq example
wget http://stedolan.github.io/jq/download/linux64/jq
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \
"Name=instance-state-name,Values=running" \
| jq -r \
".Reservations[] | .Instances[] | .InstanceId" \
aws ec2 describe-volumes --filters \
"Name=status,Values=available" \
| jq -r ".Volumes[] | .VolumeId" \
@rrichards
rrichards / grab links.bookmarklet
Created August 2, 2019 07:24 — forked from ttscoff/grab links.bookmarklet
Create a bookmark and paste the code from `grab links.bookmarklet` into the url. Trigger it on a page containing links you want to save and then click the section of the page containing the links. A Markdown list of all links will be generated, and clicking the resulting list will select all for copying.
@rrichards
rrichards / kubedf
Created May 28, 2019 21:41 — forked from redmcg/kubedf
Bash script to show k8s PVC usage
#!/usr/bin/env bash
KUBEAPI=127.0.0.1:8001/api/v1/nodes
function getNodes() {
curl -s $KUBEAPI | jq '.items[].metadata.name' | sed 's/^"\|"$//g'
}
function getPVCs() {
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\
@rrichards
rrichards / gcrgc.sh
Created May 28, 2019 15:50 — forked from ahmetb/gcrgc.sh
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software