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
| lol = log --graph --decorate --oneline | |
| lola = log --graph --decorate --oneline --all | |
| prune-branches = !git remote prune origin && git branch -vv | grep ': gone]' | awk '{print $1}' | gxargs -r git branch -D | |
| list-prunable = !git remote prune origin >&/dev/null && git branch -vv | grep ': gone]' | awk '{print $1}' | |
| commits-on-this-branch-compared-to-master = !git cherry -v master | |
| # Essentially - show me what I changed on this branch vs master | |
| diffmaster = !git diff master... | |
| dm = !git diff master... |
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/perl -w | |
| # Copyright 2008 Amazon Technologies, Inc. Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. You may obtain a copy of the License at: | |
| # | |
| # http://aws.amazon.com/apache2.0 | |
| # | |
| # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and limitations under the License. |
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/python | |
| # | |
| # Usage: packer-config my-template.yaml | packer build - | |
| # | |
| # Constructs a Packer JSON configuration file from the specified YAML | |
| # template file and writes it to STDOUT. | |
| # | |
| # The YAML template format adds some flexibility and readability by | |
| # adding comments and an !include directive, allowing for the | |
| # following template syntax: |
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
| * See what certificate a site is presenting | |
| openssl s_client -showcerts -connect example.com:443 | |
| ** Disable verification | |
| openssl s_client -verify 0 -showcerts -connect example.com:443 | |
| ** force TLS version | |
| openssl s_client -tls1 -showcerts -connect example.com:443 | |
| * Examine a local certificate | |
| openssl x509 -noout -in example.com.crt -text | less | |
| * Examine a local key | |
| openssl rsa -in example.com.key -noout -text |
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 Cloudwatch Logs install documentation: | |
| # https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/QuickStartEC2Instance.html | |
| # By defining this IAM Role Policy in a module, it can be referenced anywhere it is required | |
| # for an IAM Role. This is preferrable to copy/pasting the IAM Policy statement because changes | |
| # made to this role will automatically apply to all IAM Roles referencing this module. | |
| ### | |
| # Variables | |
| ### |
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
| gpgagent=$(type -path gpg-agent) | |
| envfile="$HOME/.gnupg/gpg-agent.env" | |
| if [ -n "$gpgagent" ]; then | |
| agent_pid=$(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) | |
| if [[ -e "$envfile" ]] && kill -0 "$agent_pid" 2>/dev/null; then | |
| eval "$(cat "$envfile")" | |
| else | |
| eval "$(gpg-agent --daemon --write-env-file "$envfile")" | |
| fi | |
| fi |
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
| def get_queue_stats(queue_metrics): | |
| for queue in get_rabbit_stats(): | |
| queue_metrics[metric].labels(hostname, queue['name']).set(queue[metric]) | |
| def create_queue_metrics(): | |
| metrics = {} | |
| metrics['consumers'] = Gauge('rabbit_consumers_count', |
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
| { | |
| "region": "us-west-1", | |
| "metrics": [ | |
| { | |
| "aws_namespace": "AWS/S3", "aws_metric_name": "BucketSizeBytes", | |
| "aws_dimensions": ["BucketName", "StorageType"], | |
| "aws_dimension_select": { | |
| "BucketName": ["<redacted>"], | |
| "StorageType": ["StandardStorage"] | |
| } |
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
| - job_name: consul_discovery | |
| consul_sd_configs: | |
| - server: 'consul.redacted.com:8500' | |
| services: ["node", "elasticsearch", "rabbitmq"] | |
| relabel_configs: | |
| - source_labels: ['__meta_consul_node'] | |
| regex: '(.*)' | |
| target_label: 'instance' | |
| replacement: '$1' | |
| - source_labels: ['__meta_consul_service'] |
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
| - job_name: node | |
| consul_sd_configs: | |
| - server: 'consul:8500' | |
| services: ['node'] | |
| relabel_configs: | |
| - <same stuff> | |
| - job_name: rabbit | |
| consul_sd_configs: | |
| - server: 'consul:8500' |
NewerOlder