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
fei = $app.engine.launch(OpenWFE.process_definition(:name => 'four') do | |
sequence do | |
_set :field => 'nes.ted', :val => 'val0' | |
alpha | |
end | |
end) | |
sleep 0.350 | |
assert_process_count 4, nil |
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
irb(main):001:0> require 'ostruct' | |
=> true | |
irb(main):002:0> obj = OpenStruct.new | |
=> #<OpenStruct> | |
irb(main):003:0> class << obj | |
irb(main):004:1> def to_s | |
irb(main):005:2> "string" | |
irb(main):006:2> end | |
irb(main):007:1> end | |
=> nil |
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
{ | |
"_id": "_design/usage", | |
"_rev": "11-4090663094", | |
"language": "javascript", | |
"views": { | |
"daily": { | |
"map": "function(doc) {\n if(doc.user && doc.service && doc.time && doc.action) {\n if(doc.action == \"LOGOUT\" && parseInt(doc.retr) > 0) {\n var date = new Date( doc.time );\n var year = date.getFullYear();\n var month = date.getMonth();\n if( month.toString().length == 1 ) month = '0' + month;\n var day = date.getDate();\n if( day.toString().length == 1 ) day = '0' + day;\n var key = year + '-' + month + '-' + day;\n emit(key, {user: doc.user, size: parseInt(doc.retr)});\n }\n }\n}", | |
"reduce": "function( keys, values, rereduce ) {\n\n var output = {};\n if( !rereduce ) {\n for each( var doc in values ) {\n if( output[doc.user] ){\n output[doc.user]['count'] += 1;\n output[doc.user]['size'] += doc.size;\n }\n else\n {\n output[doc.user] = { 'count': 1, 'size': doc.size };\n |
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
require 'rubygems' | |
require 'mechanize' | |
agent = WWW::Mechanize.new | |
puts "Memory Usage Delta " | |
puts "============ ========" | |
loop do | |
agent.get('http://172.16.133.100:3000/session/new') |
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
<VirtualHost *:80> | |
ServerName foo.com | |
ServerAlias *.foo.com | |
# REST OF CONFIG | |
RailsAllowModRewrite on | |
RewriteCond %{HTTP_HOST} ^foo\.com [NC] | |
RewriteRule ^/(.*)$ http://www.foo.com/$1 | |
</VirtualHost> |
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 Linux | |
class User | |
class << self | |
# Generate an MD5 salt string | |
def salt | |
seeds = ('a'..'z').to_a | |
seeds.concat( ('A'..'Z').to_a ) | |
seeds.concat( (0..9).to_a ) |
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
# steps I took | |
$ git clone [email protected]:kjwierenga/rufus-scheduler.git | |
$ cd rufus-scheduler | |
$ git branch -a | |
* master | |
origin/HEAD | |
origin/master | |
origin/twozero | |
$ git remote add upstream git://github.com/jmettraux/rufus-scheduler.git |
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
Exception `LoadError' at /usr/lib/ruby/site_ruby/1.8/rubygems.rb:871 - no such file to load -- rubygems/defaults/operating_system | |
Exception `LoadError' at /usr/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:35 - no such file to load -- Win32API | |
Exception `LoadError' at /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31 - no such file to load -- ffi | |
/usr/lib/ruby/gems/1.8/gems/ffi-0.3.5/lib/ffi/struct.rb:24: warning: method redefined; discarding old offset | |
Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/ffi-0.3.5/lib/ffi/library.rb:9 - Could not open library '/usr/lib/libuuid.so': /usr/lib/libuuid.so: invalid ELF header | |
Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/ffi-0.3.5/lib/ffi/library.rb:9 - Could not open library '/usr/lib/libuuid.so': /usr/lib/libuuid.so: invalid ELF header | |
Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/ffi-0.3.5/lib/ffi/library.rb:18 - Could not open any of [/usr/lib/libuuid.so] | |
/usr/lib/ruby/gems/1.8/gems/ffi-0.3.5/lib/ffi/library.rb:18:in `ffi_lib': Could no |
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
require 'rubygems' | |
require 'timeout' | |
require 'mq' | |
10.times do |i| | |
puts "Run: #{i}" | |
em = Thread.new { EM.run } | |
q = MQ.queue("test#{i}") |
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
require 'rubygems' | |
require 'eventmachine' | |
$i = 0 | |
EM.run { | |
3.times do |c| | |
EM.next_tick { | |
puts "#{c} : #{$i}" | |
$i += 1 |