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
| # use this to monitor a web server that is front-ended by a load balancer or sso gateway, | |
| # without going throug said gateway (requires direct network route be available) | |
| curl -k -v -X GET --resolve app.domain.com:443:10.0.0.10 https://app.domain.com/login |
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
| Compiling Cookbooks... | |
| ================================================================================ | |
| Recipe Compile Error in /home/vagrant/.chef/local-mode-cache/cache/cookbooks/docker/libraries/provider_docker_container.rb | |
| ================================================================================ | |
| LoadError | |
| --------- | |
| cannot load such file -- docker |
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
| RubyGems Environment: | |
| - RUBYGEMS VERSION: 2.4.8 | |
| - RUBY VERSION: 2.1.6 (2015-04-13 patchlevel 336) [x86_64-darwin12.0] | |
| - INSTALLATION DIRECTORY: /opt/chefdk/embedded/lib/ruby/gems/2.1.0 | |
| - RUBY EXECUTABLE: /opt/chefdk/embedded/bin/ruby | |
| - EXECUTABLE DIRECTORY: /opt/chefdk/embedded/bin | |
| - SPEC CACHE DIRECTORY: /Users/adpatter/.gem/specs | |
| - SYSTEM CONFIGURATION DIRECTORY: /opt/chefdk/embedded/etc | |
| - RUBYGEMS PLATFORMS: | |
| - ruby |
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
| docker_service 'default' do | |
| version node["docker"]["version"] | |
| group 'docker' | |
| action [:create, :start] | |
| 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
| # Assumes htpass authentication | |
| registry_server='docker.mycloud.com' | |
| username='bob' | |
| # List all images (i.e. repositories) | |
| curl -k -X GET "https://$registry_server/v2/_catalog" -u $username -H "Accept: application/json" | |
| Enter host password for user 'bob': | |
| {"repositories":["app-base","ubuntu","cache-base"]} | |
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 json file in appropriate location, e.g. | |
| ./data_bags/docker/config.json | |
| # add stuff in data_bag format to config.json | |
| nano ./data_bags/docker/config.json | |
| # generate a secret key if you don't have one | |
| openssl rand -base64 512 | tr -d '\r\n' > chef_secret_key | |
| # encrypt it - chef-zero style |
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
| # Personal Access Token required - go here: https://github.com/settings/tokens | |
| repo="newrepo" | |
| gh_user="adampats" | |
| gh_token="mytoken" | |
| curl -u "$gh_user:$gh_token" https://api.github.com/user/repos -d '{"name":"'$repo'"}' |
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
| set -e | |
| log_files=( /home/app/log/development.log \ | |
| /home/app/log/production.log ) | |
| for i in ${log_files[@]}; do | |
| if [[ -e $i ]]; then | |
| exec tail -F $i | |
| else | |
| exec sleep 10 |
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
| bucket_name="my-cloudtrail-bucket" | |
| acc_num="myacc" | |
| region="us-west-1" | |
| aws s3 cp --recursive s3://$bucket_name/AWSLogs/$acc_num/CloudTrail/$region/2016/01/ | |
| ls | |
| gunzip -c cloudTrail-log-file-name.json.gz | jq . |
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 'open3' | |
| puts "test1.rb" | |
| Open3.popen3("ruby test2.rb") do |stdin, stdout, stderr, wait_thr| | |
| while line = stdout.gets do | |
| puts line | |
| end | |
| end |