Skip to content

Instantly share code, notes, and snippets.

View Zatvobor's full-sized avatar

Alexey Zatvobor

  • Software engineer
  • CET
View GitHub Profile
@Zatvobor
Zatvobor / gist:5003767
Last active September 18, 2018 11:50
Time taken for 10K requests: 3.800 seconds Requests per second: 2631.56 [#/sec] (mean) Time per request: 0.380 [ms] (mean, across all concurrent requests) Failed requests: 0
$ ab -c 100 -n 10000 http://api.tunehog.com/kiosk-graph/unsigned/accounts:user:1356811425576
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking api.tunehog.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
@Zatvobor
Zatvobor / dashd.dockerfile
Last active May 20, 2017 12:59
DASHD Dockerfile
FROM ubuntu:14.04
MAINTAINER Zatvobor <http://zatvobor.github.io>
RUN apt-get update \
&& apt-get install -y curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#RUN echo 'root:screencast' | chpasswd
@Zatvobor
Zatvobor / siad.dockerfile
Last active December 26, 2016 15:37
SIAD Dockerfile
FROM phusion/baseimage
MAINTAINER Zatvobor <http://zatvobor.github.io>
RUN apt-get update \
&& apt-get install -y curl unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV SIA_VERSION 1.0.4
ENV SIA_RELEASE Sia-v$SIA_VERSION-lts-linux-amd64
WtiKioskCli::Labeled::MediaNetApi.get_track_info 74486245
{:success=>true, :data=>{"Success"=>true, "Track"=>{"MnetId"=>"74486245", "Title"=>"Everybody", "Artist"=>{"MnetId"=>"21540", "Name"=>"Madonna", "Images"=>{"Artist180x80"=>"http://images.mndigital.com/artists/000/021/540/b.jpeg", "Artist190x230"=>"http://images.mndigital.com/artists/000/021/540/c.jpeg", "Artist375x250"=>"http://images.mndigital.com/artists/000/021/540/a.jpeg", "Artist200x"=>"http://images.mndigital.com/artists/000/021/540/f.jpeg"}}, "Genre"=>"Rock", "ExplicitLyrics"=>false, "Duration"=>"2:49", "ReleaseDate"=>"11-29-2008", "TrackNumber"=>1, "DiscNumber"=>1, "PriceTag"=>{"Currency"=>"GBP", "Amount"=>0.79, "IsSetPrice"=>false, "WholesalePrice"=>0.54, "PublishingCost"=>0.09}, "Mp3Rights"=>{"CanSampleStream"=>true, "CanPurchaseDownload"=>true, "AlbumPurchaseOnly"=>false, "CanStream"=>false}, "FeaturedArtists"=>[{"MnetId"=>"78839", "Name"=>"Ariel Pink's Haunted Graffiti", "Images"=>{"Artist180x80"=>"http://images.mndigital.com/artists/000/0
@Zatvobor
Zatvobor / gist:5013360
Last active December 14, 2015 02:28 — forked from rnewson/gist:2387973
This is edited list of CouchDB Future Features which might as well be a part of https://github.com/datahogs/couch_gears. Check http://en.wikipedia.org/wiki/MoSCoW_Method for more about special tags such a #MUST, #SHOULD, #COULD, #WONT
User Facing Features
====================
#WONT 1. Conflicts are the rule, not the exception
All previous versions of CouchDB hide conflicts by default (selecting
an arbitrary but consistent winning revision). Expert users can find
and resolve conflicts.
Instead, expose the true picture by default, this includes;
@Zatvobor
Zatvobor / gist:5003806
Created February 21, 2013 10:36
Time taken for tests: 14.231 seconds Complete requests: 10000 Failed requests: 81 (Connect: 0, Receive: 0, Length: 81, Exceptions: 0) Write errors: 0 Time per request: 1.423 [ms] (mean, across all concurrent requests)
$ ab -c 100 -n 10000 http://accounts.tunehog.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking accounts.tunehog.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
@Zatvobor
Zatvobor / simple_couch_db_doc_behavior.erl
Last active December 12, 2015 06:58
Erlang R15B03, CouchDB branch#1.2.x 1] Why `in_case(single_process)` produces so many `inactive` memory on Mac OS X in case when `<<"medianet:album:10000053">>` document size is 67.19Kb?. besides, `in_case(spawned_processes)` doesn't; 2] moreover, `in_case(spawned_update_processes)` still continue produce an `inactive` memory;
-module(simple_couch_db_doc_behavior).
-compile(export_all).
db_and_doc() ->
{<<"seed_labeled_prod">>, <<"medianet:album:10000023">>}.
read_write() ->
{DbName, DocId} = db_and_doc(),
{ok, Db} = couch_db:open_int(DbName, []),

0.7.0

Aleksey-Zatvors-MacBook-Pro:/opt/datahogs/couch_normalizer[master]$ make test

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/alekseyzatvor/.rvm/bin:deps/elixir/bin mix test
………………………………

[pid: <0.92.0>, module: :“Users_alekseyzatvor_opt_datahogs_couch_normalizer_examples_1-example-scenarioexs”, new_index: 0, new_uniq: <<35,143,117,154,121,211,79,108,11,187,58,28,226,5,32,166>>, index: 0, uniq: 18643884, name: :“BOOTSTRAP/2-fun-1”, arity: 4, env: [], type: :local]
[pid: <0.92.0>, module: CouchNormalizer.ElixirUpdateIssueTest, new_index: 0, new_uniq: <<151,32,187,217,189,138,168,87,193,166,89,51,157,56,220,21>>, index: 0, uniq: 79234526, name: :“setup/1-fun-0”, arity: 4, env: [], type: :local]

@Zatvobor
Zatvobor / gist:2c187b5363ca8b3141ce
Last active November 17, 2015 14:11
Ubuntu 14.04.3 LTS, AMD A10-7870K: `clinfo` throws `Segmentation fault (core dumped)` after second attempt.
root@eva:~# dpkg -i fglrx-core_15.201-0ubuntu1_amd64_UB_14.01.deb
Selecting previously unselected package fglrx-core.
(Reading database ... 87607 files and directories currently installed.)
Preparing to unpack fglrx-core_15.201-0ubuntu1_amd64_UB_14.01.deb ...
Unpacking fglrx-core (2:15.201-0ubuntu1) ...
Setting up fglrx-core (2:15.201-0ubuntu1) ...
update-alternatives: using /usr/lib/fglrx-core/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GFXCORE.conf (x86_64-linux-gnu_gfxcore_conf) in auto mode
Loading new fglrx-core-15.201 DKMS files...
First Installation: checking all kernels...
@Zatvobor
Zatvobor / index.html
Created March 3, 2015 10:04
ShadowDom: Shadow hole
<!doctype html>
<html class="no-js" lang="en">
<head>
<style>
h1, h2, h3 {5
color: red;
}
</style>
<template>
<h2>h2</h2>