Skip to content

Instantly share code, notes, and snippets.

@arpchaudhary
arpchaudhary / cloudtrail-freq.py
Created January 27, 2019 13:59
Utility file for getting Amazon S3 Usage from Cloudtrail logs
#!/usr/bin/env python
# This program would find the top n resources from a set of cloudtrail
# log files. Expects a local copy of the logs. You can do the same by:
# aws s3 sync s3://your.s3.cloudtrail.path /your/local/directory
#
# This script also expects the local AWS keys to deployed on the running machine
# Use this as your own caution
import argparse
@arpchaudhary
arpchaudhary / main.go
Last active July 12, 2018 13:10
Concurrent Hash Map in Go
package main
import (
"fmt"
"sync"
)
var (
PROC_MAP = struct {
sync.RWMutex
@arpchaudhary
arpchaudhary / Simple WorkerQueue with SafeClose
Created June 1, 2018 14:19
Simple Worker Co-ordination with Ranging over channel
package main
import (
"fmt"
"sync"
"time"
)
const (
DefaultChannelSize = 100