Skip to content

Instantly share code, notes, and snippets.

View janisz's full-sized avatar
🏕️
I may be slow to respond.

Tomasz Janiszewski janisz

🏕️
I may be slow to respond.
View GitHub Profile
@janisz
janisz / data.json
Created February 27, 2020 13:08
ClearUrls
{
"providers": {
"amazon": {
"urlPattern": "(https:\\/\\/|http:\\/\\/)([a-zA-Z0-9-]*\\.)?(amazon)(\\.[a-zA-Z]{2,})(.*\\?.*)",
"completeProvider": false,
"rules": [
"pf_rd_[a-zA-Z]=[^\\/|\\?|&]*(\\/|&(amp;)?)?",
"qid=[^\\/|\\?|&]*(\\/|&(amp;)?)?",
"sr=[^\\/|\\?|&]*(\\/|&(amp;)?)?",
"srs=[^\\/|\\?|&]*(\\/|&(amp;)?)?",
@janisz
janisz / defer_test.go
Created January 14, 2020 11:01
Go 1.14 defer benchmark
package bigcache
import "testing"
var sink = 0
func BenchmarkNotDefered(b *testing.B) {
for n := 0; n < b.N; n++ {
notDefered()
}

Keybase proof

I hereby claim:

  • I am janisz on github.
  • I am janisz (https://keybase.io/janisz) on keybase.
  • I have a public key ASCpZ-hU8zLclXsoqT0Jx9LztTlq7KVMi2Wn4wOUhhqFBwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am janisz on github.
  • I am janisz (https://keybase.io/janisz) on keybase.
  • I have a public key whose fingerprint is 4F45 E375 6863 9607 7B74 3B09 6342 4686 2E6A B39C

To claim this, I am signing this object:

@janisz
janisz / .tmux.conf
Created July 6, 2017 19:39
.dotfiles
# 0 is too far from ` ;)
set -g base-index 1
# http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting/
bind-key -t vi-copy 'v' begin-selection
#bind-key -t vi-copy 'y' copy-selection
# https://coderwall.com/p/4b0d0a/how-to-copy-and-paste-with-tmux-on-ubuntu
bind -t vi-copy y copy-pipe "xclip -sel clip -i"
bind-key -t vi-copy 'r' rectangle-toggle
@janisz
janisz / 1.19
Last active February 23, 2017 04:39
Mesos replicated log benchmark
-------------------------------------------------------
Input: 10B x 1000
Total number of appends: 1000
Total time used: 4.590994792secs
-------------------------------------------------------
-------------------------------------------------------
Input: 100B x 1000
Total number of appends: 1000
Total time used: 6.654305136secs
-------------------------------------------------------
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: cairo 1.14.6 (http://cairographics.org)
%%CreationDate: Thu Nov 3 14:26:49 2016
%%Pages: 1
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%BoundingBox: 189 495 415 722
%%EndComments
%%BeginProlog
save
@janisz
janisz / generate_schedule.py
Created November 14, 2016 21:18
Generate huge Maintenance Schedule test data for Mesos
import json
import random
import string
def ip():
return ".".join(map(str, (random.randint(0, 255)
for _ in range(4))))
def name():
return ''.join(random.choice(string.ascii_uppercase + string.digits)
@janisz
janisz / bigcache bench test .tsv
Last active July 7, 2016 22:21
go version go1.6.2 linux/amd64 vs. go version go1.7beta2 linux/amd64
benchmark go1.6.2 ns/op go1.7beta2 ns/op delta
BenchmarkWriteToCacheWith1Shard-4 3106 2714 -12.62%
BenchmarkWriteToLimitedCacheWithSmallInitSizeAnd1Shard-4 3102 1885 -39.23%
BenchmarkWriteToUnlimitedCacheWithSmallInitSizeAnd1Shard-4 10277 5652 -45.00%
BenchmarkWriteToCacheWith512Shards-4 1190 976 -17.98%
BenchmarkWriteToCacheWith1024Shards-4 1320 1006 -23.79%
BenchmarkWriteToCacheWith8192Shards-4 1290 1053 -18.37%
BenchmarkWriteToCacheWith1024ShardsAndSmallShardInitSize-4 1359 1090 -19.79%
BenchmarkReadFromCacheWith1024Shards-4 693 606 -12.55%
BenchmarkReadFromCacheWith8192Shards-4 714 606 -15.13%
#!/usr/bin/python
"""
Script to migrate marathon tasks from the host going for maintenance
optional arguments:
-h, --help show this help message and exit
--url URL Marathon URL (http://marathon.example.com)
--hosts HOSTS Hosts going to go for maintenance