Skip to content

Instantly share code, notes, and snippets.

@LeoCavaille
LeoCavaille / keybase.md
Created January 22, 2020 10:42
keybase.md

Keybase proof

I hereby claim:

  • I am leocavaille on github.
  • I am leoc (https://keybase.io/leoc) on keybase.
  • I have a public key ASBSobNvEApafDPbyjmRGHX55u3ksIGgP3uH3rzgxG6rXgo

To claim this, I am signing this object:

@LeoCavaille
LeoCavaille / steps.sh
Created July 16, 2019 13:05
Emergency scripts for Katacoda
#!/bin/bash
# Usage: Remember the last step number you were working on Katacoda and
# if you're stuck you can reset the env by pressing the "shut down" button
# then refresh and:
# * set your Datadog API key below
# * set your Datadog APP key if you were after step 16 as well
# * paste all the commands up to the step you were at before
# FIRST SET YOUR API KEY (AND APP KEY)
This is a test.
def factorielle(n):
if n < 0:
raise ValueError("pas de factorielle pour les nombres negatifs")
result = 1
for i in xrange(1, n+1):
result *= i
return result
@LeoCavaille
LeoCavaille / query.json
Created March 23, 2015 14:56
Treemap JSON payload
{
"size_by": "pct_mem",
"color_by": "user",
"q": "processes{host:myhosta}",
"group_by": "family",
"viz": "treemap",
"requests": []
}
#!/usr/bin/perl
use warnings;
use Data::Dumper;
use IO::Zlib;
use DBI;
my $dbh = DBI->connect("dbi:Pg:dbname=datadog_test;host=localhost;port=15432", "", "");
sub insert_hash {
@LeoCavaille
LeoCavaille / http_check.yaml
Created February 4, 2015 23:44
Using Anchors in dd-agent YAML check configs
defaults: &DEFAULTS
collect_response_time: true
timeout: 42
tags:
- "test:tag"
skip_event: true
init_config:
# Change default path of trusted certificates
@LeoCavaille
LeoCavaille / .gitconfig
Last active June 23, 2020 09:17
How to properly rebase and deal with a contributor's PR
[alias]
checkoutpr = "!f() { git fetch origin refs/pull/$1/head:pr/$1; git checkout pr/$1; } ; f"
checkoutcontrib = "!f() { git checkout master && git pull && git remote add $1 git@github.com:$1/dd-agent && git fetch $1 $2 && git checkout -b $3 $1/$2 && git rebase master } ; f"
@LeoCavaille
LeoCavaille / gae.md
Last active February 26, 2019 23:13 — forked from alq666/gae.md
Custom Datadog metrics on Google App Engine

How to use custom Datadog metrics on Google App Engine

Installation

We will use the dogapi module to instrument your code. There are a lot of ways to ship libraries to Google App Engine using virtualenvs, symlinks, etc. If you already have that, just add to your stack the latest version of dogapi from PyPi.

If not, here is an easy way to use dogapi:

cd $MY_GAE_PROJECT