Skip to content

Instantly share code, notes, and snippets.

Avatar

Gil Raphaelli graphaelli

View GitHub Profile
View go.mod
module otel-ping
go 1.15
require (
github.com/census-instrumentation/opencensus-proto v0.3.0
github.com/gogo/protobuf v1.3.2
go.opentelemetry.io/otel v1.6.3
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.29.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.29.0
@graphaelli
graphaelli / zube.go
Created Dec 5, 2019
Zube API Client
View zube.go
package main
import (
"crypto/rsa"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
@graphaelli
graphaelli / Vagrantfile
Created Sep 22, 2021
nomad on Ubuntu 21.10
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.boot_timeout = 600
config.vm.box = "ubuntu/impish64"
config.vm.network "public_network", bridge: "en0: Wi-Fi (Wireless)", use_dhcp_assigned_default_route: true
config.vm.network "forwarded_port", guest: 4646, host: 4646, auto_correct: true, host_ip: "127.0.0.1"
config.vm.synced_folder ".", "/vagrant", disabled: false
# vagrant plugin install vagrant-disksize
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
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 │