Skip to content

Instantly share code, notes, and snippets.

View Pelirrojo's full-sized avatar
🤷‍♂️
Somewhere I have to keep my test code

Manuel Eusebio de Paz Carmona Pelirrojo

🤷‍♂️
Somewhere I have to keep my test code
View GitHub Profile
async def generate_blurred(
image_path: str,
output_path: str,
original_filename: str,
original_extension: str,
faces_detail: dict,
ids_requested: dict,
) -> str:
image = Image.open(image_path)
imgWidth, imgHeight = image.size
import boto3
# Cacheable references
rekognition = boto3.client("rekognition")
# Function to call Amazon Rekognition and detect faces in an image
async def detect_faces(image_path):
"""Count the number of faces in one app"""
with open(image_path, "rb") as image_file:
@Pelirrojo
Pelirrojo / locals-eks.tf
Created April 21, 2023 16:56
EKS Blueprints Example 3
# Complete file at https://github.com/Cloud-DevOps-Labs/kubernetes-in-aws-the-easy-way/blob/workshop/IaC/locals.tf
locals {
name = basename(path.cwd)
region = data.aws_region.current.name
cluster_version = "1.23"
vpc_cidr = "10.0.0.0/16"
azs = slice(data.aws_availability_zones.available.names, 0, 3)
@Pelirrojo
Pelirrojo / main-k8s-addons.tf
Created April 21, 2023 16:47
EKS Blueprints Example 2
# Complete file at: https://github.com/Cloud-DevOps-Labs/kubernetes-in-aws-the-easy-way/blob/workshop/IaC/main.tf
################################################################################
# Kubernetes addons
################################################################################
module "kubernetes_addons" {
source = "github.com/aws-ia/terraform-aws-eks-blueprints?ref=v4.28.0/modules/kubernetes-addons"
@Pelirrojo
Pelirrojo / main-eks-blueprints.tf
Created April 21, 2023 16:47
EKS Blueprints Example 1
# Complete file at: https://github.com/Cloud-DevOps-Labs/kubernetes-in-aws-the-easy-way/blob/workshop/IaC/main.tf
################################################################################
# EKS Blueprints Setup
################################################################################
module "eks_blueprints" {
source = "github.com/aws-ia/terraform-aws-eks-blueprints?ref=v4.28.0"
# EKS Cluster VPC and Subnet mandatory config
@Pelirrojo
Pelirrojo / main.tf
Last active September 20, 2022 22:41
Iac Terraform Template for creating an AWS S3 Bucket
# terraform.tf
terraform {
required_version = ">= 1.2.5"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.22.0"
}
}
@Pelirrojo
Pelirrojo / cloudformation-s3-bucket-example.yaml
Last active September 20, 2022 21:54
Iac Cloudformation Template for creating an AWS S3 Bucket
AWSTemplateFormatVersion: 2010-09-09
Resources:
S3Bucket:
Type: AWS::S3::Bucket
DeletionPolicy: Retain
Properties:
AccessControl: Private
BucketName: !Sub
- custom-bucket-name-${AccountID}
@Pelirrojo
Pelirrojo / mic_no_check.sh
Created December 19, 2021 22:17
Raspberry PI raspiaudio hat > MIC+ installation guide
#!/bin/bash
# https://forum.raspiaudio.com/t/mic-installation-guide/17/30
: <<'DISCLAIMER'
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
@Pelirrojo
Pelirrojo / REAME.md
Last active April 11, 2021 20:33
Ubuntu k3s manual registration as daemon
@Pelirrojo
Pelirrojo / gui-disable
Created April 7, 2021 22:23
How to boot Jetson Nano in text mode?
#!/usr/bin/env bash
sudo systemctl set-default multi-user.target
echo "\n▂▃▅▇█▓▒░ Mission Accomplished ░▒▓█▇▅▃▂\n"