Skip to content

Instantly share code, notes, and snippets.

View plerohellec's full-sized avatar

Philippe Le Rohellec plerohellec

View GitHub Profile
@plerohellec
plerohellec / recv_link.rb
Created December 14, 2015 18:38
Using Messenger#get_link to set a filter
$ ./simple_recv.rb -a 'amqps://eh01-manage:<key val>=@plrtest-02.servicebus.windows.net/eh01/ConsumerGroups/qpid01/Partitions/1' -m 1
/usr/local/rvm/gems/ruby-1.9.3-p484-railsexpress/gems/qpid_proton-0.3/lib/core/ssl.rb:104:in `initialize': wrong number of arguments (2 for 4) (ArgumentError)
from /usr/local/rvm/gems/ruby-1.9.3-p484-railsexpress/gems/qpid_proton-0.3/lib/reactor/connector.rb:84:in `new'
from /usr/local/rvm/gems/ruby-1.9.3-p484-railsexpress/gems/qpid_proton-0.3/lib/reactor/connector.rb:84:in `connect'
from /usr/local/rvm/gems/ruby-1.9.3-p484-railsexpress/gems/qpid_proton-0.3/lib/reactor/connector.rb:37:in `on_connection_local_open'
from /usr/local/rvm/gems/ruby-1.9.3-p484-railsexpress/gems/qpid_proton-0.3/lib/event/event_base.rb:26:in `dispatch'
from /usr/local/rvm/gems/ruby-1.9.3-p484-railsexpress/gems/qpid_proton-0.3/lib/event/event.rb:212:in `dispatch'
from /usr/local/rvm/gems/ruby-1.9.3-p484-railsexpress/gems/qpid_proton-0.3/lib/reactor/global_
@plerohellec
plerohellec / memcached_segfault
Created May 27, 2013 16:27
Memcached gem crash with 1.9.3-p429
/usr/local/rvm/rubies/ruby-1.9.3-p429/bin/ruby -I"lib:ext:bin:test" -I"/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/rake-10.0.4/lib" "/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/rake-10.0.4/lib/rake/rake_test_loader.rb" "test/test_helper.rb" "test/unit/memcached_test.rb" "test/unit/rails_test.rb" "test/unit/memcached_experimental_test.rb" "test/unit/binding_test.rb"
*** Mocha deprecation warning: Change `require 'mocha'` to `require 'mocha/setup'`.
Run options:
# Running tests:
......................................./home/philippe/src/plerohellec/memcached/lib/memcached/memcached.rb:499: [BUG] Segmentation fault
ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux]
@plerohellec
plerohellec / gist:3753316
Created September 20, 2012 00:53
Parsed access.log for algo.json
THIS MORNING BETWEEN MIDNIGHT AND 1AM
plerohellec@web-001 ~ $ cat /var/log/nginx/access.log | ./parse_access_logs.rb 10000
..........
Adobe user agents:
00217: Mozilla/5.0 (Windows; U; de-DE) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/3.4 300222/Yammer
00351: Mozilla/5.0 (Windows; U; ja-JP) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/3.4 300222/Yammer
00380: Mozilla/5.0 (Windows; U; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/3.1
00409: Mozilla/5.0 (Windows; U; ko-KR) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/3.4 300222/Yammer
00420: Mozilla/5.0 (Windows; U; nl-NL) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/3.4 300222/Yammer
00434: Mozilla/5.0 (Windows; U; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/3.2 300222/Yammer
@plerohellec
plerohellec / test_attr_perfs.rb
Created April 18, 2012 22:43
Test attributes.keys vs attribute_names
require 'benchmark'
repeat = 10000
# class NetworkContextValidator
# def after_find(record)
# SecurityContext.validate(record, &@b)
# end
# end
$ sbt update
Project does not exist, create new project? (y/N/s) y
Name: Feedie
Organization: Yammer
Version [1.0]:
Scala version [2.7.7]:
sbt version [0.7.4]:
Getting Scala 2.7.7 ...
downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.7.7/scala-compiler-2.7.7.jar ...
[SUCCESSFUL ] org.scala-lang#scala-compiler;2.7.7!scala-compiler.jar (4462ms)
active_record/base.rb:1129 with_scope
active_record/associations/association_collection.rb:69 find
active_record/relation/finder_methods.rb:122 first # FinderMethod = module included into AR::Relation
active_record/relation/finder_methods.rb:343 first find_first
active_record/relation/query_methods.rb:88 limit
active_record/relation.rb:62 to_a
active_record/relation/query_methods.rb:149 arel
record_cache-0.9.6/lib/record_cache.rb:96 find_by_sql
@plerohellec
plerohellec / rate_limit_errors.txt
Created January 18, 2012 18:12
Users getting rate_limit_exceeded errors with count for 1/17 on stageweb-001
100076 203072
100860 13332
101013 1334
100498 1310
101846 716
98810 707
99520 692
99999 674
100720 214
101298 210
@plerohellec
plerohellec / init_env.trace
Created July 28, 2011 01:05
Stacktrace for rake dev:init_environment
$ rake dev:init_environment --trace
(in /home/philippe/src/workfeed)
** Invoke dev:init_environment (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute dev:init_environment
"Updating existing client: 11 Apple Push Device"
"Updating existing client: 1885 Android"
"Updating existing client: 590 Yammer ADSync"
"Updating existing client: 2009 Yammer Windows Notifier"