This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gem found matching: jruby-openssl (= 0.8.7) | |
Gem found matching: jruby-win32ole (>= 0) | |
Gem found matching: jdbc-mysql (>= 0) | |
Gem found matching: msgpack-jruby (>= 0) | |
Gem found matching: cinch (>= 0) | |
Gem found matching: spoon (>= 0) | |
Gem found matching: mocha (>= 0) | |
Gem found, but funky: shoulda (>= 0) (Unable to activate bourne-1.1.2, because mocha-0.13.3 conflicts with mocha (= 0.10.5)) | |
Gem found matching: rspec (>= 0) | |
Gem found matching: insist (= 0.0.8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run with "jruby --1.9 /path/to/this.rb" and wait 10 minutes | |
class Thing | |
def initialize | |
require 'cabin' | |
@logger = Cabin::Channel.new | |
sout = Logger.new(STDOUT) | |
@logger.level = :debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns tyrekick.core | |
(:use ring.adapter.jetty ring.util.response ring.middleware.json) | |
(:gen-class)) | |
(defn handler | |
"dead simple to get benchmark reqs/sec" | |
[request] | |
(response {:message "hello nasty"})) | |
(defn app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn widdershins [coll] | |
(letfn [(flip [tocoll fromcoll] | |
(if (empty? fromcoll) | |
tocoll | |
(flip (cons (first fromcoll) tocoll) (rest fromcoll)) | |
) | |
)] | |
(flip [] coll) | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@topcat logstash]# java -jar logstash-1.0.12-monolithic.jar agent -f logstash-simple.cnf | |
{:args=>["agent", "-f", "logstash-simple.cnf"]} | |
W, [2011-06-27T10:36:21.439000 #27280] WARN -- runner.class: Input #<LogStash::Inputs::Syslog:0x12297d7> shutting down | |
2011-06-27T09:36:21.991000Z syslog://10.1.2.3: <30>ntpd[3355]: synchronized to 1.2.3.4, stratum 2 | |
2011-06-27T09:36:22.631000Z syslog://10.2.32.2: <14>ncpd: cmd=0, len=14, data: BB BB 00 1C 00 00 00 00 1C 3F 00 00 00 00 | |
... | |
... | |
[root@topcat logstash]# cat logstash-simple.cnf | |
input { | |
syslog { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[sisred@buckaroo graylog2-web-interface]$ jruby -S gem install arel | |
System.java:-2:in `arraycopy': java.lang.ArrayIndexOutOfBoundsException | |
from DefaultResolver.java:111:in `makeTime' | |
from DefaultResolver.java:277:in `create' | |
from DefaultResolver.java:317:in `handleScalar' | |
from DefaultResolver.java:435:in `orgHandler' | |
from DefaultResolver.java:455:in `node_import' | |
from DefaultResolver$s$1$0$node_import.gen:65535:in `call' | |
from CachingCallSite.java:137:in `call' | |
from RubyLoadHandler.java:40:in `handle' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cron { "logshipping.cronjob": | |
command => $logshippingscript, | |
require => File[$logshippingscript], | |
hour => 15, | |
minute => 01, | |
user => "apache" | |
} | |
file { $logshippingscript : | |
owner => apache, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class mongodb::repo { | |
yumrepo { "10gen repository": | |
enabled => 1, | |
descr => "10gen repository", | |
baseurl => case $architecture { | |
i686: {"http://downloads.mongodb.org/distros/centos/5.4/os/x86_64/"} | |
default: { "baseurl=http://downloads.mongodb.org/distros/centos/5.4/os/i386/"} | |
}, | |
gpgcheck => 0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function counterSetup(logcheckpoint) { | |
var hitcount = 0; | |
var logcheckpoint = logcheckpoint || 1000; | |
return function hitCount(req, res, next) { | |
hitcount++; | |
if (hitcount % logcheckpoint == 0 ) { | |
console.log(hitcount + " hits"); | |
} | |
next(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# JRuby version of ImageScience (other image toolkits are available) | |
require 'image_voodoo' | |
class ImageSizer | |
def initialize(app, mime_types=%w[image/jpeg image/png image/gif]) | |
@app = app | |
@mime_types = mime_types | |
end | |
def call(env) |