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 / rinkeby
Created October 20, 2017 23:57
Rinkeby Authenticated Faucet
0xCb412a89385F3bBD16545Ee767030bFfB3e1B6Df
@shcallaway
shcallaway / Dockerfile
Last active December 14, 2018 22:00
Fix "Python ImportError: No module named '_curses'"
FROM ubuntu
RUN apt-get update && apt-get install --assume-yes make wget gcc zlib1g:amd64 zlib1g-dev:amd64
# Uncomment the following line to make 'import curses' work
# RUN apt-get update && apt-get install -y libncursesw5-dev
ENV PYTHON_VERSION 3.6.1
RUN wget --quiet https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz && \
tar xzvf Python-$PYTHON_VERSION.tgz && \
cd Python-$PYTHON_VERSION && \
@shcallaway
shcallaway / generate-commit-log.sh
Last active October 3, 2018 17:37
Create a CSV of your commits in a certain git repository
#!/bin/bash
git log --pretty=format:'%h;%an;%ad;%s' --author='Sherwood Callaway' > ~/log.csv
@shcallaway
shcallaway / grep-jenkins-configs.sh
Last active February 4, 2019 20:38
Grep across all Jenkins configurations
#!/bin/bash
grep -Hni $1 ${JENKINS_HOME:-/var/jenkins_home}/**/*/config.xml
@shcallaway
shcallaway / counter.sh
Last active September 24, 2018 19:15
Stream stdout from a Python subprocess
#!/bin/bash
for i in `seq 1 10`; do
echo $i
if [ "$i" = "5" ]; then
>&2 echo "Error!"
exit 1
fi
@shcallaway
shcallaway / ecr-lifecycle-policy.json
Last active February 1, 2021 22:01
Lifecycle policy that caps prod and stage images at 25 each and all others at 75 for a total of 125
{
"rules": [
{
"rulePriority": 10,
"description": "Cap production images at 25.",
"selection": {
"tagStatus": "tagged",
"countType": "imageCountMoreThan",
"tagPrefixList": [
"prod"
@shcallaway
shcallaway / count-ecr-images.sh
Last active October 19, 2022 04:00
Count the number of images in an AWS ECR repository
#!/bin/bash
aws ecr list-images --repository-name $1 | jq '.imageIds | unique_by(.imageDigest) | length'
@shcallaway
shcallaway / apply-ecr-lifecycle-policy.sh
Last active May 30, 2023 07:00
Apply the same lifecycle policy to all AWS ECR repositories
#!/bin/bash
aws ecr describe-repositories | jq '.repositories[].repositoryName' | xargs -I {} aws ecr put-lifecycle-policy --repository-name {} --lifecycle-policy-text "file://policy.json"
@shcallaway
shcallaway / README.md
Last active December 14, 2018 21:59
Download a CSV of Wealthfront's Career Launching Companies