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
#!/opt/opscode/embedded/bin/ruby | |
require 'sequel' | |
require 'json' | |
require 'uri' | |
require 'net/http' | |
orgname = ARGV[0] | |
if orgname.nil? | |
STDERR.puts "usage: danger_add_users_to_global_admins_group ORGNAME" |
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 | |
# | |
# Warn about possible cloud access keys before committing | |
# | |
exec </dev/tty | |
unset possible_keys | |
possible_keys=$(git diff --cached | egrep '^[+\-].*(AKIA|AWS_ACCESS|AWS_SECRET|OS_PASSWORD|OS_USERNAME)') | |
if [[ -n "$possible_keys" ]];then | |
echo -e "WARNING: Diff contains possible access keys:\n" | |
echo "${possible_keys}" |
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
my_test "foo" do | |
action :create | |
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
save-last-command() { | |
last_command=$(fc -nl 0) | |
command_name="$1" | |
read -r -d '' new_fun <<EOF | |
${command_name}() { | |
$last_command | |
} | |
EOF | |
eval "$new_fun" | |
} |
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/env ruby | |
# | |
# sigign: exec a command with signals ignored | |
# | |
# Usage: sigign SIGNAL[,SIGNAL..] COMMAND | |
# | |
# sigign sets the disposition of the specified signals to SIG_IGN | |
# before exec'ing the specified command. | |
ignored_signals = ARGV.shift.split(",") |
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
sdanna@thrace ~/tmp/foo > irb | |
irb(main):001:0> Dir.pwd | |
=> "/Users/sdanna/tmp/foo" | |
irb(main):002:0> | |
[1]+ Stopped irb | |
146 sdanna@thrace ~/tmp/foo > cd | |
sdanna@thrace ~ > rm -rf ~/tmp/foo | |
sdanna@thrace ~ > fg | |
irb (wd: ~/tmp/foo) | |
Dir.pwd |
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
class Chef::Resource::File | |
def verify(&block) | |
if block_given? | |
@verify_block=block | |
else | |
@verify_block | |
end | |
end | |
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
#!/usr/bin/env bash | |
# | |
# Authors:: Chef Support Team <[email protected]> | |
# | |
modified_within_last_x_minutes=180 | |
tail_lines=10000 | |
type='EC' | |
if [[ -n $1 ]]; | |
then |
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
whyrun_safe_ruby_block "log" do | |
block do | |
Chef::Log.info "foo" | |
end | |
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
ruby_block "dump run_state" do | |
block do | |
require 'pp' | |
pp node.run_state | |
end | |
end |