Skip to content

Instantly share code, notes, and snippets.

@mbuotidem
mbuotidem / serverlessca.sh
Created April 5, 2025 19:47
Setup subdirectories and required files for ServerlessCA
mkdir -p certs/dev/csrs && for f in revoked-root-ca revoked tls; do echo "[]" > certs/dev/$f.json; done
@mbuotidem
mbuotidem / get-all-actions.py
Created October 12, 2024 16:05 — forked from rowanu/get-all-actions.py
Get all AWS IAM actions
import requests
import json
def fetch_json(url):
response = requests.get(url)
return response.json()
def main():
@mbuotidem
mbuotidem / devcontainer.json
Last active September 8, 2024 17:37
minimal devcontainer for aws terraform - #.devcontainer/devcontainer.json
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {
"ghcr.io/devcontainers/features/terraform:1": {
"tflint":"none",
"installTFsec": "true",
"terragrunt": "none"
},
"ghcr.io/devcontainers/features/aws-cli:1": {}
},

APISIX mTLS for client to APISIX

Introduction

This gist provides a complete example of client-side authentication for Apache APISIX.

It includes the process of:

  • generating a certificate
  • configuring the certificate in APISIX
  • configuring the route in APISIX
@mbuotidem
mbuotidem / install-docker.md
Created November 25, 2022 01:38 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@mbuotidem
mbuotidem / gist:0ab5c58840b38a70d12d9817208b29f3
Created April 24, 2022 17:05 — forked from mikepfeiffer/gist:7c949e2d04c9e51ef204fb9a7f3d2978
Userdata script to setup a basic web page with instance id and tag instance
#!/bin/bash
yum install httpd -y
/sbin/chkconfig --levels 235 httpd on
service httpd start
instanceId=$(curl http://169.254.169.254/latest/meta-data/instance-id)
region=$(curl http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')
echo "<h1>$instanceId</h1>" > /var/www/html/index.html
aws ec2 create-tags --resources "$instanceId" --tags Key=Name,Value="PROD-$instanceId" --region "$region"
@mbuotidem
mbuotidem / Penn Treebank II Tags.md
Created December 29, 2021 20:52 — forked from nlothian/Penn Treebank II Tags.md
Penn Treebank II Tags
@mbuotidem
mbuotidem / pegasus_fine_tune.py
Created October 28, 2021 03:58 — forked from jiahao87/pegasus_fine_tune.py
Pytorch script for fine-tuning Pegasus Large model
"""Script for fine-tuning Pegasus
Example usage:
# use XSum dataset as example, with first 1000 docs as training data
from datasets import load_dataset
dataset = load_dataset("xsum")
train_texts, train_labels = dataset['train']['document'][:1000], dataset['train']['summary'][:1000]
# use Pegasus Large model as base for fine-tuning
model_name = 'google/pegasus-large'
train_dataset, _, _, tokenizer = prepare_data(model_name, train_texts, train_labels)
@mbuotidem
mbuotidem / Jenkinsfile
Created August 14, 2021 21:21 — forked from gazoakley/Jenkinsfile
Jenkinsfile for running Terraform
pipeline {
agent any
parameters {
string(name: 'environment', defaultValue: 'default', description: 'Workspace/environment file to use for deployment')
string(name: 'version', defaultValue: '', description: 'Version variable to pass to Terraform')
booleanParam(name: 'autoApprove', defaultValue: false, description: 'Automatically run apply after generating plan?')
}
environment {
@mbuotidem
mbuotidem / WindowsTerminal.md
Created March 23, 2021 20:42 — forked from dahlsailrunner/WindowsTerminal.md
Customization and Setup notes for Windows Terminal