Skip to content

Instantly share code, notes, and snippets.

@vrvrr
vrvrr / postgres_manager.py
Created August 31, 2022 16:11 — forked from valferon/postgres_manager.py
Python script to take care of postgres backup and restore of data
#!/usr/bin/python3
import argparse
import logging
import subprocess
import os
import tempfile
from tempfile import mkstemp
import configparser
import gzip
@vrvrr
vrvrr / del_empty_log_streams.py
Created August 9, 2022 17:06 — forked from shouptech/del_empty_log_streams.py
Delete empty log streams from AWS CloudWatch Logs
#!/usr/bin/env python
"""
This script deletes empty log streams from cloudwatch log groups.
Your shell should be configured for connecting to the AWS API. This can be done
with the CLI command `aws configure`.
This script requires Python 3.6 or newer, and you must have boto3 installed.
"""
@vrvrr
vrvrr / DescribeExportTask.py
Created July 28, 2022 14:38 — forked from sakamaki-kazuyoshi/DescribeExportTask.py
Export CloudWatch Logs with Step Functions
import boto3
import logging
logs_client = boto3.client('logs')
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
task_id = event['iterator']['task_id']
@vrvrr
vrvrr / all_aws_lambda_modules_python.md
Created December 14, 2020 13:58 — forked from gene1wood/all_aws_lambda_modules_python.md
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7

This gist contains lists of modules available in

in AWS Lambda.

It also contains the code to run in Lambda to generate these lists. In addition there is a less_versbose module in the code that you can call to get a list of the top level modules installed and the version of those modules (if they contain a version

@vrvrr
vrvrr / ssm_parameter_store.py
Created March 30, 2020 16:23 — forked from nqbao/ssm_parameter_store.py
Python class to provide a dictionary-like interface to access AWS SSM Parameter Store easily
# Copyright (c) 2018 Bao Nguyen <b@nqbao.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all