Skip to content

Instantly share code, notes, and snippets.

@ctdk
ctdk / grafana.rb
Created April 22, 2016 16:36
grafana formula, in progress
require "language/go"
class Grafana < Formula
desc "Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB."
homepage "https://grafana.org"
url "https://github.com/grafana/grafana/archive/v3.0-beta5.tar.gz"
version "3.0-beta5"
sha256 "db9fcc0f4d90236d0cdaba2ab1ddd06bc59264aff93ead5c3a1b680804c8f8cd"
head "https://github.com/grafana/grafana.git"
lookup load_host {
entry host=cassandra* {
highCrit = 10
highWarn = 8
}
entry host=mariadb* {
highCrit = 8
highWarn = 6
}
entry host=* {
@ctdk
ctdk / node-test-bigger.rb
Created June 22, 2015 20:53
A ruby script to create a whole bunch of chef nodes.
#!/usr/bin/env ruby
require 'chef-api'
require 'fauxhai'
include ChefAPI::Resource
ChefAPI.configure do |config|
config.endpoint = 'http://HOSTNAME:4545'
config.client = 'admin'
@ctdk
ctdk / gist:9a1109f198ac924e308d
Last active August 29, 2015 14:07
First light
nineveh:goiardi-test jeremy$ knife raw /organizations
{
"default": "http://nineveh.local:4545/organizations/default"
}
nineveh:goiardi-test jeremy$ knife raw /organizations/default
{
"name": "default",
"full_name": "default org",
"guid": "1d40f87ac0b9438f8c20f67c684c32c1"
@ctdk
ctdk / velikij.go
Last active August 29, 2015 14:06
A sample plugin for gosudar.
package main
// A demonstration of a gosudar plugin. For now, place the compiled binary in /tmp/plugins.
import (
"net"
"net/rpc/jsonrpc"
"os"
)
{
"apt": {
"1.1.2": {
"dependencies": {
},
"location_path": "http://nineveh.local:4545/cookbooks/apt/1.1.2",
"location_type": "chef_server"
}
},
"build-essential": {
@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'
%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 / 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
@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