Skip to content

Instantly share code, notes, and snippets.

@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 / 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
{% 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)
@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;
@ctdk
ctdk / bsdgames-osx.rb
Last active January 21, 2022 15:16
A homebrew formula for installing bsdgames-osx. For now, just plunk it into /usr/local/Library/Formula/ and run "brew install bsdgames-osx". Tested successfully in MacOS X 10.7 and 10.8. If it fails to compile, try adding the "--with-clang" option. Some versions of clang will also require CFLAGS="-std=c11" to compile correctly.
require 'formula'
class BsdgamesOsx < Formula
homepage 'https://github.com/ctdk/bsdgames-osx'
url 'https://github.com/ctdk/bsdgames-osx/archive/bsdgames-osx-2.19.3.tar.gz'
sha1 '31013cbc8fbad71f1e3e0b9b85fd7c943219a99b'
head 'https://github.com/ctdk/bsdgames-osx.git'
version '2.19.3'
depends_on :bsdmake => :build
@ctdk
ctdk / gist:8247645
Created January 3, 2014 22:11
Ohai 6.14.0 data from a debian/390 box with Chef 0.10.10 installed
Linux d390 2.6.32-5-s390x #1 SMP Sun May 6 03:12:45 UTC 2012 s390x
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu May 31 15:06:52 2012 from 10.21.1.1
jeremy@d390:~$ ohai
%w{sites-available sites-enabled mods-available mods-enabled}.each do |dir|
directory "#{node[:apache][:dir]}/#{dir}" do
mode 0755
owner "root"
group "root"
action :create
end
end
@ctdk
ctdk / node_test.rb
Created July 2, 2014 03:49
Create a bunch of nodes & clients with chef-api and fauxhai
#!/usr/bin/env ruby
require 'chef-api'
require 'fauxhai'
include ChefAPI::Resource
ChefAPI.configure do |config|
config.endpoint = 'http://nineveh.local:4545'
config.client = 'admin'