Skip to content

Instantly share code, notes, and snippets.

View pglombardo's full-sized avatar
🕶️

Peter Giacomo Lombardo pglombardo

🕶️
View GitHub Profile
Report 1 (232 bytes)
X-Trace-Header : 2 X-Trace Report ver 1.1
X-Trace : 2 1B70B57EC70701B1B379F0B7A0F9999AF5EAE114D11C4705BACF532624
Layer : 2 RubyGC
Label : 2 entry
ProcessName : 2 12000
TID : 18 12027
Timestamp_u : 18 1399928193538032
Hostname : 2 hanzo
Report 2 (824 bytes)
@pglombardo
pglombardo / gist:9838518
Last active March 23, 2017 20:29
therubyracer and libv8 is wasting my whole afternoon...
compiling message.cc
compiling init.cc
compiling string.cc
compiling handles.cc
compiling signature.cc
compiling locker.cc
linking shared-object v8/init.so
g++: error: /var/www/gameface/shared/bundle/ruby/2.0.0/gems/libv8-3.11.8.17-x86_64-linux/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a: No such file or directory
g++: error: /var/www/gameface/shared/bundle/ruby/2.0.0/gems/libv8-3.11.8.17-x86_64-linux/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_snapshot.a: No such file or directory
make: *** [init.so] Error 1
@pglombardo
pglombardo / gist:9836513
Created March 28, 2014 16:12
Installing libv8 gem enables debugger?
deployer 9646 2566 0 16:08 pts/1 00:00:00 /usr/bin/g++ -DENABLE_DEBUGGER_SUPPORT -DV8_TARGET_ARCH_IA32 -I../src -I../include -Wall -Werror -W -Wn
deployer 9647 9646 99 16:08 pts/1 00:00:09 /usr/lib/gcc/i686-linux-gnu/4.6/cc1plus -quiet -I ../src -I ../include -imultilib . -imultiarch i386-li
areu 9662 5379 0 16:08 pts/2 00:00:00 ps -ef
@pglombardo
pglombardo / openshift.md
Last active August 29, 2015 13:56
Notes on Redhat's OpenShift with Ruby

Newly created applications have pre-populated git repositories so you can't just at another remote to your existing repository and push to openshift - this is an unnecessary step. This occurs even though I didn't request an pre-existing application.

The pre-existing code had a pre-populated config.ru.

Ruby 2.0 not available

Having ruby '2.0.0' doesn't nicely tell you that you're not running Ruby 2.0 (I had the Ruby 1.9 cartridge installed), it instead barfs out an error like this:

pglombardo@themightyshogun:~/Projects/pwpush-heroku $ git push openshift master

Counting objects: 1253, done.

@pglombardo
pglombardo / my_backgroundjob.rb
Last active January 4, 2016 01:49
Using Ruby TraceView to Trace arbitrary background jobs, cron jobs, Ruby scripts etc...
# 2015/06/04 - Updated to follow the gem rename from 'oboe' to 'traceview'
require 'rubygems'
require 'bundler'
Bundler.require
# Make sure traceview is at the bottom of your Gemfile.
# This is likely redundant but just in case.
require 'traceview'
@pglombardo
pglombardo / gist:8401741
Created January 13, 2014 14:58
Tracelyzer Install Error (libedit.so.0) - January 13, 2014
root@hanzo:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
cassandra
The following packages will be upgraded:
base-files liboboe-dev liboboe0 tracelyzer
4 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 794 kB of archives.
@pglombardo
pglombardo / gist:8359840
Last active January 2, 2016 20:49
TraceView on Docker

To get traces generated from a container arrive at the docker host I had to do the following:

On the docker host I run the following to jiggy wig the tracelyzer to listen on something other than 127.0.0.1:

nc -l 172.17.42.1 7831 | nc 127.0.0.1 7831

update: This doesn't forward UDP packets correctly to the dashboard because of a netcat issue. (it was a temporary hack anyways) An IPTables rule or another alternative (socat?) would be a better solution until the Tracelyzer bugfix is shipped.

update 2: Per Adam Tucker, use http://brokestream.com/udp_redirect.c instead

@pglombardo
pglombardo / gist:7896073
Last active December 30, 2015 22:39
How to Instrument puppetmaster-passenger using Oboe::Rack [WIP]
gem install oboe json
@pglombardo
pglombardo / gist:7630100
Last active May 24, 2022 19:14
How to open your private Github repository and still keep a couple things under wrap

We're happy to say that we recently released the code for the TraceView Ruby instrumentation on Github as Open Source. There are a ton of benefits for AppNeta (and the community) in doing this so making the decision was easy... but the process of actually opening the repository and still keeping a few things private was slightly trickier. Here's the route we took that has worked out really well.

The Situation and Strategy

The Ruby instrumentation has always been sheltered on Github - albeit always in a private Github repository. We used the issues, pull requests and wiki pages extensively for everything from new employee resources to hosting screenshots, customer issues, internal discussions and links to other project and management tools (e.g. Asana).

Outside of the commits and the code, everything else was either of little use to the public or potentially company or customer confidential - stuff that shouldn't or couldn't be shared publicly. So this put us

@pglombardo
pglombardo / gist:7206557
Created October 28, 2013 23:19
Using the TraceView Data API to Export Performance Data into Instrumental App
#!/usr/bin/env ruby
require 'rubygems'
require 'instrumental_agent'
require "net/https"
require "uri"
require 'json'
require 'debugger'
INSTRUMENTAL_API_KEY='<insert_your_key>'