Skip to content

Instantly share code, notes, and snippets.

View JensRantil's full-sized avatar

Jens Rantil JensRantil

View GitHub Profile
@JensRantil
JensRantil / go.mod
Last active May 8, 2019 08:10
TopK implementation with filtering from dictionary.
module github.com/JensRantil/topk-challenge
require (
github.com/funkygao/golib v0.0.0-20180314131852-90d4905c1961 // indirect
github.com/google/pprof v0.0.0-20190502144155-8358a9778bd1 // indirect
github.com/hashicorp/go-multierror v1.0.0
github.com/pkg/errors v0.8.1
golang.org/x/arch v0.0.0-20190312162104-788fe5ffcd8c // indirect
golang.org/x/sync v0.0.0-20190423024810-112230192c58
)
@JensRantil
JensRantil / go.mod
Last active May 3, 2019 05:29
Demonstrating potential memory leak.
module github.com/tink-ab/tink-backend/src/nats-streaming-pinger
require (
github.com/armon/go-metrics v0.0.0-20190423201044-2801d9688273 // indirect
github.com/go-sql-driver/mysql v1.4.1 // indirect
github.com/gogo/protobuf v1.2.1 // indirect
github.com/hashicorp/go-msgpack v0.5.4 // indirect
github.com/hashicorp/raft v1.0.1 // indirect
github.com/lib/pq v1.1.0 // indirect
github.com/nats-io/gnatsd v1.4.1 // indirect
@JensRantil
JensRantil / go.mod
Last active April 25, 2019 09:35
A tiny application that connects to NATS and measure latencies to NATS.
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
@JensRantil
JensRantil / inform_github_users.py
Last active October 17, 2018 19:12
Script that inform Github users of removal of a Github team. Modify for your organization and copy-paste the generated text into your favourite mail client!
# -*- 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)
@JensRantil
JensRantil / exeuction.sh
Created February 23, 2018 12:06
Test of running multiple HTTP listeners.
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
@JensRantil
JensRantil / make_iap_request.py
Last active June 4, 2022 01:46
Make IAP requests from credentials JSON file.
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@JensRantil
JensRantil / salt-dry-run-single.sh
Last active August 25, 2017 13:10
Masterless CI of Salt.
#!/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.
@JensRantil
JensRantil / empty.txt
Created June 4, 2017 15:53
Recreate an issue with markdown in a shortcode. See https://discuss.gohugo.io/t/best-practise-to-reuse-content/6855/2.
Empty.
@JensRantil
JensRantil / nsqd-without-heartbeat.txt
Created March 5, 2017 19:38
Stacktrace from when nsqd stops sending heartbeats. See https://github.com/nsqio/nsq/issues/859.
$ ./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
@JensRantil
JensRantil / keybase.md
Created January 22, 2017 12:32
Keybase verification.

Keybase proof

I hereby claim:

  • I am JensRantil on github.
  • I am jensrantil (https://keybase.io/jensrantil) on keybase.
  • I have a public key whose fingerprint is 4371 E7ED 3A3D DBB4 12B5 C68F BA63 2DB6 91DA 03B8

To claim this, I am signing this object: