This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def csv_stream | |
sql = Request.where('created_at < ? AND client_id = ?', Time.now, 42).to_sql | |
Enumerator.new do |y| | |
conn = ActiveRecord::Base.connection.raw_connection | |
conn.copy_data("COPY (#{sql}) TO STDOUT WITH (FORMAT CSV, HEADER TRUE);") do | |
while (chunk = conn.get_copy_data) | |
y << chunk | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2.3' | |
services: | |
vector: | |
image: timberio/vector:latest-alpine | |
restart: unless-stopped | |
network_mode: host | |
container_name: vector-agregator | |
volumes: | |
- ./vector/vector.toml:/etc/vector/vector.toml:ro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
vector: | |
image: timberio/vector:latest-alpine | |
restart: unless-stopped | |
network_mode: host | |
volumes: | |
- ./vector/vector.toml:/etc/vector/vector.toml:ro | |
- /var/run/docker.sock:/var/run/docker.sock | |
# - /home/rails/project1:/app - если надо забирать логи с древнего проекта без контейнеров |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "2.3" | |
services: | |
x-log: &log | |
options: | |
max-size: '50m' | |
max-file: '3' | |
driver: json-file | |
services: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "2.3" | |
services: | |
x-log: &log | |
options: | |
max-size: '50m' | |
max-file: '3' | |
driver: json-file | |
services: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-06/schema#", | |
"$comment": "Схема данных банка, в котором открыт счет", | |
"type": "object", | |
"properties": { | |
"name": { | |
"doc_description": "12123123", | |
"type": "string", | |
"minLength": 1, | |
"maxLength": 200, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
x-log: &log | |
options: | |
max-size: '50m' | |
max-file: '3' | |
labels: com.docker.compose.service | |
driver: json-file | |
x-base: &base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
x-base: &base | |
restart: unless-stopped | |
logging: | |
options: | |
max-size: '50m' | |
max-file: '3' | |
driver: json-file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lusnoc::Mutex.new('/some/key').synchronize do |mx| | |
# do some work | |
mx.renew if mx.need_renew? # manualy renew session if needed | |
# do other work | |
mx.renew if mx.need_renew? # manualy renew session if needed | |
# ... | |
rescue Lusnoc::ExpiredError => e | |
# Session was invalidated and mutex was lost! | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'timeout' | |
require 'logger' | |
require 'net/http' | |
require 'webrick' | |
require 'terminal-table' | |
require 'thin' | |
require 'colorize' | |
class Base |
NewerOlder