Skip to content

Instantly share code, notes, and snippets.

# run very flat apps with merb -I <app file>.
# use_orm :datamapper
use_test :rspec
require 'haml'
require 'compass'
Merb::Config.use { |c|
c[:framework] = { :public => [Merb.root / "public", nil] }
c[:session_store] = 'none'
c[:exception_details] = true
diff --git a/app/controllers/reporting.rb b/app/controllers/reporting.rb
index 3a6768f..662bdd9 100644
--- a/app/controllers/reporting.rb
+++ b/app/controllers/reporting.rb
@@ -24,34 +24,6 @@ class Reporting < Application
if instance.status == :running
Merb.logger.error! "instance(#{instance.amazon_id}) ALERT!\n SEVERITY: #{params[:data]['Severity']}\n PLUGIN:#{params[:data]['Plugin']} TYPE:#{params[:data]['Type']}\n MESSAGE:#{params[:data]['alert_message']}"
Alert.create_from_json(instance, params['data'])
- environment = Environment.get instance.environment.id
- if environment.alerting_enabled
require 'rubygems'
require 'typhoeus'
response = Typhoeus::Request.run('http://127.0.0.1:3001', {})
p response.headers_hash
## => {"HTTP/1.1 200 OK"=>nil, "Date"=>"...", "Content-Length"=>"12", "Connection"=>"close"}
@benburkert
benburkert / dpkg.rb
Created August 10, 2011 19:36 — forked from jedi4ever/dpkg-gnutar
homebrew formula to get dpkg working on a mac
require 'formula'
class Dpkg <Formula
url 'https://launchpad.net/debian/+archive/primary/+files/dpkg_1.16.0.3.tar.bz2'
homepage 'http://en.wikipedia.org/wiki/Dpkg'
md5 '0266b06ef9da8278cea008d21e17e5f6'
depends_on 'gnu-tar'
def patches
@benburkert
benburkert / changelog.md
Created November 4, 2011 08:08
GitHub:Enterprise Changelog

November 4th 2011

Version: 11.10.27

Enterprise Changes

  • Bug fixes related to LDAP & Active Directory integration.
  • Fix the default .ovf path to be compatible with windows paths.
@benburkert
benburkert / single-shot.sh
Created November 8, 2011 02:04
a single shot web server
#!/bin/bash
if [[ -z $1 ]] ; then
echo "File argument missing" 1>&2
exit 1
else
file="$1"
fi
if [[ -z $2 ]] ; then
Rubinius Crash Report #rbxcrashreport
Error: signal SIGSEGV
[[Backtrace]]
0 rbx 0x0000000103165011 _ZN8rubiniusL12segv_handlerEi + 241
1 libsystem_c.dylib 0x00007fff94341cfa _sigtramp + 26
2 ??? 0x0000000106e33540 0x0 + 4410520896
3 libsystem_c.dylib 0x00007fff942eb338 fileno + 31
4 kgio_ext.bundle 0x00000001065dd601 my_fileno + 84
@benburkert
benburkert / dpkg.rb
Created January 24, 2012 01:28 — forked from tmm1/dpkg.rb
homebrew formula to get dpkg working a mac
require 'formula'
class Dpkg <Formula
url 'https://launchpad.net/debian/+archive/primary/+files/dpkg_1.16.0.3.tar.bz2'
homepage 'http://en.wikipedia.org/wiki/Dpkg'
md5 '0266b06ef9da8278cea008d21e17e5f6'
depends_on 'gnu-tar'
# depends_on 'cmake'
--- config.guess.orig 2011-09-03 05:51:07.000000000 -0700
+++ config.guess 2012-01-27 21:57:09.000000000 -0800
@@ -1,9 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011, 2012 Free Software Foundation, Inc.
@benburkert
benburkert / sni_test.go
Created March 21, 2012 18:43
go crypto/tls test & patch for SNI
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"errors"