Skip to content

Instantly share code, notes, and snippets.

files = Dir['./db/migrate/*.rb'].sort
now = Time.now.utc
time = Time.utc(now.year, now.month, now.day)
files.each do |full_file|
file = File.basename(full_file)
parts = file.split('_')
raise "probably illegal file name #{file}" if parts.size < 2
if parts[0].size < 7
cmd = "svn move #{full_file} #{full_file.gsub(parts[0], time.to_i.to_s)}"
puts cmd
module CI
module Reporter
# monkey patch that stops it from exploding when used with the new features in
# test/unit 2.0.x.
class Failure
def self.new(fault)
return TestUnitFailure.new(fault) if fault.kind_of?(Test::Unit::Failure)
if Test::Unit.constants.include? "Omission"
return TestUnitSkipped.new(fault) if fault.kind_of?(Test::Unit::Omission)
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
We couldn’t find that file to show.
package org.psi
class UnConstructableClass{
dontExcept
def dontExcept() { b.size}
val b = List()
Loaded suite C:/code/scada/ruby-protobuf/test/test_rerequire
Started
E.
Finished in 0.015625 seconds.
1) Error:
test_re_require(RerequireTest):
Protobuf::TagCollisionError: {Field number 1 has already been used in "Tutorial::Person" by field "name".
C:\code\scada\ruby-protobuf\lib/protobuf/message/message.rb:56:in `define_field'
C:\code\scada\ruby-protobuf\lib/protobuf/message/message.rb:39:in `required'
# this monkey patch for Rails 2.3.5 means each action has its own token, i'm not
# sure if this actually makes things more secure or worse.
ActionController::RequestForgeryProtection.class_eval do
def form_authenticity_token_with_action(*args)
session_var_name = "_csrf_token_#{controller_name}_#{action_name}"
session[session_var_name.to_sym] ||= ActiveSupport::SecureRandom.base64(32)
end
alias_method_chain :form_authenticity_token, :action
end
# based on http://rajith.2rlabs.com/2010/03/01/apache-qpid-securing-connections-with-ssl/
COMPANY="O=GACME,ST=North Carolina,C=US"
CA_NAME="RootCA"
CA_PASS="ccccccccc"
CERT_LOC=~/keys
SERVER_NAME="localhost.localdomain"
SERVER_PASS="sesesese"
Forgive me if this issue has been addressed before but I wasn’t able to unearth anything describing this issue on the web or on this list.
I believe there is a bug in the MailBox implementation. If a receiveWithin block timesout the next message is lost. It appears that the lost message is sent to the previous receiveWithin block, though code inside that block isn’t run either. I have a test case that proves this behavior (http://gist.github.com/547596). Is there something I am missing and this is intentional? If so the documentation needs to be updated to warn about this behavior.
In either case I am looking for a replacement to mailbox. I only stumbled onto this behavior because there was no way to peek into a MailBox and see if there is a message waiting. I was simulating that behavior by doing the shortest possible recieveWithin to check for already existing messages and then doing a longer wait once I had consumed all of the available messages and still hadn’t received the message I wanted.
Thanks f
#sprinkle snipppet to install sun-java-jdk and bypass the license step
package :java_license_agreement do
config_file = '/tmp/java-license-sets'
config_text = %q[
sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-bin shared/present-sun-dlj-v1-1 note
sun-java6-jdk shared/present-sun-dlj-v1-1 note