Skip to content

Instantly share code, notes, and snippets.

View mgla's full-sized avatar
🎯
Focusing

Maik Glatki mgla

🎯
Focusing
View GitHub Profile

Random useful Athena queries

CloudTrail

Find out who modified a IAM user policy

SELECT eventname,
         useridentity.arn,
         sourceIPAddress,

eventtime,

@victoriadrake
victoriadrake / lambda-rss-tweeter.go
Last active April 7, 2020 04:11
Tweet RSS feed links for AWS Lambda
package main
import (
"math/rand"
"net/url"
"os"
"time"
"github.com/ChimeraCoder/anaconda"
"github.com/Sirupsen/logrus"
Resources:
Service:
Type: AWS::ECS::Service
DependsOn: ListenerRule
Properties:
Cluster: !Ref Cluster
ServiceName: !Ref ServiceName
LaunchType: !Ref LaunchType
DesiredCount: !Ref DesiredCount
DeploymentConfiguration:
@chrisdpa-tvx
chrisdpa-tvx / athena.rst
Last active March 20, 2022 06:28
Create an Athena database, table, and query

All Your Data Does Not Belong In a Database

Businesses are machines producing mountains of data about sales, usage, customer, costs, etc... Traditionally data processing is highly centralised with teams of staff and computer running hot a whirling ready to process. We can do better than moving the mountain of data into the corporate data machine - so long as that machinary is light enough to be moved to the data.

Don't move the mountain - Bring the processing to the data

We've had this problem; a huge directory of files in CSV format, conataining vital information for our business. But it's in CSV, requires analysis, and don't you don't feel like learning sed/grep/awk today - besides it's 2017 and no-one thinks those tools are easy to use.

@zenmaster24
zenmaster24 / snapshot.py
Created May 4, 2017 23:32
basic lambda for creating a snapshot of all volumes attached to an instance with tag "snapshot:yes"
import boto3
import json
import datetime
import time
ec2 = boto3.resource('ec2', region_name='ap-southeast-2')
filters = [{
'Name': 'tag:snapshot',
'Values': [ 'yes' ]
}]
@sjparkinson
sjparkinson / RDS-Aurora-CloudFormation-Example.yaml
Last active May 10, 2022 10:43
A basic CloudFormation template for an RDS Aurora cluster.
---
AWSTemplateFormatVersion: 2010-09-09
Description: >
A basic CloudFormation template for an RDS Aurora cluster.
Parameters:
DatabaseUsername:
AllowedPattern: "[a-zA-Z0-9]+"
ConstraintDescription: must be between 1 to 16 alphanumeric characters.
@badboy
badboy / vennbahn-longboard.json
Created June 9, 2016 13:29
Longboard-Tour über die Vennbahn. Von Kornelimünster bis Aachen.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@OnlyInAmerica
OnlyInAmerica / find_iam_user.py
Created April 3, 2014 22:52
Find an AWS IAM user corresponding to an AWS Access Key
# Find the IAM username belonging to the TARGET_ACCESS_KEY
# Useful for finding IAM user corresponding to a compromised AWS credential
# Requirements:
#
# Environmental variables:
# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
# python:
# boto
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
__all__ = ["transform"]
__version__ = '0.3'
__author__ = 'Christoph Burgmer <cburgmer@ira.uka.de>'
__url__ = 'http://github.com/cburgmer/upsidedown'
@patrickwelker
patrickwelker / jekyll-localized-date
Created September 18, 2012 13:09
Localized date via replace in Jekyll (Example: German)
<time datetime="{{ post.date | %Y-%m-%d %H:%M+01:00 }}">
{{ post.date | date: "%d. %B %Y" | replace:"January","Januar" | replace:"Februar","February" | replace:"March","März" | replace:"May","Mai" | replace:"June","Juni" | replace:"July","Juli" | replace:"December","Dezember" }}
</time>