This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module github.com/tink-ab/tink-backend/src/nats-checker | |
require ( | |
github.com/nats-io/gnatsd v1.4.1 // indirect | |
github.com/nats-io/go-nats v1.7.2 | |
github.com/nats-io/nkeys v0.0.2 // indirect | |
github.com/nats-io/nuid v1.0.1 // indirect | |
github.com/oklog/ulid v1.3.1 | |
github.com/prometheus/client_golang v0.9.2 | |
golang.org/x/sys v0.0.0-20190425045458-9f0b1ff7b46a // indirect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install using: | |
# curl https://gist.github.com/JensRantil/ba21c50e7720bfc62050/raw/c34825afc94940388b1b1dca2abe4c813211ecd0/install.sh | bash -e | |
# ...but PLEASE have a look at the URL to make sure its sane first! | |
# | |
# An alternative is obviously to download the script and executing it. | |
# Fail early. | |
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import requests | |
import os | |
import pprint | |
def request(url): | |
return requests.get(url, auth=('JensRantil', os.environ['APIKEY']), headers={"Accept": "application/vnd.github.hellcat-preview+json"}) | |
teams = dict([(e['id'], e['name']) for e in request('https://api.github.com/orgs/tink-ab/teams').json()]) | |
pprint.pprint(teams) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash-3.2$ curl -v http://localhost:8080/bar && echo | |
* Trying ::1... | |
* TCP_NODELAY set | |
* Connected to localhost (::1) port 8080 (#0) | |
> GET /bar HTTP/1.1 | |
> Host: localhost:8080 | |
> User-Agent: curl/7.54.0 | |
> Accept: */* | |
> | |
< HTTP/1.1 200 OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew install go --cross-compile-all | |
==> Downloading https://go.googlecode.com/files/go1.1.2.src.tar.gz | |
Already downloaded: /Library/Caches/Homebrew/go-1.1.2.tar.gz | |
==> ./make.bash --no-clean | |
==> ./make.bash --no-clean | |
==> ./make.bash --no-clean | |
/private/tmp/go-q5rl/go/src/cmd/5l/../ld/lib.c:661:9: error: no case matching constant switch condition '53' [-Werror] | |
switch(thechar){ | |
^~~~~~~ | |
1 error generated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
MINIONID="$1" | |
SYNCMODULESLOG=$(mktemp) | |
SHOWTOPLOG=$(mktemp) | |
PILLARITEMSLOG=$(mktemp) | |
SHOWHIGHSTATELOG=$(mktemp) | |
# `--force-color` below is needed since we are writing output to a file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Extract mean, median and percentiles from `nodetool cfhistogram` output. | |
Usage: | |
1. Run this script. | |
2. Paste in the output from a read or write latency histograms. | |
3. Press CTRL+D (to close stdin file descriptor). | |
""" | |
import sys | |
import collections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modifies $httpProvider for correct server communication (POST variable format) | |
angular.module('http-post-fix', [], function($httpProvider) { | |
// This code is taken from http://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/ | |
// Use x-www-form-urlencoded Content-Type | |
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; | |
// Override $http service's default transformRequest | |
$httpProvider.defaults.transformRequest = [function(data) { | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./nsqd -lookupd-tcp-address localhost:4160 | |
[nsqd] 2017/03/05 19:59:58.009064 nsqd v0.3.8 (built w/go1.6.2) | |
[nsqd] 2017/03/05 19:59:58.009214 ID: 219 | |
[nsqd] 2017/03/05 19:59:58.010869 TOPIC(testtopic): created | |
[nsqd] 2017/03/05 19:59:58.011079 NSQ: persisting topic/channel metadata to nsqd.219.dat | |
[nsqd] 2017/03/05 19:59:58.011626 DISKQUEUE(testtopic): readOne() opened testtopic.diskqueue.000000.dat | |
[nsqd] 2017/03/05 19:59:58.013017 TCP: listening on [::]:4150 | |
[nsqd] 2017/03/05 19:59:58.013208 HTTP: listening on [::]:4151 | |
[nsqd] 2017/03/05 19:59:58.013216 LOOKUP(localhost:4160): adding peer | |
[nsqd] 2017/03/05 19:59:58.013269 LOOKUP connecting to localhost:4160 |