Skip to content

Instantly share code, notes, and snippets.

View go.mod
module otel-ping
go 1.15
require (
github.com/census-instrumentation/opencensus-proto v0.2.1
github.com/gogo/protobuf v1.3.2 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
go.opentelemetry.io/otel v0.19.0
go.opentelemetry.io/otel/exporters/otlp v0.19.0
View dump_notes.py
#!/usr/bin/env python
import hashlib
import binascii
import os
from evernote.api.client import EvernoteClient
from evernote.edam.notestore.ttypes import NoteFilter, NotesMetadataResultSpec
auth_token = ""
View gcal.go
// List or summarize upcoming calendar events
// auth handling from https://developers.google.com/calendar/quickstart/go
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
View traceparent.go
package main
import (
cryptorand "crypto/rand"
"encoding/binary"
"fmt"
"log"
"math/rand"
"time"
)
View cgs.go
package main
import (
"log"
"os"
"path"
"strconv"
"github.com/davecgh/go-spew/spew"
"github.com/elastic/gosigar"
@graphaelli
graphaelli / Dockerfile
Last active Oct 5, 2020
Caffe with Python3 on Centos 7
View Dockerfile
FROM centos:7
MAINTAINER graphaelli "http://g.raphaelli.com/2016/01/04/centos-python3-caffe.html"
RUN yum -y update && yum clean all
# python3 deps
RUN yum -y groupinstall 'Development Tools'
RUN yum -y install bzip2-devel db4-devel gdbm-devel libpcap-devel ncurses-devel openssl-devel readline-devel sqlite-devel xz-devel zlib-devel
# jupyter deps
RUN yum -y install epel-release
RUN yum -y install blas-devel freetype-devel gcc gcc-c++ gcc-fortran git hdf5-devel lapack-devel libjpeg-turbo-devel libpng-devel make opencv-devel patch readline-devel zeromq-devel
@graphaelli
graphaelli / batch-update.sql
Created Apr 19, 2017
batch postgresql updates with a CTE
View batch-update.sql
-- based on https://news.ycombinator.com/item?id=9018756
=# select *, 'foo'::text into test from generate_series(1,5) as id;
SELECT 5
Time: 77.975 ms
=# select * from test;
┌────┬──────┐
│ id │ text
├────┼──────┤
1 │ foo │
2 │ foo │
View load.go
package main
import (
"bytes"
"compress/zlib"
"context"
cryptorand "crypto/rand"
"encoding/binary"
"flag"
"fmt"
@graphaelli
graphaelli / sampleflaskapm.py
Created Feb 27, 2018
sample elastic apm flask app
View sampleflaskapm.py
#!/usr/bin/env python
import elasticapm
from elasticapm.contrib.flask import ElasticAPM
from flask import Flask
# initialize using environment variables from elasticapm.contrib.flask import ElasticAPM
app = Flask(__name__)
@graphaelli
graphaelli / test_pg_conn_mock.py
Created Dec 9, 2016
test pg connection mock
View test_pg_conn_mock.py
#!/usr/bin/env python
from __future__ import print_function
try:
import mock
except ImportError:
from unittest import mock
import unittest