Skip to content

Instantly share code, notes, and snippets.

View gvych's full-sized avatar

g.vyacheslav gvych

  • Russia, Saint-Petersburg
View GitHub Profile
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active March 24, 2025 20:20
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@josegonzalez
josegonzalez / redis_migrate.py
Last active December 31, 2024 00:23 — forked from iserko/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn
@mosquito
mosquito / README.md
Last active April 13, 2025 18:03
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/[email protected]. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@iMilnb
iMilnb / README.md
Last active January 18, 2024 08:08
AWS Terraform configuration: Stream CloudWatch Logs to ElasticSearch

Rationale

This snippet is a sample showing how to implement CloudWatch Logs streaming to ElasticSearch using terraform. I wrote this gist because I didn't found a clear, end-to-end example on how to achieve this task. In particular, I understood the resource "aws_lambda_permission" "cloudwatch_allow" part by reading a couple of bug reports plus this stackoverflow post.

The js file is actually the Lambda function automatically created by AWS when creating this pipeline through the web console. I only added a endpoint variable handling so it is configurable from terraform.

@filimonov
filimonov / random_ascii_data.sql
Created January 2, 2019 09:37
fill table with random ascii data in ClickHouse
CREATE TABLE ascii_random_data ENGINE=TinyLog
AS
WITH
arrayStringConcat(
arrayMap(
x -> reinterpretAsString( toUInt8( rand(x) % 96 + 0x20 ) ),
range( 1024 )
)
) as str1024,
substring(str1024, 1, 512 + bitAnd(rand(),0x1FF) ) as str
@arehmandev
arehmandev / nginx.conf
Created October 14, 2019 19:24
Nginx transparent proxy
events {
worker_connections 1024;
}
http {
# google's DNS server
resolver 8.8.8.8;
resolver_timeout 5s;
server {
# proxy server port
#!/bin/bash
# need API_KEY as parameter
if [ ! $# -eq 3 ]
then
echo "Usage: artifact_download_test.sh <API_KEY> <outer_loop> <inner_loop>"
exit 1
fi
echo "Download testing started"
@alekseykulikov
alekseykulikov / github-actions-ranking.md
Last active August 3, 2021 20:53
Github Actions Ranking (June 18, 2020)

Github Actions is a CI/CD platform that gained a lot of popularity recently. I participated in building ⭐️ Lighthouse CI Action and was curious how well it performs.

But Github Marketplace UI shows no ranking information. Essentially, It's a search with random results; at least, I don't understand the order. I couldn't find ⭐️ Lighthouse CI Action in Continuous integration category after browsing 50 available pages (Each page shows 20 results, so it's possible to see only 1000 results, but CI category has 1469 😐).

I decided to build a custom script that crawls all categories and use Github Search (example query) to estimate usa