This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| ''' | |
| This script sets a retention on all the logGroups that don't have one set | |
| ''' | |
| import boto3 | |
| import logging | |
| # Retention it will be set to | |
| RETENTION = 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/json" | |
| "flag" | |
| "fmt" | |
| "github.com/gobike/envflag" | |
| "github.com/smartystreets/go-aws-auth" | |
| "io/ioutil" | |
| "log" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "flag" | |
| "github.com/gobike/envflag" | |
| "github.com/smartystreets/go-aws-auth" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| "net/url" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aws rds describe-db-instances --query 'DBInstances[].{ID:DBInstanceIdentifier,Class:DBInstanceClass,DB:DBName,User:MasterUsername,EP:Endpoint,Engine:Engine,ClusterID:DBClusterIdentifier,Created:InstanceCreateTime}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/json" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "net/url" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/json" | |
| "flag" | |
| "io/ioutil" | |
| "log" | |
| "github.com/aws/aws-sdk-go/aws" | |
| "github.com/aws/aws-sdk-go/aws/credentials" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "flag" | |
| "io/ioutil" | |
| "log" | |
| "time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/json" | |
| "flag" | |
| "io/ioutil" | |
| "log" | |
| "github.com/gobike/envflag" | |
| "github.com/sethvargo/go-fastly" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo lsof -n -F 'Lp'| awk 'BEGIN{pid=0; user=""};{if(match($0, /^p([0-9]*)$/, d)){pid=d[1]} if(match($0, /^L(.*)$/,d)){user=d[1]} if(match($0, /^f(.*)$/)){a[sprintf("%s\tpid: %d",user, pid)]++}} END {for (i in a) print a[i], "\tuser: ", i}' | sort -n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "crypto/tls" | |
| "fmt" | |
| "gopkg.in/ldap.v2" | |
| "log" | |
| ) | |
| // Of course, this is to give an idea of what should be in those variables, but this should end up in environment variables or flags and should not be stored inside the script! |