Skip to content

Instantly share code, notes, and snippets.

View gaieges's full-sized avatar

Evin Callahan gaieges

View GitHub Profile
@gaieges
gaieges / README.md
Last active December 14, 2023 18:04
Parse'ing Sendgrid inbound messages via webhook in python and fastapi

Sendgrid inbound parse'ing in python and fastapi

This took me far too long to figure out how to parse emails coming in from sendgrid's "inbound parse" tool to receive an email via webhook, so I saved it for others to view if they stumble upon it.

The key to this is to check off the setting "POST the raw, full MIME message" in the inbound parse webhook address options.

@gaieges
gaieges / openapi.yaml
Created February 12, 2023 01:46
techspecs mobile device api spec
{
"openapi": "3.0.0",
"info": {
"version": "3.27",
"title": "Free",
"description": "Free Forever"
},
"servers": [
{
"url": "https://apis.blobr.app/f9g3z21kiqc0hz9s",
@gaieges
gaieges / README.md
Last active November 2, 2020 18:18
Getting all k8s secrets in plaintext

Couldn't find any tools out there aside from ksd which is great in a case where you need to look at individual secrets, but doesn't work if you are looking through many secrets.

How

Instead, I managed to find a way to do this in a bash shell instead:

# get all secrets
kubectl get secrets -o json --all-namespaces > /tmp/all.json

# use jq to look through and dump all the cleartext secret values:
@gaieges
gaieges / docker-compose.yml
Created March 10, 2020 23:44
Using docker env vars to set config file in image at run time
# this file is intended to be used in the local build environment
# to get started, run:
#
# docker-compose up
#
# REQUIRES docker-compose 1.16+
version: '2.3'
@gaieges
gaieges / docker-compose.yml
Created March 8, 2020 16:14
Homeassistant with traefik 2.2 for TLS in docker-compose in network_mode: host
version: '2.1'
services:
homeassistant:
restart: always
image: homeassistant/raspberrypi3-homeassistant
expose:
- 8123
ports:
- "8123:8123"
@gaieges
gaieges / python.py
Created April 10, 2018 20:24
map / foreach
>>> x = ['a', 'b', 'c']
>>> x
['a', 'b', 'c']
>>> list(map(lambda z: z+'-peen' , x))
['a-peen', 'b-peen', 'c-peen']
>>> for z in x:
... print(z+'-peen')
...
a-peen
b-peen
$ docker run -i --rm -v $(pwd):/app -w /app stoplight/prism conduct -e host=https://my.host.com -e token=$TOKEN scenario.yml
Prism version is 2.0.5
[Conductor] Stoplight Exporter Host is https://exporter.stoplight.io
[Conductor] Stoplight API Host is https://next-api.stoplight.io
different scenario Scenario (0.005s)
check if vars work in different scenario, (0.005s)
before.script.info ⁃
before.script.info ⁃
@gaieges
gaieges / jenkins-dump-whoami.md
Created February 12, 2018 22:56
Jenkins whoami thread dump hanging issue
2018-02-12 22:55:56
Full thread dump OpenJDK 64-Bit Server VM (25.151-b12 mixed mode):

"RequestHandlerThread[#54]" #914 daemon prio=5 os_prio=0 tid=0x000055b6e7a49000 nid=0x197a runnable [0x00007fc10e66a000]
   java.lang.Thread.State: RUNNABLE
	at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
	at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
	at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
	at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
@gaieges
gaieges / jenkins-dump.md
Last active February 12, 2018 23:41
Jenkins master hanging - thread dump
 2018-02-12 23:40:19
Full thread dump OpenJDK 64-Bit Server VM (25.151-b12 mixed mode):

"RequestHandlerThread[#78]" #2068 daemon prio=5 os_prio=0 tid=0x000055b6e7f07800 nid=0x2b06 runnable [0x00007fc10cb2b000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000000837ded48> (a java.util.concurrent.SynchronousQueue$TransferStack)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:458)
@gaieges
gaieges / kubernetes-the-hard-way.md
Last active August 12, 2023 12:58
Kubernetes the hardway, concatenated for reading on offline ipad. Copyright kelseyhightower: https://github.com/kelseyhightower/kubernetes-the-hard-way

Kubernetes the hard way © Kelsey Hightower

Prerequisites

Google Cloud Platform

This tutorial leverages the Google Cloud Platform to streamline provisioning of the compute infrastructure required to bootstrap a Kubernetes cluster from the ground up. Sign up for $300 in free credits.

Estimated cost to run this tutorial: $0.22 per hour ($5.39 per day).