Skip to content

Instantly share code, notes, and snippets.

View bfrancom's full-sized avatar
Power wheels, power wheels, pow-pow-power wheels!

Ben Francom bfrancom

Power wheels, power wheels, pow-pow-power wheels!
View GitHub Profile
bfrancom / web.conf
Last active January 3, 2024 20:35
cloud-init example
## Install additional packages on first boot
## Default: none
## if packages are specified, this apt_update will be set to true
## packages may be supplied as a single package name or as a list
## with the format [<package>, <version>] wherein the specifc
bfrancom / matrix.yml
Created July 25, 2023 00:54
How to reference node version more easily
version: [18]
- uses: actions/setup-node@v3
node-version: ${{ matrix.version }}
bfrancom /
Created July 14, 2023 14:20
replace a URL for an image
while IFS= read -r line
bob=$(basename $line)
find . -type f -exec sed -i '' -e "s,$line,/images/old/$bob,g" {} \;
done < "$input"
#while read line
#find . -type f -exec sed -e "s/$line/2010/g" {} \;;done < /tmp/realImages.txt
bfrancom /
Last active April 27, 2023 14:08
Get all environment variables with URI's in Kubernetes to find 3rd party services used
#should get all uri's (including url's) for things like s3, postgres, ftp, etc.
kubectl get pods --all-namespaces -o=jsonpath='{range .items[*]}{.spec.containers[*].env[*].value}{"\n"}{end}' |grep -io "[[:alnum:]]*://[^ ]*" |sort |uniq
bfrancom /
Last active March 21, 2023 20:25
Microsoft Graph search groups by name$search="displayName:YourMom"&$select=id,displayName
#need to add a request header ConsistencyLevel:eventual
bfrancom / Dockerfile
Last active March 7, 2023 15:34
Dockerfile for building java app in GitHub actions and deploying to AWS ECS/Fargate
#See for deploying this docker container on ECS Fargate
FROM openjdk:8-jdk-slim as builder
#WORKDIR build
RUN mkdir target
ARG JAR_FILE=./target/*.jar
COPY ${JAR_FILE} target/app.jar
#You probably don't want to do this in production, and should tune memory, gc, etc.
ENTRYPOINT ["java","-jar","/target/app.jar"]
bfrancom / build-jar-deploy-ecs-fargate.yml
Last active March 7, 2023 15:35
GitHub actions build Java jar and deploy to AWS ECS Fargate
#See for Dockerfile used
#Author: Ben Francom
name: Build
#on: workflow_dispatch
- "main"
bfrancom /
Last active March 7, 2023 18:12
Get direct reports of manager from Microsoft Graph API filtered by name and email.
#Get users under a manager using MS graph query. Uses select filter for displayName and email address
#Use this query in$select=displayName,mail
bfrancom /
Last active February 24, 2023 22:15
Quick one liner to get AWS users in an account
aws iam list-users --query 'Users[*].UserName'