Skip to content

Instantly share code, notes, and snippets.

View iainelder's full-sized avatar

Iain Samuel McLean Elder iainelder

View GitHub Profile
@heitorlessa
heitorlessa / app.py
Last active February 11, 2025 16:44
Discord Powertools for AWS Lambda - Parsing EventBridge ECS Task State Change event
from __future__ import annotations
from typing import List, Optional
from aws_lambda_powertools.utilities.parser.models import EventBridgeModel
from aws_lambda_powertools.utilities.parser.envelopes import (
EventBridgeEnvelope, # only if you want to discard EventBridge metadata
)
from aws_lambda_powertools.utilities.parser.parser import event_parser
from pydantic import BaseModel
@atheiman
atheiman / Cfn-Stack.yml
Last active November 6, 2024 11:46
Run command across accounts and regions with SSM
AWSTemplateFormatVersion: '2010-09-09'
Description: >
SSM Automation Document run a custom SSM Command Document
against a fleet of target instances.
Parameters:
AutomationDocumentName:
Type: String
Description: Name of created SSM Automation Document
Default: MyAutomation
@zcapper
zcapper / aws-logs-glue.yaml
Last active September 11, 2023 14:59
This is a CloudFormation template that creates AWS Glue tables for your AWS logs so you can easily query your ELB access logs and CloudTrails in AWS Athena
AWSTemplateFormatVersion: 2010-09-09
Parameters:
LoggingBucket:
Description: The name of the S3 bucket that contains your AWS logs
Type: String
Resources:
GlueDatabase:
Type: AWS::Glue::Database
@mrcomoraes
mrcomoraes / clear_cache_MS_Teams.sh
Last active May 10, 2024 12:07
Clear cache Microsoft Teams on Linux
#!/bin/bash
# This script cleans all cache for Microsoft Teams on Linux
# Tested on Ubuntu-like, Debian by @necrifede, Arch Linux by @lucas-dclrcq and Manjaro with flatpak by @danie1k. Feel free to test/use in other distributions.
# Tested Teams via snap package.
# Tested Teams via flatpak package.
#
# How to use in terminal:
# ./clear_cache_MS_Teams.sh ( deb-stable | deb-insider | snap | flatpak )
# or
@justinvanwinkle
justinvanwinkle / broken.py
Last active February 19, 2025 12:40
Every python rate-limiting library (that I can find) is broken, at least a little.
# I was looking for a rate limiting library to call rate limited apis as closely
# as possible to their enforced limits. I looked at the first few python libraries
# that I found, and when I glanced at the source, they were all clearly broken.
# Curious how this could be, I took all the top google and pip search results for: python rate limiting
# and tried to get them to do the wrong thing and fail to rate limit in situations that could come up
# in normal use (though in some cases very specific use)
# https://github.com/tomasbasham/ratelimit
# Where broken:
@pkazi
pkazi / cloudTrailEventNames.list
Last active February 8, 2025 07:28
List of values for parameter EventName in AWS Cloudtrail events
AbortDocumentVersionUpload
AbortEnvironmentUpdate
AbortMultipartUpload
AbortVaultLock
AcceptAccountMapping
AcceptCertificateTransfer
AcceptDelegate
AcceptDirectConnectGatewayAssociationProposal
AcceptFxPaymentCurrencyTermsAndConditions
AcceptHandshake
@karlhorky
karlhorky / .yarnrc
Last active December 15, 2024 11:21
Configure Yarn's --silent flag with .yarnrc configuration file
--silent true
@weavenet
weavenet / console.py
Last active August 5, 2023 17:57
Python script to assume STS role and generate AWS console URL.
#!/usr/bin/env python
import getpass
import json
import requests
import sys
import urllib
import boto3
@Treer
Treer / gist:c7d7e33289b725dfb9d07718f6153a9d
Created December 11, 2016 13:18
Find most active fork of a github project
http://forked.yannick.io/
@graste
graste / strace.md
Last active October 30, 2024 04:48
strace process for network and memory and other syscalls

File activity

strace -e trace=file -fp PID (file) or strace -e trace=desc -fp PID (file descriptors)

Common calls:

  • access
  • close – close file handle
  • fchmod – change file permissions
  • fchown – change file ownership