Skip to content

Instantly share code, notes, and snippets.

@iotspace
iotspace / all_aws_lambda_modules_python.md
Created June 24, 2020 13:52 — 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

@iotspace
iotspace / parsing_lambda_logs.py
Created June 24, 2020 17:58 — forked from GabrielSGoncalves/parsing_lambda_logs.py
Function to parse Lambda logs on CloudWatch using boto3
def parsing_lambda_logs(RequestId, GroupName , StreamName):
"""
Function that parses Lambda Logs on CloudWatch using boto3
Parameters:
===========
RequestId (str): Unique identifier for each AWS Lambda call
GroupName (str): Name of the Lambda Function group on CloudWatch
StreamName (str): Name of the log stream for the Function container
@iotspace
iotspace / pipenv_cheat_sheet.md
Created June 25, 2020 07:05 — forked from bradtraversy/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell

Tested only on Ubuntu 18.04 and KDE Neon User Edition (based on Ubuntu 18.04).

will probably work on other newer versions, with no changes, or with few changes in non-python dependencies (apt-get packages)

NOTE: Don't create a .sh file and run it all at once. It will not work. Copy, paste, and execute each command below manually. :-)

Ubuntu

# DO NOT RUN THIS AS A ROOT USER
@iotspace
iotspace / markdown
Created September 22, 2020 03:50 — forked from joshuapekera/markdown
Markdown Cheat Sheet
This is intended as a quick reference and showcase. For more complete info, see [John Gruber's original spec](http://daringfireball.net/projects/markdown/) and the [Github-flavored Markdown info page](http://github.github.com/github-flavored-markdown/).
This cheatsheet is specifically *Markdown Here's* version of Github-flavored Markdown. This differs slightly in styling and syntax from what Github uses, so what you see below might vary a little from what you get in a *Markdown Here* email, but it should be pretty close.
You can play around with Markdown on our [live demo page](http://www.markdown-here.com/livedemo.html).
##### Table of Contents
[Headers](#headers)
[Emphasis](#emphasis)
[Lists](#lists)
@iotspace
iotspace / logging.py
Created September 30, 2020 08:02 — forked from kingspp/logging.py
Python Comprehensive Logging using YAML Configuration
import os
import yaml
import logging.config
import logging
import coloredlogs
def setup_logging(default_path='logging.yaml', default_level=logging.INFO, env_key='LOG_CFG'):
"""
| **@author:** Prathyush SP
| Logging Setup
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:*",
"lambda:*",
"cloudformation:*",
"sns:CreateTopic",
@iotspace
iotspace / Python 3 Virtualenv
Created November 19, 2020 13:20 — forked from ehbc221/Python 3 Virtualenv
Install Python 3 and create a virtual environment for projects
# Install Python 3
$ sudo apt-get install python3
# Install python3-virtualenv
$ sudo apt-get install python3-virtualenv
# You can checkout you virtualenv version
$ virtualenv --version
# Create you virtualenv in the folder you that want to
AWSTemplateFormatVersion: "2010-09-09"
Description: "Static website hosting with S3 and CloudFront"
Parameters:
BucketName:
Type: String
Default: "a-proper-bucket-name"
Resources:
# Create the bucket to contain the website HTML
@iotspace
iotspace / example-api-gateway.yaml
Created December 8, 2020 06:14 — forked from elerch/example-api-gateway.yaml
YAML version of tmaslen's API Gateway cloudformation template - useful when you don't want to use SAM
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Sample template that contains a Lambda function behind an API GW
Resources:
# BEGIN: Should only need this in an empty API Gateway situation
ApiGatewayCloudWatchLogsRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'