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
# | |
# This is an example of a knife.rb configuration that uses yml and a | |
# simple env var (CHEF_ENV) to manage multiple hosted Chef environments. | |
# | |
# Example usage: | |
# export CHEF_ENV=evnironment_01 | |
# knife status | |
# | |
# Based on: http://blog.blankpad.net/2010/09/28/multiple-knife-environments---the-return/ | |
# |
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
# update gems | |
sudo gem update --no-rdoc --no-ri | |
# edit client.rb with correct validation key and chef server | |
# also set the environment | |
log_level :info | |
log_location STDOUT | |
chef_server_url "https://api.opscode.com/organizations/modcloth-comments" | |
validation_client_name "modcloth-comments-validator" | |
node_name "comments-standalone-01.demo.modcloth.com" |
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
# Create a new branch that forks off remote master | |
$ git checkout -b mybranch origin/master | |
# Make changes and commit to branch (you can use -m on command line to specify commit message, or leave it off and use your default editor to write your commit message when it prompts) | |
$ touch a.txt | |
$ git add a.txt | |
$ git commit -m "Added file" | |
$ vi a.txt | |
$ git add a.txt | |
$ git commit -m "Updated file" |
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
https://docs.chef.io/knife_bootstrap.html#custom-templates | |
https://docs.chef.io/install_bootstrap.html | |
https://docs.chef.io/knife_bootstrap.html | |
https://github.com/chef/chef/blob/12.2.1/lib/chef/knife/bootstrap/templates/chef-full.erb | |
https://github.com/chef/chef/blob/11.6.2/lib/chef/knife/bootstrap/chef-full.erb | |
Blog: | |
https://www.chef.io/blog/2014/10/28/working-with-chef-behind-your-firewall/ | |
http://www.appneta.com/blog/customizing-chef-bootstrap-templates/ | |
http://www.tomduffield.com/bootstrapping-without-the-internet/ |
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
#!/usr/bin/env python | |
from __future__ import print_function | |
import json | |
import logging | |
from urllib2 import Request, urlopen, URLError, HTTPError | |
from base64 import b64decode |
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
{ | |
"elasticsearch" : { | |
"version": "value", | |
"hash": { | |
"key1": "value1", | |
"key2": "value2" | |
}, | |
"key 3": "value3" | |
} | |
} |
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
ruby_block 'get build' do | |
block do | |
require "net/https" | |
require "uri" | |
require "json" | |
uri = URI.parse("http://nexus.example.com/nexus/service/local/repositories/foobar/content/master-5678.zip?describe=info") | |
http = Net::HTTP.new(uri.host, uri.port) | |
request = Net::HTTP::Get.new(uri.request_uri) |
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
data_bag(:users).each do |user| | |
user_item = data_bag_item('users', user) | |
user user_item['id'] do | |
uid user_item['uid'] | |
home user_item['home'] | |
manage_home true | |
end | |
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
#!/usr/bin/env python | |
import argparse | |
def main(command_line=None): | |
parser = argparse.ArgumentParser('Blame Praise app') | |
parser.add_argument( | |
'--debug', | |
action='store_true', | |
help='Print debug info' |
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
[alias] | |
tracking = "!f() { git for-each-ref --format '%(refname:short):%(upstream:short)' 'refs/heads' | egrep -v ':$'; }; f" | |
is-clean-workdir = "!f() { git diff --stat --exit-code || { echo \"Workdir dirty\"; exit 1; }; }; f" | |
is-clean-index = "!f() { git diff --stat --cached --exit-code || { echo \"Index dirty\"; exit 2; }; }; f" | |
is-clean = "!f() { git is-clean-workdir && git is-clean-index; }; f" | |
co-merge = "!f() { local=\"$1\"; remote=\"$2\"; git checkout \"$local\"; git merge --ff-only \"$remote\"; }; f" | |
current-branch = rev-parse --abbrev-ref HEAD | |
sync = "!f() { git is-clean || { echo Aborting sync.; exit 1; }; current=$(git current-branch); git fetch --all; git tracking | while IFS=: read local remote; do echo \"Merging $local with $remote\"; git co-merge \"$local\" \"$remote\"; done 3>&1 1>&2 2>&3 | egrep -i --color 'fatal|$' 3>&1 1>&2 2>&3; git checkout \"$current\"; }; f" |
OlderNewer