Skip to content

Instantly share code, notes, and snippets.

View montanaflynn's full-sized avatar

Montana Flynn montanaflynn

View GitHub Profile
@montanaflynn
montanaflynn / BENCHMARK.md
Last active January 29, 2021 13:27
Kong Benchmark Setup

To reproduce Kong's benchmark please follow these instructions.

Create AWS Instances

Spin up three m3.medium EC2 ubuntu 14.04 instances with public DNS enabled and configure them for high network traffic by increasing these limits:

Added fs.file-max=80000 to /etc/sysctl.conf

Added the following lines to /etc/security/limits.conf

@montanaflynn
montanaflynn / install.md
Last active October 24, 2018 14:35
Quickly install Kong on Ubuntu 14.04

Install Java, Cassandra & Kong on Ubuntu 14.04

sudo apt-get install -y wget
wget -O kong-install.sh http://git.io/vmMjv
cat kong-install.sh
chmod +x kong-install.sh
sudo ./kong-install.sh
source ~/.bash_profile
sudo cassandra
@montanaflynn
montanaflynn / main.go
Last active August 29, 2015 14:20
Docker Metrics API
package main
import (
"encoding/json"
"flag"
"github.com/PuerkitoBio/goquery"
"github.com/pmylund/go-cache"
"io/ioutil"
"log"
"net/http"
package main
import (
"fmt"
"reflect"
)
type mapf func(interface{}) interface{}
func Map(in interface{}, fn mapf) interface{} {
@montanaflynn
montanaflynn / kong-metrics-api.go
Last active August 29, 2015 14:21
Kong Metrics
package main
import (
"flag"
"encoding/json"
"github.com/PuerkitoBio/goquery"
"io/ioutil"
"net/http"
"strconv"
)
@montanaflynn
montanaflynn / shortcount.go
Created May 12, 2015 01:59
Short Number Count
package main
import (
"fmt"
"math"
"strconv"
)
func Round(input float64, places int) (rounded float64) {
if math.IsNaN(input) {
@montanaflynn
montanaflynn / fi.sh
Created May 19, 2015 20:36
zen terminal
#!/usr/bin/env fish
# Ubuntu Message of The Day
if test -f /etc/update-motd.d/*
chmod -x /etc/update-motd.d/*
end
# Fish Shell Greeting
set line1 "# Don't Show Fish Greeting"
set line2 "set --erase fish_greeting"
@montanaflynn
montanaflynn / fizzbuzz.go
Last active October 27, 2015 19:03
FizzBuzz with Golang channels
package main
import (
"fmt"
)
const fizz string = "Fizz"
const buzz string = "Buzz"
func fizzbuzz(cnt chan int, msg chan string) {

Start Kong

kong start

Register API with Kong

curl -i -X POST \
  --url http://localhost:8001/apis/ \
 --data 'name=mockbin' \