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
# | |
# Tasks to keep your repository in sync with your Chef Server | |
# | |
# Author:: Matthew Kent (<[email protected]>) | |
# Copyright:: Copyright (c) 2010 Matthew Kent | |
# License:: Apache License, Version 2.0 | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at |
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
# The end result when the recipe is run is: | |
node[:openldap][:ldap_conf][:servers] = [ "ldap://ldap1.internal.com", "ldap://ldap2.internal.com", "ldap://server.office.com" ] | |
# but what I *expected* was this: | |
node[:openldap][:ldap_conf][:servers] = [ "ldap://server.office.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
#!/usr/bin/env ruby | |
# | |
# Author:: Joshua Timberman <[email protected]> | |
# Description:: Thor script that configures knife for a different platform. | |
# | |
# Copyright:: 2010, Opscode, Inc <[email protected]> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at |
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
[root@el-test ~]# strace -p 8438 -c | |
Process 8438 attached - interrupt to quit | |
strace: ptrace(PTRACE_CONT,1,133): Input/output error | |
Process 8438 detached | |
% time seconds usecs/call calls errors syscall | |
------ ----------- ----------- --------- --------- ---------------- | |
94.33 0.001496 125 12 write | |
3.53 0.000056 6 9 mmap | |
2.14 0.000034 4 9 munmap | |
0.00 0.000000 0 33 read |
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
service_link 'apache' do | |
version [node[:apache][:version], node[:apache][:worker]].join('-') | |
end | |
directory "/etc/httpd" do | |
owner "root" | |
group "root" | |
mode 0755 | |
action :create | |
not_if { File.exists?('/etc/httpd') } |
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 gitp="git log -p" | |
alias gitf="git log --pretty=format:'%Cgreen%ad %cn %Cblue%h %Creset%s' --date=short" | |
alias gitlog="git log --graph --pretty=format:'%an: %s - %Cred%h%Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" |
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
apache_site "default" do | |
enable false | |
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
define :foo, do | |
if params.has_key?(:bar) == false | |
raise ArgumentError, "bar is a required argument!" | |
end | |
# do stuff! | |
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
(rdb:1) eval node.attribute[:foo][:bar] = "baz" | |
"baz" | |
(rdb:1) eval node.attribute[:foo].has_key?(:bar) | |
true | |
(rdb:1) eval node.attribute[:foo].delete(:bar) | |
"baz" | |
(rdb:1) eval node.attribute[:foo].has_key?(:bar) | |
false |
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
# minimal defaults for the main postfix setup | |
# by defaul postfix will be a null client setup | |
# to forward to sysmail only. | |
set[:postfix][:conf][:alias_database] = "hash:/etc/mail/aliases" | |
set[:postfix][:conf][:alias_maps] = "hash:/etc/mail/aliases" | |
set[:postfix][:conf][:html_directory] = "no" | |
set[:postfix][:conf][:inet_interfaces] = "localhost" | |
set[:postfix][:conf][:mail_owner] = "postfix" | |
set[:postfix][:conf][:mydestination] = nil |