Skip to content

Instantly share code, notes, and snippets.

View t04glovern's full-sized avatar
🎯
Watching Speed-runs while i code

Nathan Glover t04glovern

🎯
Watching Speed-runs while i code
View GitHub Profile
import os
import openai
import json
import frontmatter
import time
import requests
# pip install python-frontmatter requests openai
openai.api_key = os.getenv("OPENAI_API_KEY")
@t04glovern
t04glovern / github-action-bot.yml
Last active October 20, 2022 03:06
GitHub Bot User - Comment/Update Comment on PR
name: Workflow
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
ci:
@t04glovern
t04glovern / github-action-example.yml
Last active August 4, 2023 14:03
Run thumbprint.sh to deploy the provider.yml file into each of your managed AWS accounts. This creates an OIDC Provider that a template like the oidc-role-example.yml can use to create a role. This role can then be assume by your GitHub action
name: OIDC Example action
on:
workflow_dispatch:
push:
branches:
- main
jobs:
example:
@t04glovern
t04glovern / amazon-workmail-export.yml
Last active June 8, 2022 15:14
Roles and Resources required to export Amazon WorkMail content programmatically
AWSTemplateFormatVersion: 2010-09-09
Description: Roles and Resources required to export Amazon WorkMail content programmatically
Resources:
WorkMailExportBucket:
Type: AWS::S3::Bucket
WorkMailExportBucketKey:
Type: AWS::KMS::Key
DeletionPolicy: Retain
@t04glovern
t04glovern / greengrassv2-deploy.yml
Created May 3, 2022 02:41
Github Action Deploy AWS Greengrass v2
name: Component deploy
on:
repository_dispatch:
push:
branches:
- main
jobs:
@t04glovern
t04glovern / build.sh
Created May 1, 2022 16:37
AWS Greengrass Development Kit Example
python3 -m pip install -U git+https://github.com/aws-greengrass/aws-greengrass-gdk-cli.git@v1.1.0
gdk component build
gdk component publish
@t04glovern
t04glovern / playbook.yml
Created April 26, 2022 13:52
Ansible ignore all future tasks for unreachable hosts
---
- name: Identify reachable hosts
hosts: all
connection: local
gather_facts: false
tasks:
- block:
- name: determine hosts that are reachable
ansible.builtin.wait_for_connection:
@t04glovern
t04glovern / .bash_profile
Created March 2, 2022 04:01
Windows Subsystem for Linux: never prompt ssh passphrase again
# Auto start keychain
eval $(/usr/bin/keychain --eval --quiet id_rsa)
@t04glovern
t04glovern / stackset-deployer.sh
Last active July 7, 2021 07:35
AWS CloudFormation Stackset Update/Create 1-click deploy - w/ ControlTower support
#!/bin/bash
STACKSET_NAME="template-us-west-2-shared-services"
STACKSET_REGION="us-west-2"
STACKSET_DEPLOYMENT_REGIONS="us-west-2"
STACKSET_DEPLOYMENT_ACCOUNTS="123456789012"
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
STACK_STATE=$(aws cloudformation describe-stack-set --stack-set-name "$STACKSET_NAME" --region "$STACKSET_REGION" --query "StackSet.StackSetName" 2>/dev/null)
if [ -z "$STACK_STATE" ]
@t04glovern
t04glovern / setup.sh
Created May 1, 2020 12:54
michalgutowski/cka-lab Bootstrap
# on ckamaster1
sudo -i
apt install docker.io kubeadm=1.15.1-00 kubectl=1.15.1-00 kubelet=1.15.1-00
kubeadm init --config=kubeadm-config.yaml --upload-certs| tee kubeadm-init.out
## OUTPUT
# kubeadm join ckamaster:6443 --token 4gttsi.cpkvihy9jwb8o8aq \
# --discovery-token-ca-cert-hash sha256:c70ef81c9dd7064432a255b9f617e8c3c83b4cce64db17e2518c32b0e3aaf460
exit
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config