https://github.com/massemanet/eper/blob/master/doc/redbug.txt
Attach to the running erlang process on running EC11x or Chef 12 systems
/opt/opscode/embedded/bin/erl -name me@127.0.0.1 -remsh erchef@127.0.0.1 -setcookie erchef
https://github.com/massemanet/eper/blob/master/doc/redbug.txt
Attach to the running erlang process on running EC11x or Chef 12 systems
/opt/opscode/embedded/bin/erl -name me@127.0.0.1 -remsh erchef@127.0.0.1 -setcookie erchef
| # encoding: utf-8 | |
| ### Sample script to export Chef Server nodes and import them to Chef Compliance | |
| ### Change the 'api_url', 'api_user', 'api_pass' and 'api_org' variables below | |
| ### Change the nodes_array json suit your environment | |
| ### Go to your chef-repo and check Chef Server access first | |
| # cd chef-repo; knife environment list | |
| ### Save this Ruby script as kitchen_sink.rb and run it like this: | |
| # cat kitchen_sink.rb | knife exec | |
| ### Chef Compliance API docs: https://docs.chef.io/api_compliance.html |
| # Execute this script in order to upgrade all the windows nodes in your fleet of servers to the desired version of chef-client. | |
| # This script will requires the ChefDK to be installed and configured on your Windows machine. | |
| $windows_nodes = knife search node 'platform:windows' -i | |
| invoke-command -ComputerName $windows_nodes -filepath C:\Users\MyUser\invoke_upgrade.ps1 -Credential domain\user | |
| Read-Host -Prompt “Upgrade complete. Press Enter to exit.” |
| # metadata.rb | |
| # This metadata.rb example reads the dependencies from Berksfile.lock. This can | |
| # be used to implement the Environment Pattern with Chef Server. | |
| # | |
| # The Environment Cookbook: | |
| # http://blog.vialstudios.com/the-environment-cookbook-pattern/ | |
| name 'my_face' | |
| # [...] |
This is temporal automation to create multiple LDAP users in Chef Automate.
The minimum prerequisites to be able to use this automation are:
bulk-user-creation.rb script locally and give executable permissions to the file.| # gist to create file size list: | |
| # run this in irb in your git folder. | |
| # will output a text file to the parent folder with a listing of each filepath and file size. | |
| # NOTE: nil is added to the end of each line to prevent outputting the result of the iterator blocks. | |
| lines = `git gc && git verify-pack -v .git/objects/pack/pack-*.idx`.split("\n"); nil | |
| objects = lines.find_all{ |line| line.match(/^\w+ blob\W+[0-9]+ [0-9]+ [0-9]+$/) }; nil | |
| shas = `git rev-list --objects --all | sort -k 2`.chomp.split("\n"); nil | |
| map = shas.inject({}){ |hash, line| sha, file = line.split(' '); hash[sha] = file unless file.nil?; hash }; nil | |
| sizes = objects.map{ |line| sha, type, size = line.gsub(/\s+/, ' ').split(' '); file = map[sha]; [size.to_i, file] if file }; nil |
| # Please see the following blog post for more information: | |
| # | |
| # https://www.hashicorp.com/blog/using-hashicorp-vault-with-chef.html | |
| # | |
| resource_name :vault_secret | |
| property :path, String, name_property: true | |
| property :destination, String |
| $days = 7 | |
| $pointInTime = [DateTime]::Now.AddDays(-$days); | |
| $horizon = $pointInTime.AddDays(-$days); | |
| "===Removing resource groups created between $horizon and $pointInTime===" | |
| # Get potential log entries | |
| $logs = @() | |
| $logs += Get-AzureRmLog -StartTime $horizon -EndTime $pointInTime -Status "Succeeded" -ResourceProvider "Microsoft.Resources" -WarningAction "SilentlyContinue" ` | |
| | Select-Object ResourceGroupName, ResourceId, @{Name="EventNameValue"; Expression={$_.EventName.Value}}, @{Name="OperationNameValue"; Expression={$_.OperationName.Value}}, EventTimestamp, @{Name="HttpVerb"; Expression={$_.HttpRequest.Method}} ` |
| # Taps | |
| tap "homebrew/bundle" | |
| tap "homebrew/cask" | |
| tap "homebrew/cask-fonts" | |
| tap "homebrew/core" | |
| tap "sambadevi/powerlevel9k" | |
| # Brew CLI apps | |
| brew "fd" | |
| brew "fzf" |
| #!/bin/bash | |
| case $# in | |
| 0) | |
| echo "Usage: $0 {start|stop}" | |
| exit 1 | |
| ;; | |
| 1) | |
| case $1 in | |
| start) |