Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am rybit on github.
  • I am rybit (https://keybase.io/rybit) on keybase.
  • I have a public key ASBHvfdHJq_uscOtNO0IXp_-cdm7VCDryxx1p2-53c635wo

To claim this, I am signing this object:

package main
import (
"errors"
"fmt"
"os"
"reflect"
"strconv"
"strings"
@rybit
rybit / deploy_analysis_script.go
Created March 18, 2020 00:17
a script to take some CSV data and do percentiles
package main
import (
"bufio"
"fmt"
"log"
"math"
"os"
"sort"
"strconv"
package main
import (
"context"
"crypto/tls"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@rybit
rybit / scanner.go
Last active November 7, 2018 21:27
package main
import (
"compress/gzip"
"encoding/json"
"flag"
"fmt"
"io"
"log"
"os"
# stdlib
from collections import defaultdict
from urlparse import urlparse
import re
# 3rd party
import requests
# project
from checks import AgentCheck

Keybase proof

I hereby claim:

  • I am rybit on github.
  • I am rybit (https://keybase.io/rybit) on keybase.
  • I have a public key ASAosgcZ2jA3D97x7rBHabyC_eFyYsqBHt07qERJ94CVEwo

To claim this, I am signing this object:

@rybit
rybit / jws-example.go
Created August 8, 2017 19:00
example of jws
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"hash"
ryan@rabbitmq-aws-jfk-1:~$ sudo rabbitmq-server start
RabbitMQ 3.6.9. Copyright (C) 2007-2016 Pivotal Software, Inc.
## ## Licensed under the MPL. See http://www.rabbitmq.com/
## ##
########## Logs: /var/log/rabbitmq/rabbitmq-aws-jfk-1.log
###### ## /var/log/rabbitmq/rabbitmq-aws-jfk-1-sasl.log
##########
Starting broker...
@rybit
rybit / pool.go
Created May 5, 2017 23:40
worker pool with timed shutdown
func StartWorkerPoolWithTimedShutdown(batchSize, numWorkers int, endpoint string) (chan<- string, chan time.Duration) {
externalShutdown := make(chan time.Duration)
work := make(chan string)
// use a sync.WaitGroup to ensure that we wait for all of the workers to Finished
wg := new(sync.WaitGroup)
// use a context with a cancel method to signal internally to shutdown the worker
ctx, cancel := context.WithCancel(context.Background())