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 "configure #{p} module" do | |
| block do | |
| require 'chef/util/file_edit' | |
| nc = Chef::Util::FileEdit.new("/etc/reconnoiter/noit.conf") | |
| nc.insert_line_after_match(/lua.*noit.module.smtp/, "<module loader=\"lua\" name=\"#{p}\" object=\"noit.module.#{p}\"/>") | |
| nc.write_file | |
| Chef::Log.info "Inserted module config for #{p}" | |
| end | |
| http://tickets.opscode.com/browse/CHEF-78?focusedCommentId=10781&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-10781 |
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/sh | |
| die () { | |
| echo >&2 "$@" | |
| exit 1 | |
| } | |
| available_configs () { | |
| echo "Available configs:" | |
| ls -A ~ | grep .chef- | sed 's/.chef-//' | |
| } |
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/sh | |
| ## | |
| # This is a script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # Run in interactive mode with: | |
| # $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)" | |
| # | |
| # or run it without prompt questions: |
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
| /var/lib/chef/solr/home/conf/solrconfig.xml | |
| <autoCommit> | |
| <maxDocs>100</maxDocs> | |
| <maxTime>60000</maxTime> | |
| </autoCommit> |
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
| # a useful addition to anyone's .bashrc | |
| # | |
| # Note, you don't want this function in effect on the remote host side of the scp transfer, | |
| # so make sure to only define it for interactive shells, e.g.: wrap with: if [ ! -z "$PS1" ] | |
| function scp() { | |
| if echo "$@" | grep -q ':' | |
| then | |
| /usr/bin/scp "$@" | |
| else |
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/find /var/cache/chef/checksums/ -maxdepth 1 -type f -ctime +1 -delete | |
| Then delete all the checksums in CouchDB using Shef: | |
| require 'chef/checksum' | |
| r = Chef::REST.new('http://localhost:5984/chef/_design/checksums/_view/', false, false) | |
| r.get_rest("all")["rows"].each do |c| c["value"].cdb_destroy 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
| curl -H "Content-Type: application/json" -X POST http://localhost:5984/chef/_compact |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| require 'berkshelf/vagrant' | |
| Vagrant::Config.run do |config| | |
| config.vm.host_name = "celery-berkshelf" | |
| #config.vm.box = "Berkshelf-CentOS-6.3-x86_64-minimal" | |
| #config.vm.box_url = "https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86_64-minimal.box" |
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
| yum-utils provides repoquery | |
| For a single package, you can find this with | |
| repoquery -i package | |
| PACKAGE=ruby-enterprise | |
| repoquery --qf "%{repoid}" $PACKAGE | |
| Replace $PACKAGE with the name of the package you care about. |
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
| brew install -vd pcre |