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
| # -*- coding: utf-8 -*-\ | |
| """ | |
| The MIT License (MIT) | |
| Copyright (c) 2015 Zalando SE | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| # Create the datadog user with select only permissions: | |
| # CREATE USER datadog WITH PASSWORD '<complex_password>'; | |
| # | |
| # Grant select permissions on a table or view that you want to monitor: | |
| # GRANT SELECT ON <schema>.<table> TO datadog; | |
| # | |
| # Grant permissions for a specific column on a table or view that you want to monitor: | |
| # GRANT SELECT (id, name) ON <schema>.<table> TO datadog; | |
| # | |
| # Let non-superusers look at pg_stat_activity in a read-only fashon. |
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
| #!/bin/bash | |
| cluster=default | |
| container_instance= # container instance guid | |
| tasks=$(aws --region us-west-2 ecs list-tasks --container-instance $container_instance --cluster $cluster | jq -r '.taskArns | map(.[40:]) | reduce .[] as $item (""; . + $item + " ")') | |
| for task in $tasks; do | |
| aws --region us-west-2 ecs stop-task --task $task --cluster $cluster | |
| done | |
| aws --region us-west-2 ecs deregister-container-instance --cluster $cluster --container-instance $container_instance |
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 bash | |
| ENVIRONMENT="{{ target_env }}" # Ansible will replace this one | |
| AWS_SERVICE_LOG_GROUP="{{ kafka_log_group_name }}" # Ansible will replace this one (automatically discovered) | |
| AWS_SERVICE_LOG_STREAM=container-logs | |
| DOCKER_CONTAINER="{{ kafka_docker_container }}" # Ansible will replace this one | |
| # Get meta information about instance and its placement | |
| AVAILABILITY_ZONE=`curl http://169.254.169.254/latest/meta-data/placement/availability-zone` | |
| LOCAL_IP=`curl -s http://169.254.169.254/latest/meta-data/local-ipv4` |
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
| # Lambda function to create partition for Cloudtrail log on daily basis. | |
| # You need to schedule it in AWS Lambda. | |
| ''' | |
| ------------------------------------------- | |
| AWS Athena Create Partitions Automatically | |
| ------------------------------------------- | |
| Version 1.0 | |
| Author: SqlAdmin |
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 yum install gcc python27 python27-devel postgresql-devel | |
| sudo curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python27 | |
| sudo /usr/bin/easy_install-2.7 pip | |
| sudo pip2.7 install psycopg2 |
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 | |
| # vim: ft=python ts=4 sw=4 expandtab | |
| # | |
| # Copyright (c) 2013 Reed Kraft-Murphy <reed@reedmurphy.net> | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is |
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
| #!/bin/bash -eo pipefail | |
| ## Allows for creation of "Basic" DNS records in a Route53 hosted zone | |
| function main() { | |
| record_name=$1 | |
| record_value=$2 | |
| [[ -z $record_name ]] && echo "record_name is: $record_name" && exit 1 | |
| [[ -z $record_value ]] && echo "record_value is: $record_value" && exit 1 |
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
| require 'optparse' | |
| require 'yaml' | |
| require 'base64' | |
| options = { | |
| config_path: File.join(ENV['HOME'], '.kube', 'config'), | |
| write_dir: File.join(ENV['HOME'], '.kube') | |
| } | |
| OptionParser.new do |opts| |
OlderNewer