Skip to content

Instantly share code, notes, and snippets.

View dzubchik's full-sized avatar

Dmytro Dzubenko dzubchik

View GitHub Profile
@furkando
furkando / .gitlab-ci.yml
Created June 21, 2022 18:51
GitLab Jira Pull Request Link Enforcer
# Testing a Merge Request title begins with a valid JIRA issue id
# Requirements on (*nix) host:
# - curl used for downloading information from JIRA
# - jq used for parsing JSON content from JIRA
stages:
- check
variables:
JIRA_HEADER: "Accept: application/json"
@jonatasleon
jonatasleon / vimeo-download.py
Last active July 21, 2023 10:38
Vimeo video downloader with Python 3
#!/bin/env python3
import argparse
import base64
import os
import re
import subprocess
import sys
from tempfile import mkstemp
<?php
namespace AppBundle\Doctrine;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\PDOPgSql\Driver as PDOPgSqlDriver;
use Doctrine\ORM\NativeQuery;
class PgSqlNativeQueryCursor
{
@Mykolaichenko
Mykolaichenko / prometheus-envoy.yml
Created January 3, 2019 10:51
Prometheus Envoy Consul relabel_configs
- job_name: "envoy-proxy-service"
metrics_path: "/stats/prometheus"
consul_sd_configs:
- server: "localhost:8500"
scheme: "http"
services:
- envoy-client
- envoy-aws-server
- envoy-sj-server
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@jhazelwo-charter
jhazelwo-charter / nginx.conf
Created October 3, 2017 14:54
NGINX FreeIPA authentication
worker_processes 4;
pid /app/run/nginx.pid;
error_log /app/log/error.log;
events {
worker_connections 768;
}
http {
go-audit repo:
https://github.com/slackhq/go-audit
go-audit example configurations:
https://github.com/slackhq/go-audit/tree/master/examples
Blog post: Ryan Huber - Distributed Security Alerting
https://medium.com/several-people-are-coding
Video: NSA TAO Chief on Disrupting Nation State Hackers
@alexeygrigorev
alexeygrigorev / vimeo-download.py
Created September 17, 2016 09:09
Downloading segmented video from vimeo
import requests
import base64
from tqdm import tqdm
master_json_url = 'https://178skyfiregce-a.akamaihd.net/exp=1474107106~acl=%2F142089577%2F%2A~hmac=0d9becc441fc5385462d53bf59cf019c0184690862f49b414e9a2f1c5bafbe0d/142089577/video/426274424,426274425,426274423,426274422/master.json?base64_init=1'
base_url = master_json_url[:master_json_url.rfind('/', 0, -26) + 1]
resp = requests.get(master_json_url)
content = resp.json()
@dduvnjak
dduvnjak / add_cloudflare_ips.sh
Last active April 20, 2025 05:41
Add CloudFlare IP addresses to an EC2 Security Group using awscli
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# set the security group ID
SG_ID="sg-00000000000000"
# iterate over the IP ranges in the downloaded file
# and allow access to ports 80 and 443
while read p
do
@jgillman
jgillman / restore.sh
Last active February 6, 2025 02:39
pg_restore a local db dump into Docker
# Assumes the database container is named 'db'
DOCKER_DB_NAME="$(docker-compose ps -q db)"
DB_HOSTNAME=db
DB_USER=postgres
LOCAL_DUMP_PATH="path/to/local.dump"
docker-compose up -d db
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}"
docker-compose stop db