Skip to content

Instantly share code, notes, and snippets.

@ctdk
ctdk / clang.patch
Last active December 19, 2015 04:29
clang patch for tcp_wrappers for clang. Used per https://trac.macports.org/browser/trunk/dports/net/tcp_wrappers
--- tcp_wrappers-20.orig/tcp_wrappers/fix_options.c 1999-04-22 18:57:28.000000000 -0700
+++ tcp_wrappers-20/tcp_wrappers/fix_options.c 2013-06-30 17:27:44.000000000 -0700
@@ -28,7 +28,7 @@ static char sccsid[] = "@(#) fix_options
#define BUFFER_SIZE 512 /* Was: BUFSIZ */
/* fix_options - get rid of IP-level socket options */
-
+void
fix_options(request)
struct request_info *request;
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)
{% 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 %}
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
@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>';
@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"
}
(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:1123201
Created August 3, 2011 17:20
dk4 default recipe
#
# Cookbook Name:: dk4
# Recipe:: default
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
include_recipe "apache2"
@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