sudo yum install go git
cd ${GOPATH-$HOME/go}/src/github.com/prometheus/node_exporter
go get github.com/prometheus/node_exporter
sudo yum install glibc-static
make
Limits
- Aphelion is used to collect AWS limits across multiple accounts. It uses a combination of Trusted Advisor (TA) as well as direct resource APIs to collect limits for most of the AWS resources where the limit is either in TA, or the particular service exposes the current limit values via API calls https://github.com/FINRAOS/aphelion
CloudFormation
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
cat iprange.json | jq '.prefixes[] | select (.ip_prefix | contains( "/25") ) | .ip_prefix + " " + .region + " " + .service' |sort -u | uniq -c |
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 pricing get-products --service-code AmazonRDS --region us-east-1 >/tmp/pp.json | |
cat /tmp/pp.json | jq '.PriceList[] | fromjson' >/tmp/ppp.json | |
cat /tmp/pp.json | jq '.PriceList[] | fromjson' >/tmp/ppp.json | |
cat /tmp/ppp.json | jq '.|select(.product.attributes.databaseEngine == "MariaDB" and .product.attributes.location =="EU (Ireland)" and .product.attributes.instanceType == "db.m4.large") | .terms.OnDemand' | more |
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
ES_HOST=search-4ptw5ao4ierg.eu-west-1.es.amazonaws.com | |
INDEXTODELETEEXPR=cwl-2017 | |
curl -XGET https://$ES_HOST/_all/ | jq 'reduce path(.[]?) as $path (.; setpath($path; {}))' > /tmp/indexlist.txt | |
cat /tmp/indexlist.txt | grep $INDEXTODELETEEXPR | cut -d\" -f2 | while read a | |
do | |
curl -XDELETE https://$ES_HOST/$a | |
done |
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
with open('audit.log.1.2018-03-01-15-57.0', 'rb') as csvfile: | |
csvreader = csv.reader(csvfile, | |
delimiter=',', | |
quotechar='\'') | |
for n, row in enumerate(csvreader): | |
print n, row | |
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
import urllib2 | |
import logging | |
def wget(urltxt): | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
attempts = 0 | |
while attempts < 3: | |
try: | |
response = urllib2.urlopen(urltxt, timeout = 5) | |
content = response.read() |
If you have problems when downloading large results sets from reDash it may be you are running against the default 30 seconds timeout in gunicorn. To solve this you can edit your:
/opt/redash/supervisord/supervisord.conf
and change:
[program:redash_server]
command=/opt/redash/current/bin/run gunicorn -b 127.0.0.1:5000 --name redash -w 4 redash.wsgi:app
If you have problems when downloading large results sets from reDash it may be you are running against the default 30 seconds timeout in gunicorn. To solve this you can edit your:
/opt/redash/supervisord/supervisord.conf
and change:
[program:redash_server]