Skip to content

Instantly share code, notes, and snippets.

View andreivmaksimov's full-sized avatar
💭
Life style - NO LIMITS

Andrei Maksimov andreivmaksimov

💭
Life style - NO LIMITS
View GitHub Profile
@rowanu
rowanu / function-and-log-group.yaml
Last active March 19, 2021 12:38
Clean up a Lambda function's logs when you delete it
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
InlineCode: |
exports.handler = async () => {
@pahud
pahud / delete_all_awslogs.sh.md
Last active October 18, 2023 09:13
delete all aws log groups

specify the region

export AWS_DEFAULT_REGION=ap-northeast-1
aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | \
awk '{print $2}' | grep -v ^$ | while read x; do  echo "deleting $x" ; aws logs delete-log-group --log-group-name $x; done

only delete loggroup name starting with /aws/lambda

@ipmb
ipmb / cloudwatch_sysstats.py
Created March 3, 2017 03:59
Send system stats to AWS Cloudwatch with Python
# -*- coding: utf-8 -*-
import os
# pip install boto3 psutil requests
import boto3
import psutil
import requests
NAMESPACE = 'Sys'
os.environ.setdefault('AWS_DEFAULT_REGION', 'us-east-1')
@bkeating
bkeating / howto-filemerge-git-osx.md
Created March 11, 2010 21:36
HOWTO: Using FileMerge (opendiff) with Git on OSX

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.