Skip to content

Instantly share code, notes, and snippets.

View semistrict's full-sized avatar

Ramon semistrict

View GitHub Profile
@semistrict
semistrict / main.go
Last active June 27, 2018 02:50
How to avoid sending logging spans to Stackdriver with OpenCensus
package main
import (
"context"
"log"
"time"
"cloud.google.com/go/logging"
"contrib.go.opencensus.io/exporter/stackdriver"
"go.opencensus.io/trace"

grpctrace

-- import "go.opencensus.io/plugin/grpc/grpctrace"

Package grpctrace is a package to assist with tracing incoming and outgoing gRPC requests.

Usage

type ClientStatsHandler

@semistrict
semistrict / gradlew
Last active December 26, 2015 23:19
gradlew search script
#!/bin/bash
_dir=$(pwd -P)
_lastdir=
until [ "$_dir" -ef "$_lastdir" ]; do
_cmd="$_dir/gradlew"
if test -e "$_cmd"; then
exec "$_cmd" "$@"
return $?
@semistrict
semistrict / require-integrated.sh
Last active December 17, 2015 00:38
Script to check all branches have been merged to trunk (Subversion)
#!/bin/bash
# Finds changes on all branches that have not yet been merged to trunk.
# Does not consider changes that have happened today.
[[ -n $SVNBASE ]] || {
echo "Set SVNBASE environment variable"
exit 2
}
@semistrict
semistrict / run-dnsmasq.sh
Last active January 26, 2017 15:22
Script to run dnsmasq
#!/bin/bash
# These values need to be unique per host-only network
DNSMASQ_IFACE=${1-vboxnet0} # The host-only network interface name (should show up with 'ifconfig -a')
NETWORK_PREFIX=${2-192.168.56} # Network prefix must be unique per host
# You may want to customize the following:
DNSMASQ_DOMAIN=${DNSMASQ_IFACE} # Domain in which names assigned by dnsmasq appear, e.g. myvirtualbox1.vboxnet0
VBOX_HOST_IP="${NETWORK_PREFIX}.1"
VBOX_NETMASK=255.255.255.0
@semistrict
semistrict / dnsmasq.conf
Last active February 27, 2018 16:16
dnsmasq.conf for VirtualBox on OSX
# Set this to the name of your VirtualBox host-only interface.
# dnsmasq will listen for DHCP and DNS requests on this interface as
# well as the loopback:
interface=vboxnet0
# This option will be forced anyway on OS X so set here to avoid a warning:
bind-interfaces
# Enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally