Skip to content

Instantly share code, notes, and snippets.

View danriti's full-sized avatar

Dan Riti danriti

View GitHub Profile
@danriti
danriti / keybase.md
Created January 6, 2017 16:29
keybase.md

Keybase proof

I hereby claim:

  • I am danriti on github.
  • I am danriti (https://keybase.io/danriti) on keybase.
  • I have a public key whose fingerprint is 9194 075E F796 62A4 B932 F80D 8334 5A61 B4F5 74A2

To claim this, I am signing this object:

@danriti
danriti / vector.md
Last active March 9, 2016 02:30
pcp + vector + filtered per process stats

run on ubuntu 12.04

  1. install pcp from source following: https://github.com/Netflix/vector/wiki/Installing-Performance-Co-Pilot
  2. install vector following: https://github.com/Netflix/vector/wiki/Getting-Started#vector
  3. update pmwedb config to use port 9999 by default: /etc/pcp/pmwebd/pmwebd.options
  4. sudo service pmwebd restart
  5. update pmcd to run proc pmda as root (add -A flag): /etc/pcp/pmcd/pmcd.conf
  6. sudo service pcp restart
  7. run vector via gulp: https://github.com/Netflix/vector/wiki/Getting-Started#running-with-gulp
  8. created a hotproc.conf in /var/lib/pcp/pmdas/proc
@danriti
danriti / gist:41a1a3fd4af534955187
Created February 10, 2015 14:46
nginx simple proxy settings
location / {
proxy_pass http://localhost:3000/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
@danriti
danriti / pypi.md
Last active January 18, 2016 17:48
pypi release notes / checklist

Basic Instruction Before Releasing to PyPI

  1. Update history

  2. Increment version

  3. Run tox tests for Python 2.7, 3.2, 3.3, 3.4, 3.5:

    PATH=~/opt/bin 
    export TV_API_KEY=XXX
    

export TV_APP_NAME=XXX

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@danriti
danriti / plot.py
Last active August 29, 2015 14:01
PHP Average Latency By Week
from datetime import datetime
import matplotlib.pyplot as plt
import traceview
API_KEY = 'API KEY HERE'
def main():
tv = traceview.TraceView(API_KEY)
results = tv.server.latency_by_layer('Default', time_window='week')
@danriti
danriti / pi.py
Last active August 29, 2015 13:57 — forked from Py-Gon-Gin/pi.py
#!/usr/bin/env python
import sys
import subprocess
def print_wiki_options(file) :
subprocess.call("clear")
with open(file, 'r') as f :
for line in f:
sys.stdout.write(line)
@danriti
danriti / README.md
Last active February 26, 2022 07:20
Line Profiling in Python

Install the line_profiler module:

[driti@ubuntu ]$ pip install line_profiler

Add the @profile decorator and run:

[driti@ubuntu ]$ kernprof.py -l -v example.py
@danriti
danriti / pickaxe.sh
Created December 13, 2013 18:42
Search git log for a specific code change.
git log -S"validate=True" -- boto/s3/connection.py
@danriti
danriti / Gemfile
Last active December 30, 2015 23:28
Sinatra Example for TraceView Heroku Add-on
source "https://rubygems.org"
ruby "2.0.0"
gem 'sinatra'
group :production, :staging do
gem 'oboe-heroku', '~> 0.9.10.0'
end