Skip to content

Instantly share code, notes, and snippets.

View jesperalmstrom's full-sized avatar
⛷️
more snow

Jesper Almstrom jesperalmstrom

⛷️
more snow
View GitHub Profile
@jesperalmstrom
jesperalmstrom / automatic_invoice.gs
Last active September 16, 2021 13:05 — forked from automagictv/automatic_invoice.gs
Apps Script code to automatically replace template variables in your invoice document.
///////////////////////////////////////////////////////////////////////////////////////////////
// BEGIN EDITS ////////////////////////////////////////////////////////////////////////////////
const TEMPLATE_FILE_ID = 'YOUR_TEMPLATE_FILE_ID_HERE';
const DESTINATION_FOLDER_ID = 'YOUR_DESTINATION_FOLDER_ID_HERE';
const CURRENCY_SIGN = 'Kr';
// END EDITS //////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
// WARNING: EDITING ANYTHING BELOW THIS LINE WILL CHANGE THE BEHAVIOR OF THE SCRIPT. //////////
@jesperalmstrom
jesperalmstrom / Autotag Role
Last active November 28, 2019 14:20 — forked from jmturwy/Autotag Role
AWS - AutoTag Snapshot's from Cloudwatch
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"cloudtrail:LookupEvents",
"ec2:CreateTags",
"ec2:Describe*",
"logs:CreateLogGroup",
"logs:CreateLogStream",
@jesperalmstrom
jesperalmstrom / Python Boto3 script to clean out tons of CUR files
Last active November 5, 2019 10:28
Remove deprecated Cost and Usage Report objects from S3 bucket
#!/usr/bin/python
# Usage for a AWS test profile:
# python scriptname.py test | less
import boto3
import botocore.session
import argparse
import json
# define some colors
@jesperalmstrom
jesperalmstrom / s3_bucket_stats.py
Last active September 19, 2019 09:04 — forked from rwiggins/s3_bucket_stats.py
Lists the storage size (for all storage types) and tags of all S3 buckets in an account using CloudWatch's GetMetricStatistics. Uses the default AWS credentials in your environment. (See awscli configuration for more information.). Add your profile as a argument when running.
import boto3
import botocore
import datetime
import progressbar
import itertools
import argparse
# from https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html
STORAGE_TYPES = [
"StandardStorage",