Skip to content

Instantly share code, notes, and snippets.

View wanieldilson's full-sized avatar
👋
Hello!

Daniel Wilson wanieldilson

👋
Hello!
View GitHub Profile
@wanieldilson
wanieldilson / README.md
Created December 12, 2023 14:00
Docker multi arch build and push

Conditional Docker Build and Push with terraform

How to use

Save your dockerfile in a folder called images, this terraform code will build and push a multi-archtecture image to ECR. Whenever you update the Dockerfile and associated image tag, the null resource will be triggered to "re-create" subsequently updating the image in ECR.

But I've made a change and want to keep the same tag

Then simply run terraform apply -replace=null_resource.build_and_push ,- don't forget to use the full resource address if this code is inside a module. E.g module.name.null_resource.build_and_push.

@wanieldilson
wanieldilson / README.md
Last active January 26, 2023 15:57
Generate AWS client vpn config file

Usage

Run python3 generate_vpn_profile.py $your_domain_name $name_for_parameter_store_entry

The script will find a certificate based on the domain name you supplied as a command line argument. It will extract the cert and private key and insert them into an exported client VPN profile.

It will then upload the configuration file contents and the private key passphrase to AWS SSM Parameter store as SecureStrings

@wanieldilson
wanieldilson / hirst.py
Last active November 10, 2022 09:46
Damien Hirst style dot painting generator (100 days of code). Simply run the .Py file to generate your own unique work of art!
import random
from turtle import Turtle, Screen, colormode
dot_colors = [(199, 175, 117), (124, 36, 24), (210, 221, 213), (168, 106, 57),
(222, 224, 227), (186, 158, 53), (6, 57, 83), (109, 67, 85),
(113, 161, 175), (22, 122, 174), (64, 153, 138), (39, 36, 36),
(76, 40, 48), (9, 67, 47), (90, 141, 53), (181, 96, 79), (132, 40, 42),
(210, 200, 151), (141, 171, 155), (179, 201, 186), (172, 153, 159),
(212, 183, 177), (176, 198, 203)]
@wanieldilson
wanieldilson / turtle_graphics.py
Created November 9, 2022 14:39
Turtle Graphics testing as part of 100 days of code
import turtle
from turtle import Turtle, Screen, colormode
import random
turtle.colormode(255)
jim = Turtle()
jim.shape("turtle")
jim.color("DarkOliveGreen")
jim.speed("fastest")
@wanieldilson
wanieldilson / coffeeMachine.py
Last active November 7, 2022 09:35
Coffee Machine 100 days of code
import time
MENU = {
"espresso": {
"ingredients": {
"water": 50,
"milk": 0,
"coffee": 18,
},
"cost": 1.5,