Skip to content

Instantly share code, notes, and snippets.

View orangewolf's full-sized avatar

Rob Kaufman orangewolf

View GitHub Profile
bg_process = BgProcess.find_in_state(:first, :waiting, :order => "created_at ASC, id asc")
while bg_process
bg_process.check_and_run_process
bg_process = BgProcess.find_in_state(:first, :waiting, :order => "created_at ASC, id asc")
end
Date
====
short:'%e %b' 12 Sep
long:'%B %e, %Y' September 12, 2012
db:'%Y-%m-%d' 2012-09-12
number:'%Y%m%d' 20120912
long_ordinal:'&proc' September 12th, 2012
rfc822:'%e %b %Y' 12 Sep 2012
DateTime
Apr 10 20:43:10 ip-10-188-156-112 god[694]: Unhandled exception (StandardError):
No buffer space available
#012/usr/lib/ruby/gems/1.9.1/gems/god-0.12.1/lib/god/event_handler.rb:62:in `handle_events'
#012/usr/lib/ruby/gems/1.9.1/gems/god-0.12.1/lib/god/event_handler.rb:62:in `block (2 levels) in start'
#012/usr/lib/ruby/gems/1.9.1/gems/god-0.12.1/lib/god/event_handler.rb:60:in `loop'
#012/usr/lib/ruby/gems/1.9.1/gems/god-0.12.1/lib/god/event_handler.rb:60:in `block in start'
Out of memory: kill process 30026 (bash) score 285219 or a child
Killed process 30125 (java) vsz:2276328kB, anon-rss:1729884kB, file-rss:392kB
java invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0
Pid: 30140, comm: java Not tainted 2.6.33.3-xenU #1
Call Trace:
[<c10743d6>] ? dump_header+0x56/0x170
[<c1005c9b>] ? xen_restore_fl_direct_end+0x0/0x1
[<c147f0f1>] ? _raw_spin_unlock_irqrestore+0x11/0x20
[<c1252ea5>] ? ___ratelimit+0xa5/0x110
[<c10745e7>] ? oom_kill_process+0xf7/0x100
if provider.permissions[name].blank?
permitted = false
else
if provider.permissions[name] == "in-network" || provider.permissions[name] == "out-of-network"
permitted = true
else
permitted = false
end
end
original || permitted
index c6a1704..e98119d 100644
--- a/lib/couchchanges.rb
+++ b/lib/couchchanges.rb
@@ -6,7 +6,7 @@ class CouchChanges
def initialize options={}
@options = options.dup
@uri = URI.parse(@options.delete(:url) + "/_changes")
- @last_seq = 0
+ @last_seq = options[:since] || 0
end
class Flight
has_many :locations
has_many :events
validates_uniqeness :flight_number
end
class Event
belongs_to :location
end
smt = StrainMeasurementTask.last
all_delta_r = smt.mydx_analyzing_events.collect do |mde|
raw_delta_r = mde.sample_raw_data.collect do |srd|
srd.delta_r_calculations
end.flatten
calibrated_delta_r = mde.sample_calibrated_data.collect do |scd|
scd.delta_r_calculations
end.flatten
@orangewolf
orangewolf / LowVoltage.rb
Last active September 15, 2015 16:37
Low Voltage
# Routes
get 'templates/:name', as: :template
# Controller
class Templates < ApplicationController
def show
if params[:name] && File.exists?(Rails.root.join('app', 'views', 'templates', params[:name])
render "templates/#{params[:name]}"
end
end
  • Need to tap casks before
  • Ansible does not reinstall home brew
  • Will not reinstall rvm if there is already a ~/.rvm directory

brew tap homebrew/dupes brew install caskroom/cask/brew-cask brew install python pip install mercurial brew install ansible