This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
input { | |
file { | |
type => "httpd" | |
path => "/var/log/httpd/*.log" | |
} | |
} | |
filter { | |
if [type] == "httpd" { | |
grok { |
This file contains 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
-----> Starting Kitchen (v1.10.0) | |
-----> Converging <default-centos-67>... | |
Preparing files for transfer | |
Preparing dna.json | |
Resolving cookbook dependencies with Berkshelf 4.3.5... | |
Removing non-cookbook files before transfer | |
Preparing validation.pem | |
Preparing client.rb | |
-----> Chef Omnibus installation detected (install only if missing) | |
Transferring files to <default-centos-67> |
This file contains 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
dsc_resource 'Change User on TeamCity Agent Service' do | |
resource :service | |
property :ensure, 'Present' | |
property :name, SERVICE_NAME | |
property :credential, ps_credential("test@domain", "password") | |
end |
This file contains 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
# Knife Configuration File. | |
# | |
# This is a Ruby DSL to set configuration parameters for Knife's | |
# general options. The default location for this file is | |
# ~/.chef/knife.rb. If multiple Chef repositories are used, | |
# per-repository configuration files can be created. A per repository | |
# configuration file must be .chef/knife.rb in the base directory of | |
# the Chef repository. For example, | |
# | |
# ~/Development/chef-repo/.chef/knife.rb |
This file contains 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
function rsall() { | |
$@ -K ${RACKSPACE_API_KEY} -A ${RACKSPACE_USERNAME} | |
$@ -K ${RACKSPACE_API_KEY_1} -A ${RACKSPACE_USERNAME_1} | |
$@ -K ${RACKSPACE_API_KEY_2} -A ${RACKSPACE_USERNAME_2} | |
} |
This file contains 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
# Retrieve a secret, either from the env or from Vault | |
def self.secret(node, path) | |
# First, try in the environment | |
secret = AiHelper.environment_secret(node, path) | |
if secret.nil? || secret == 'IN_VAULT' | |
secret = AiHelper.vault_secret(node, path) | |
end | |
secret | |
end |
This file contains 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 | |
# | |
# vault-ec2-auth.sh | |
# Authenticates an EC2 instance to Hashicorp Vault | |
# | |
# configuration stored in environment variables in /etc/vault/client.conf | |
# expected configuration (defaults are selected below if none is specified): | |
# VAULT_ADDR = url of vault server | |
# VAULT_ROLE = role name to authenticate as |
This file contains 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
docker run -it \ | |
-e AWS_ACCESS_KEY_ID=$(aws --profile default configure get aws_access_key_id) \ | |
-e AWS_SECRET_ACCESS_KEY=$(aws --profile default configure get aws_secret_access_key) \ | |
-e AWS_REGION='eu-west-1' \ | |
--rm \ | |
-v $(pwd):/share \ | |
chef/inspec exec aws-dev -t aws: |
This file contains 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
virtualenv -p python3 web | |
source web/bin/activate | |
deactivate |
OlderNewer