Skip to content

Instantly share code, notes, and snippets.

View RunsFor's full-sized avatar
🎯

Ilya Konyukhov RunsFor

🎯
View GitHub Profile
@RunsFor
RunsFor / Dockerfile
Created January 21, 2021 17:03
Example on how to build static kafka module for use with static tarantool build
FROM registry.gitlab.com/runfor/envs/centos:7-build as static-kafka
RUN set -x \
&& git clone --recurse-submodules https://github.com/tarantool/kafka /opt/kafka \
&& wget -P /etc/yum.repos.d/ https://copr.fedorainfracloud.org/coprs/bgstack15/stackrpms/repo/epel-7/bgstack15-stackrpms-epel-7.repo \
&& yum install -y tarantool tarantool-devel openssl110 zip
WORKDIR /opt/kafka
RUN tarantoolctl rocks STATIC_BUILD=ON make \
@RunsFor
RunsFor / buildx-logs.txt
Created December 1, 2020 09:54
buildx daemon gets stuck when running build inside docker-build-and-push github actions action on a self-hosted runner. Sending SIGQUIT brings the following output of job logs
SIGQUIT: quit
2020-12-01T09:47:49.7959653Z PC=0x5584306ce761 m=0 sigcode=0
2020-12-01T09:47:49.7960063Z
2020-12-01T09:47:49.7960640Z goroutine 0 [idle]:
2020-12-01T09:47:49.8033241Z runtime.futex(0x5584337f5748, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7ffe496451f0
==> _diag/pages/c4cb1678-ecb3-4e21-bb85-058e90c59a98_0f1d67d0-60c4-549e-f697-f7ec7a95557a_1.log <==
l7.noarch 152/181
2020-12-01T09:06:36.8798438Z #6 161.8 Installing : urw-base35-z003-fonts-20170801-10.el7.noarch 153/181
2020-12-01T09:06:38.3815517Z #6 163.3 Installing : urw-base35-nimbus-sans-fonts-20170801-10.el7.noarch 154/181
2020-12-01T09:06:39.8826066Z #6 164.7 Installing : urw-base35-p052-fonts-20170801-10.el7.noarch 155/181
@RunsFor
RunsFor / list_gitlab_projects.py
Created May 6, 2020 10:18
Simple python script which recursively iterates over a nested tree of subgroups and count a number of projects with shared runners option enabled
#!/usr/bin/env python3
import json
import gitlab
gl = gitlab.Gitlab('http://gitlab.com', private_token="<put your private token here>")
GROUP_ID = '1234567890'
total_projects_count = 0
@RunsFor
RunsFor / ansible_fileglob.txt
Last active April 14, 2020 16:29
fileglob lookup plugin does not search playbook dir
19:16:12 level2 [master] tree
├── file.txt
├── files
│   └── file.txt
├── hosts.yml
├── main.yml
└── roles
└── lookup
└── tasks
└── main.yml
@RunsFor
RunsFor / smtp.lua
Last active November 20, 2019 13:28
This snippet tests how smtp client (curl internally) handles error messages from smtp server
#!/usr/bin/env tarantool
local socket = require('socket')
local log = require('log')
local vars = {}
local function smtp_server(s)
s:write('220 localhost ESMTP Tarantool\r\n')
local l
@RunsFor
RunsFor / Kafka-segfault.txt
Created June 4, 2019 13:27
tarantool segfault when creating kafka consumer
Tarantool 2.1.1-434-g881c7b59b
type 'help' for interactive help
tarantool> kafka = require'kafka'
---
...
tarantool> consumer, err = kafka.Consumer.create({
> brokers = 'localhost:9292', -- brokers for bootstrap
> options = {
> ["enable.auto.offset.store"] = "true",
@RunsFor
RunsFor / tarantool_socket_receive.txt
Created April 9, 2019 10:03
This gist shows inconsistent behaviour of tarantool's socket:receive function which internally uses different buffers for different types of calls
Tarantool 2.1.1-434-g881c7b59b
type 'help' for interactive help
tarantool> socket = require('socket')
---
...
tarantool> fiber = require'fiber'
---
...
@RunsFor
RunsFor / main.lua
Last active March 27, 2019 15:07
Count nil values in the index
box.cfg{}
statuses = { 'sent', 'delivered' }
uuid = require('uuid')
clock = require('clock')
box.schema.create_space('fragments')
box.space.fragments:create_index('pk')
box.space.fragments:create_index('status', { unique = false, parts = {{3, 'string', is_nullable = true}}})
for i =1,500000,1 do box.space.fragments:insert({i,uuid.str(), statuses[math.random(0,2)]}) end
@RunsFor
RunsFor / nginx.conf
Last active August 1, 2022 19:48
HTTP terminating tools comparison in tarantool (MacBook Pro 13 2017 3.5 Ghz Intel Core i7, 16GB)
worker_processes 8;
error_log logs/error.log info;
events {
worker_connections 4096;
}
http {
include mime.types;
default_type application/octet-stream;
access_log off;
sendfile on;
@RunsFor
RunsFor / git-clone-graphql.txt
Created February 22, 2019 13:25
git show failed on a healthy commit
$ git clone git@github.com:tarantool/graphql.git
Cloning into 'graphql'...
remote: Enumerating objects: 125, done.
remote: Counting objects: 100% (125/125), done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 2642 (delta 97), reused 99 (delta 89), pack-reused 2517
Receiving objects: 100% (2642/2642), 1.30 MiB | 407.00 KiB/s, done.
Resolving deltas: 100% (1996/1996), done.
$ cd graphql
$ git show e4f77a257e0e77a65992b21c9547529e6b80f78d