Skip to content

Instantly share code, notes, and snippets.

View naumvd95's full-sized avatar
🐙
breaking things, fixing things

Vladislav Naumov naumvd95

🐙
breaking things, fixing things
View GitHub Profile
@naumvd95
naumvd95 / pushkin_elastic_stub_gen.sh
Created April 7, 2017 12:30 — forked from rkhozinov/pushkin_elastic_stub_gen.sh
Pushkin elastic fake notification generator
host=172.16.10.254
port=9200
title=$(python -c "import random_words; print ' '.join(random_words.RandomWords().random_words(count=2))")
content=$(python -c "import random_words; print ' '.join(random_words.RandomWords().random_words(count=10))")
app=$(($RANDOM % 3 + 1))
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
data="
\"title\": \"${title}\",
\"content\": \"${content}\",
@naumvd95
naumvd95 / logging.py
Created February 11, 2018 14:55 — forked from kingspp/logging.py
Python Comprehensive Logging using YAML Configuration
import os
import yaml
import logging.config
import logging
import coloredlogs
def setup_logging(default_path='logging.yaml', default_level=logging.INFO, env_key='LOG_CFG'):
"""
| **@author:** Prathyush SP
| Logging Setup
@naumvd95
naumvd95 / gist:021227e3cb4761945be999faf0a8e9c7
Created March 7, 2018 10:36 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@naumvd95
naumvd95 / AKS_public_ip
Last active March 22, 2018 11:37 — forked from tsaarni/README.md
How to connect to Azure AKS Kubernetes node VM by SSH
# How to connect to Azure AKS Kubernetes worker node by SSH
Nodes are not assigned public IP. If you have accessible VM in the same VNET as worker nodes,
then you can use that VM as jump host and connect the worker via private IP.
Alternatively public IP can be assigned to a worker node. This readme shows how to do that.
## Steps how to attach public IP to a worker node
find out the resource group that AKS created for the node VMs
@naumvd95
naumvd95 / iterm2-solarized.md
Last active February 3, 2022 09:36 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@naumvd95
naumvd95 / setup-gh-cli-auth-2fa.md
Created May 13, 2018 16:12 — forked from ateucher/setup-gh-cli-auth-2fa.md
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email '[email protected]'
    
@naumvd95
naumvd95 / cleanup_docker.sh
Created June 26, 2018 19:14 — forked from ralphtheninja/cleanup_docker.sh
Cleanup and reset docker on Jenkins workers / slaves
#!/bin/bash
# This script should be located on each Jenkins slave, and the jenkins user should have permission to run it with sudo
# Attempts to cleanly stop and remove all containers, volumes and images.
docker ps -q | xargs --no-run-if-empty docker stop
docker ps -q -a | xargs --no-run-if-empty docker rm --force --volumes
docker volume ls -q | xargs --no-run-if-empty docker volume rm
docker images -a -q | xargs --no-run-if-empty docker rmi -f
# Stops the docker service, unmounts all docker-related mounts, removes the entire docker directory, and starts docker again.
@naumvd95
naumvd95 / README-Template.md
Created September 6, 2018 09:58 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@naumvd95
naumvd95 / go_cpu_memory_profiling_benchmarks.sh
Created February 1, 2021 10:38 — forked from arsham/go_cpu_memory_profiling_benchmarks.sh
Go cpu and memory profiling benchmarks. #golang #benchmark
go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt
go tool pprof -http :8080 cpu.out
go tool pprof -http :8081 mem.out
go tool trace trace.out
go tool pprof $FILENAME.test cpu.out
# (pprof) list <func name>
# go get -u golang.org/x/perf/cmd/benchstat
benchstat bench.txt