Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@janisz
janisz / README
Last active December 5, 2015 13:59
Vagrantfile for Mesos and Marathon
1. Install [Vegrant](https://www.vagrantup.com/downloads.html)
2. Download Vagrantfile `wget https://gist.githubusercontent.com/janisz/ce36ad51ee5fb6911786/raw/0503492c7226d95e8b5f801f4621982105578de8/Vagrantfile`
3. `vagrant up`
## Starter links
* http://www.wired.com/2013/03/google-borg-twitter-mesos/
* https://manning-content.s3.amazonaws.com/download/2/c79863e-1021-4274-abcc-63b748548f24/Mesos_MEAP_ch1.pdf
* http://mesos.apache.org/documentation/latest/
@janisz
janisz / parse.js
Last active February 1, 2016 22:03
Script parsing hipchat export to CSV
var json2csv = require('json2csv');
var sanitize = require("sanitize-filename");
var fs = require('fs');
var users = require('./hipchat_export/users/list.json').users;
var room_list = require('./hipchat_export/rooms/list.json').rooms;
var escapeShell = function(cmd) {
return cmd.replace(/\//g, "-");
};
@janisz
janisz / bench_test.go
Created March 24, 2016 13:40
Go Free cache vs BigCache
package bigcache
import (
"encoding/binary"
"testing"
"time"
"github.com/allegro/bigcache"
"github.com/coocood/freecache"
)
@janisz
janisz / Dcokerfile
Created April 29, 2016 21:21
Docker H₂O.ai cluster
########################################################################
# Dockerfile for Oracle JDK 8 on Ubuntu 16.04
# http://blog.h2o.ai/wp-content/uploads/2015/01/Dockerfile.txt
########################################################################
# pull base image
FROM \
ubuntu:16.04
# maintainer details
#!/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
@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%
@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)
%!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 / 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
-------------------------------------------------------