Skip to content

Instantly share code, notes, and snippets.

@ctdk
ctdk / gist:1123158
Created August 3, 2011 17:07
webhead_dev_test role
# recipe[dk4] is the one that doesn't run in a role's run_list, but runs if you spell out the recipes in a
# node's run_list
name "webhead_dev_test"
description "The development webhead role, for testing."
run_list "recipe[perl]", "recipe[memcached]", "recipe[start_pkgs]", "recipe[apache2]", "recipe[lighttpd]", "recipe[cpan_stuff]", "recipe[dk4_code]", "recipe[dk4]", "recipe[bzrtest]"
default_attributes "dk4" => { "git_branch" => "master", "deploy_type" => "development" }, "lighttpd" => { "extforward_headers" => [ "X-Cluster-Client-Ip", "X-Forwarded-For" ], "extforward_forwarders" => [ "::ffff:10.1.10.215", "10.1.10.215" ] }
@ctdk
ctdk / gist:1123171
Created August 3, 2011 17:10
chef debug output
[Wed, 03 Aug 2011 09:59:23 -0700] INFO: *** Chef 0.10.2 ***
[Wed, 03 Aug 2011 09:59:23 -0700] DEBUG: Loading plugin os
[Wed, 03 Aug 2011 09:59:23 -0700] DEBUG: Loading plugin kernel
[Wed, 03 Aug 2011 09:59:23 -0700] DEBUG: Loading plugin ruby
[Wed, 03 Aug 2011 09:59:23 -0700] DEBUG: Loading plugin languages
[Wed, 03 Aug 2011 09:59:23 -0700] DEBUG: ---- Begin ruby -e "require 'rbconfig'; puts %Q(target_cpu=#{::Config::CONFIG['target_cpu']},bin_dir=#{::Config::CONFIG['bindir']},host_os=#{::Config::CONFIG['host_os']},target_vendor=#{::Config::CONFIG['target_vendor']},target_os=#{::Config::CONFIG['target_os']},host_cpu=#{::Config::CONFIG['host_cpu']},host_vendor=#{::Config::CONFIG['host_vendor']},version=#{RUBY_VERSION},platform=#{RUBY_PLATFORM},host=#{::Config::CONFIG['host']},release_date=#{RUBY_RELEASE_DATE},ruby_bin=#{::File.join(::Config::CONFIG['bindir'], ::Config::CONFIG['ruby_install_name'])},target=#{::Config::CONFIG['target']},)" STDOUT ----
[Wed, 03 Aug 2011 09:59:23 -0700] DEBUG: target_cpu=x86_64,bin
(function(a,b){ if(/android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u
@ctdk
ctdk / gist:2218099
Created March 27, 2012 17:16
firewall role json
{
"name": "firewall-general",
"description": "General firewall rules",
"json_class": "Chef::Role",
"default_attributes": {
},
"override_attributes": {
"firewall": {
"rules": [
{
@ctdk
ctdk / gist:2218008
Created March 27, 2012 17:06
ufw firewall attributes
override_attributes(
"firewall" => {
"rules" => [
"internal" => {
"interface" => "eth1",
"action" => "allow"
},
"everything" => {
"action" => "deny"
}
@ctdk
ctdk / github.js.diff
Created June 13, 2012 17:39
Diff to fix Octopress' github.js to make it not use the deactivated Github v2 API
diff --git a/source/javascripts/github.js b/source/javascripts/github.js
index 678775a..bc4c9bd 100644
--- a/source/javascripts/github.js
+++ b/source/javascripts/github.js
@@ -3,22 +3,22 @@ var github = (function(){
var i = 0, fragment = '', t = $(target)[0];
for(i = 0; i < repos.length; i++) {
- fragment += '<li><a href="'+repos[i].url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>';
+ fragment += '<li><a href="'+repos[i].html_url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>';
include_recipe "apt"
apt_repository "moomoo" do
distro = (node[:platform_version].to_i == 5) ? "lenny" : "squeeze"
uri "http://debian.foo.us/debian"
components [ "main", "contrib" ]
distribution distro
key "http://debian.foo.us/bar.asc"
action :add
end
lookup load_host {
entry host=cassandra* {
highCrit = 10
highWarn = 8
}
entry host=mariadb* {
highCrit = 8
highWarn = 6
}
entry host=* {
{% if site.twitter_user %}
<section>
<h1>On Twitter:</h1>
<div>
<p><br /><a href="http://twitter.com/{{ site.twitter_user }}" target="_blank">My Tweets, on Twitter.</a></p>
<a href="http://twitter.com/{{ site.twitter_user }}" class="twitter-follow-button" data-show-count="{{ site.twitter_show_follower_count }}">Follow @{{ site.twitter_user }}</a>
</div>
</section>
{% endif %}
int xiafs_rename(struct inode * old_dir, const char * old_name, int old_len,
struct inode * new_dir, const char * new_name, int new_len,
int must_be_dir)
{
/* TODO: Come back and fix race condition stuff */
static struct wait_queue_head_t * wait = NULL;
static int lock = 0;
int result;
while (lock)