Skip to content

Instantly share code, notes, and snippets.

View coryodaniel's full-sized avatar
☘️
O'Internets

Cory O'Daniel coryodaniel

☘️
O'Internets
View GitHub Profile
@coryodaniel
coryodaniel / list.txt
Created May 13, 2020 22:04
GCP List of API Services
NAME TITLE
abusiveexperiencereport.googleapis.com Abusive Experience Report API
acceleratedmobilepageurl.googleapis.com Accelerated Mobile Pages (AMP) URL API
accessapproval.googleapis.com Access Approval API
accesscontextmanager.googleapis.com Access Context Manager API
actions.googleapis.com Actions API
adexchangebuyer-json.googleapis.com Ad Exchange Buyer API
adexchangebuyer.googleapis.com Ad Exchange Buyer API II
adexchangeseller.googleapis.com Ad Exchange Seller API
adexperiencereport.googleapis.com Ad Experience Report API
@coryodaniel
coryodaniel / GOMAXPROCS.downward_api.yaml
Last active January 5, 2024 15:47
Setting GOMAXPROCS to resource limits cpu using Kubernetes downward API
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
containers:
- name: mycontainer
image: myimage
resources:
limits:
@coryodaniel
coryodaniel / debug-containers.md
Last active November 7, 2023 09:09
Connect to a failing kubernetes pod to inspect mounts, etc

Update the command/args:

command: [ "/bin/sh", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]

Run a command

kubectl exec my-pod -c my-container -- ls /
@coryodaniel
coryodaniel / k8s.Makefile
Last active August 9, 2023 23:37
A makefile for doing common things with kubectl
##################################################
## A makefile for doing common things with kubectl
##################################################
ifndef K8S_PROJECT_NAME
$(error K8S_PROJECT_NAME is not set. Please set this to your k8s project namein YOUR Makefile)
endif
UNAME_S := $(shell uname -s)
STAGING_NAMESPACE = staging-${K8S_PROJECT_NAME}
@coryodaniel
coryodaniel / block.tf
Last active June 24, 2023 04:17
Optional dynamic blocks in terraform
variable "gpu" {
description = "Enable and configure node GPUs"
type = object({
type = string
count = number
})
default = null
# or...
@coryodaniel
coryodaniel / .pre-commit-hooks.yaml
Last active July 9, 2022 22:43 — forked from athiththan11/pre-commit
Git Pre Commit Hook for FIXME TODO
- id: deny-todos
name: Denies TODOs or FIXME
description: 'Denies TODOs or FIXME in commits'
entry: run.sh
language: script
@coryodaniel
coryodaniel / heroku_name_generator.ex
Created December 16, 2017 23:48
Heroku Style Name Generator in Elixir
defmodule Name do
@adjectives ~w(
autumn hidden bitter misty silent empty dry dark summer
icy delicate quiet white cool spring winter patient
twilight dawn crimson wispy weathered blue billowing
broken cold damp falling frosty green long late lingering
bold little morning muddy old red rough still small
sparkling throbbing shy wandering withered wild black
young holy solitary fragrant aged snowy proud floral
restless divine polished ancient purple lively nameless
@coryodaniel
coryodaniel / scanner.sh
Created March 10, 2020 03:32 — forked from andyrbell/scanner.sh
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@coryodaniel
coryodaniel / tf-aws-multiaz-vpc-w-az-cache.tf
Created November 16, 2021 22:14
Create multi-az VPC in AWS w/ Terraform and _not_ specifying individual zones
provider "aws" {
region = "us-west-2"
profile = "md-sandbox"
}
resource "aws_s3_bucket" "dont_create_me_in_same_script_obvi" {
bucket = "terraform-provisioning-cache"
acl = "private"
}
@coryodaniel
coryodaniel / kratos.ex
Created August 23, 2021 18:40
Kratos Sessions whoami client for elixir
defmodule Kratos do
defmodule Behaviour do
@moduledoc """
Defines function signature for secrets adapters
"""
@callback who_am_i(String.t()) :: {:ok, map()} | {:error, :unauthenticated}
end
@behaviour Kratos.Behaviour