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
{ | |
"variables": { | |
"HOME": "{{env `HOME`}}", | |
"USER": "{{env `USER`}}", | |
"build_timestamp": "{{isotime \"20060102150405\"}}", | |
"vm_name": "centos7" | |
}, | |
"builders": [{ | |
"type": "vmware-iso", | |
"http_directory": "kickstart", |
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
{ | |
"handlers": { | |
"handler-graphite-status": { | |
"type": "pipe", | |
"command": "/opt/sensu/embedded/bin/handler-graphite-status.rb" | |
} | |
} | |
} |
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
users_manage 'mygroup' do | |
group_id 5001 | |
action [:remove, :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
awk '{ sum+=$1} END {print sum}' FILENAME | |
awk '{ sum+=$5 } {sum2+=$6 } END {print sum, sum2}' FILENAME |
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
# Ubuntu 12.04 | |
- install chefdk | |
- update to 3.8+ kernel (raring backport minimal) | |
- install docker | |
- sudo chef gem install kitchen-docker | |
- ensure your user is sudo passwordless |
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
case node['platform'] | |
when 'oracle' | |
case node['platform_version'].to_i | |
when '5' | |
pkg_src = 'http://myrepo/mypkg.OEL5.x86_64.rpm' | |
when '6' | |
pkg_src = 'http://myrepo/mypkg.OEL6.x86_64.rpm' | |
end | |
when 'redhat', 'centos' | |
case node['platform_version'].to_i |
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
override['graphite']['storage_schemas'] = [ | |
{ | |
'name' => 'chef_reporting', | |
'pattern' => 'chef.*', | |
'retentions' => '30m:2y' | |
}, | |
{ | |
'name' => '2min_interval', | |
'pattern' => '.*\.2m\..*', | |
'retentions' => '2m:30d,30m:1y' |
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
chef_gem 'chef-vault' | |
require 'chef-vault' | |
secrets = ChefVault::Item.load('secrets', 'my_app') | |
node.override['my_app']['password'] = secrets['password'] | |
################### | |
## Do your thang ## | |
################### |
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 'gitlab' | |
g = Gitlab.client(:endpoint => 'http(s)://gitlaburl/api/v3', :private_token => 'userprivatetoken') | |
user = g.user | |
# use per_page setting as gitlab uses pagination with default of 20 items | |
projects = g.projects(:per_page => '100') | |
puts "Projects accessible by user #{user.name}:" | |
projects.reverse.each do |project| |