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
| # List of the patterns to search for | |
| declare -a git_verification_patterns # Create an associative array | |
| git_verification_patterns[0]="(\"|')?(AWS|aws|Aws)?_?(SECRET|secret|Secret)?_?(ACCESS|access|Access)?_?(KEY|key|Key)(\"|')?\s*(:|=>|=)\s*(\"|')?[A-Za-z0-9/\+=]{40}(\"|'|\s)?" | |
| git_verification_patterns[1]="(\"|')?(AWS|aws|Aws)?_?(SECRET|secret|Secret)?_?(ACCESS|access|Access)?_?(KEY|key|Key)?_?(ID|id|Id)?(\"|')?\s*(:|=>|=)\s*(\"|')?[A-Za-z0-9/\+=]{20}(\"|'|\s)?" | |
| git_verification_patterns[2]="(\s+|=|:)[a-z0-9]{64}(\s+|\|)" # DigitalOcean Personal Access Token | |
| git_verification_patterns[3]='Authorization\s+"?Basic\s+[a-zA-Z0-9+/]+={0,2}' | |
| git_verification_patterns[4]="BEGIN RSA PRIVATE KEY" | |
| git_verification_patterns[5]="END RSA PRIVATE KEY" | |
| # List of the pattern descriptions (in same order) |
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
| packages = value_for_platform_family( | |
| %w(rhel fedora suse) => %w(pcre-devel), | |
| %w(gentoo) => [], | |
| %w(default) => %w(libpcre3 libpcre3-dev) | |
| ) | |
| packages.each do |p| | |
| package p do | |
| action :install | |
| end |
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
| # Useful when the "action.disable_delete_all_indices" setting is set to "false" | |
| for I in $(curl --silent 'http://[ES_HOST]:9200/_cat/indices/[INDEX_PATTERN]*?v&h=i'); do curl -XDELETE http://[ES_HOST]:9200/$I; 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
| #!/usr/bin/php | |
| <?php | |
| $sshKey = "~/.ssh/id_rsa"; | |
| $sshUser = getenv('USER'); // Get the user from your environment variables | |
| $autoScalingGroups = $argv[1]; // A blob pattern of the auto scalling group name to match | |
| $userPrivateIp = true; // Use the VPC private IP to connect? | |
| $profile = getenv('WORKENV'); |
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 'aws-sdk' | |
| s3 = Aws::S3::Resource.new( | |
| region: 'us-east-1', | |
| credentials: Aws::InstanceProfileCredentials.new() | |
| ) | |
| bucket = s3.bucket('my-daily-backups') | |
| file = (DateTime.now).strftime("%Y.%m.%d-backup") | |
| if bucket.object(file).exists? |
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 ( | |
| "fmt" | |
| "sync" | |
| ) | |
| func main() { | |
| var wg sync.WaitGroup |
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
| # Remove the node from the cluster | |
| curl -XPUT "http://[ES_NODE_IP]:9200/_cluster/settings" -d '{ | |
| "transient" :{ | |
| "cluster.routing.allocation.exclude._ip" : "[ES_NODE_IP_TO_REMOVE]" | |
| } | |
| }' | |
| # Check the pending cluster task status | |
| curl "http://[ES_NODE_IP]:9200 /_cluster/pending_tasks |
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
| # Easy way to work in go projects to submit PRs to other projects from your fork | |
| # Switch to the project directory in the Go path | |
| $GOPATH/src/github.com/elastic/beats/metricbeat` | |
| # If there isn't already an origin for your fork, then add it | |
| git remote add hartfortdrive [email protected]:hartfordfive/beats.git | |
| # Once changes are made and you're ready to push to the branch on your origin |
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 json | |
| import chef | |
| # Copy your .chef directory into the root folder of the deployment package: | |
| # http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html#deployment-pkg-for-virtualenv | |
| # See also https://github.com/coderanger/pychef/issues/41 | |
| print('Loading function') | |
| def lambda_handler(event, context): |
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 | |
| # Notes: | |
| # - You must seperate the certificates CloudKarafka provides in the single file into three different files: ca.pem (CA certificate), cert.pem (certificate), key.pem (private key) | |
| # - Once completed, you must copy over the keystore.jks and truststore.jks files over to SDC server in the directory where your config parameters will point to. | |
| # - You SHOULD pick something other than "test1234" for your password | |
| echo -n "Enter a password to use for the keystore: " | |
| read -s PW | |
| echo "" |