Skip to content

Instantly share code, notes, and snippets.

stages:
- build
- deploy
pull-demo:
tags:
- demo
stage: build
script:
- cd /home/plc-demo/blockchain-mw
@bigbes
bigbes / How-to-automate-build-bottles-your-homebrew-tap.md
Created September 7, 2018 12:52 — forked from maelvls/How-to-automate-build-bottles-your-homebrew-tap.md
Tutorial on how to automate the build of bottles on your Homebrew tap (linux/mac)

How to automate the build of bottles on your Homebrew tap

This tutorial is a follow-up to the discussion we had on davidchall/homebrew-hep#114. It relies on a fork of the test-bot provided by davidchall; you can get it with brew tap maelvalais/test-bot. First:

  1. the Github project must be of the form https://github.com/<user>/homebrew-<tap> with the following tree (I give the example of one of my formulas, touist):
local fiber = require('fiber')
local ch = fiber.channel(0)
local function len(tbl)
local cnt = 0; for _, _ in pairs(tbl) do cnt = cnt + 1 end; return cnt
end
fiber.create(function() while true do print('fiber count:', len(fiber.info())); fiber.sleep(1) end end)
out/
├── bin
│   └── tarantool
├── cmake
│   ├── yamlConfig.cmake
│   ├── yamlConfigVersion.cmake
│   ├── yamlTargets-debug.cmake
│   └── yamlTargets.cmake
├── include
│   ├── config.h
diff --git a/shard.lua b/shard.lua
index f9ee05e..0c83af7 100644
--- a/shard.lua
+++ b/shard.lua
@@ -268,14 +268,10 @@ local function shard_status()
offline = {},
maintenance = maintenance
}
- for j = 1, #shards do
- local srd = shards[j]
@bigbes
bigbes / -
Created November 17, 2017 01:29
local lcstd = require('luacheck.standards')
local empty = {}
local debug_defs = lcstd.def_fields(
"traceback", "setlocal", "getupvalue", "setupvalue", "upvalueid",
"getlocal", "getregistry", "getinfo", "sethook", "setmetatable",
"upvaluejoin", "gethook", "debug", "getmetatable", "setfenv",
"getfenv"
)
@bigbes
bigbes / sharding.txt
Created November 13, 2017 13:40
sharding algo
------------------------------------Шардинг-------------------------------------
Есть некоторое заранее зафиксированное множество виртуальных бакетов (vbacket),
каждый из которых - число от 0 до количества vbackets. Есть множество
репликасетов - они же реальные бакеты (backet). Каждый backet хранит некоторое
уникальное подмножество vbackets. То есть один vbacket не разделяется между
backets.
Пример: 11 vbackets и 4 backets.
+-----------------------------------------------------------------+
local log = require('log')
local xlog = require('xlog')
local yaml = require('yaml')
local fiber = require('fiber')
local function find_space_id(snap, name)
for lsn, record in xlog.pairs(snap) do
if record.BODY.space_id > 512 then
break
end
@bigbes
bigbes / -
Created October 6, 2017 17:23
diff --git a/Formula/tarantool-nginx-module.rb b/Formula/tarantool-nginx-module.rb
index e6a9928..09eb1ef 100644
--- a/Formula/tarantool-nginx-module.rb
+++ b/Formula/tarantool-nginx-module.rb
@@ -1,16 +1,17 @@
class TarantoolNginxModule < Formula
desc "Tarantool upstream for nginx"
homepage "https://github.com/tarantool/nginx_upstream_module"
- url "https://github.com/tarantool/nginx_upstream_module.git"
- version "0.4b"
website-full-deploy:
tags:
- docker
image: "registry.gitlab.com/tarantool/doc"
script:
- cmake . && make
- echo ${RSYNC_PASSWORD} > rsync.password
- chmod 600 rsync.password
- rsync -Pav --password-file=rsync.password output/
${RSYNC_USER}@${RSYNC_HOST}::tarantool-org/