Skip to content

Instantly share code, notes, and snippets.

View shcallaway's full-sized avatar
😉
Building Opkit

Sherwood Callaway shcallaway

😉
Building Opkit
View GitHub Profile
@shcallaway
shcallaway / README.md
Created July 26, 2019 00:37
Find a Kubernetes pod by its IP address
kubectl get po -o json | jq '.items[] | select(.status.podIP == "10.0.217.76") | .metadata.name'
@shcallaway
shcallaway / create-marqeta-webhook.sh
Created July 25, 2019 21:23
Create or update a Marqeta webhook
#!/bin/bash
read -p "Enter your Marqeta username: " MARQETA_USERNAME
read -p "Enter your Marqeta password: " MARQETA_PASSWORD
read -p "Enter your Marqeta subdomain: " MARQETA_SUBDOMAIN
read -p "Enter your webhook URL: " WEBHOOK_URL
read -p "What should this webhook be called? " WEBHOOK_NAME
read -p "What basic auth username will the webhook accept? " WEBHOOK_BASIC_AUTH_USERNAME
read -p "What basic auth password will the webhook accept? " WEBHOOK_BASIC_AUTH_PASSWORD
@shcallaway
shcallaway / README.md
Last active December 14, 2023 17:58
Scan logs archived from Datadog to an S3 bucket for a particular string

To run this in the background, and detach the process from your current shell:

$ GREP_ARGS=my-query OUTPUT=datadog-s3-log-scan.txt BUCKET=my-s3-bucket >stdout 2>stderr &
$ disown
@shcallaway
shcallaway / bastion.yaml
Created July 19, 2019 18:02
Kubernetes pod manifest for messing around in-cluster
apiVersion: v1
kind: Pod
metadata:
name: bastion
labels:
name: bastion
namespace: production
spec:
containers:
- name: bastion
@shcallaway
shcallaway / apply-ecr-repository-policy.sh
Created May 8, 2019 19:11
Apply the same repository policy to all ECR repositories
#!/bin/bash
aws ecr describe-repositories | jq '.repositories[].repositoryName' | xargs -I {} aws ecr put-repository-policy --repository-name {} --policy-text "file://policy.json"
@shcallaway
shcallaway / .bashrc
Last active September 5, 2019 00:33
Set up a new MacBook Pro
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
source $(brew --prefix)/etc/bash_completion.d/git-completion.bash
source <(kubectl completion bash)
source ~/.bash_completion
alias k=kubectl
alias g=git
alias d=docker
alias dc=docker-compose
@shcallaway
shcallaway / README.md
Created February 22, 2019 19:34
Bookmarklet for getting past digital publication paywalls

When creating a new browser bookmark, paste the following code snippet into the "Location" field:

javascript:(function(){window.location="https://outline.com/"+window.location;})();

Now visit an article that has a paywall, and click your bookmarklet!

@shcallaway
shcallaway / kubectl-cp.sh
Created January 23, 2019 23:06
Copy a file from a Kubernetes pod to local filesystem
#!/bin/bash
echo Namespace: $1
echo Pod: $2
echo Source file: $3
echo Target file: $4
kubectl cp $1/$2:$3 $4
@shcallaway
shcallaway / trees.py
Last active January 5, 2019 23:22
Python implementation of various types of trees
import contextlib
@contextlib.contextmanager
def raises(exception):
try:
yield
except exception as e:
assert True
else:
@shcallaway
shcallaway / README.md
Last active December 14, 2018 21:59
Download a CSV of Wealthfront's Career Launching Companies