Skip to content

Instantly share code, notes, and snippets.

View mdkent's full-sized avatar

Matthew Kent mdkent

  • Basecamp
  • Nanaimo, BC, Canada
View GitHub Profile
#
# 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
# 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" ]
#!/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
[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
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') }
@mdkent
mdkent / .zshrc
Created April 14, 2010 16:28 — forked from jtimberman/.zshrc
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"
apache_site "default" do
enable false
end
define :foo, do
if params.has_key?(:bar) == false
raise ArgumentError, "bar is a required argument!"
end
# do stuff!
end
(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
# 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