Skip to content

Instantly share code, notes, and snippets.

View urlichLivonian's full-sized avatar

Vadzim Ivanitski urlichLivonian

  • EPAM
  • Tbilisi
View GitHub Profile
@urlichLivonian
urlichLivonian / docker-desktop-apple-silicon-alternatives.md
Last active December 25, 2023 18:55
Docker Desktop Alternatives for MacOS with Intel chip

Docker Desktop Alternatives for MacOS with Intel chip

Docker CLI + QEMU + Minikube

Install qemu:

brew install qemu
@urlichLivonian
urlichLivonian / opessl-cheat-sheet.md
Last active March 7, 2022 08:10
OpeSSL Cheat Sheet

OpeSSL Cheat Sheet

Get a certificate with a CRL

Getting the certificate from URI (the website itself)

openssl s_client -connect example.com:443 -servername example.com 2>&1 < /dev/null | sed -n '/-----BEGIN/,/-----END/p' > example.pem
@urlichLivonian
urlichLivonian / git-tips-and-tricks.md
Last active January 7, 2022 18:54
Git Tips and Tricks

Git Tips and Tricks

Autocorrection in Git

Suppose you want to check the status with git status but you type git stats by accident. Git tells you that 'stats' is not a valid command:

git stats
git: 'stats' is not a git command. See ‘git --help’.
@urlichLivonian
urlichLivonian / pull-image-from-acr-on-gitlab.md
Last active May 18, 2022 12:45
Pull base images from Azure Container Registry on GitLab CI

Pulling images from Azure Container Registry on GitLab CI

How to use an image from Azure Container Registry as the base for GitLab Runner’s Docker executor.

Using Service Principal

Let's imagine we have image in ACR as follows jigurda.azurecr.io/namaespace/awesome-toolbox:1.0.1. This image is private and requires you to sign in to a private container registry. Let’s also assume that these are the sign-in credentials for your service principal:

Key Example Value
@urlichLivonian
urlichLivonian / postgresql.sh
Last active November 8, 2021 13:01 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@urlichLivonian
urlichLivonian / dind-k8s.yaml
Last active November 1, 2021 21:00
Docker-in-docker-in-Kubernetes for BYO runner (Bitbucket)
apiVersion: batch/v1
kind: Job
metadata:
name: runner
namespace: bitbucket-runner
spec:
template:
metadata:
labels:
accountUuid: bla-bla-bla
@urlichLivonian
urlichLivonian / bash-best-practices.md
Last active July 13, 2021 18:24
Bash Best Practice

Bash Best Practices and Tips

Coding convention is a just conventions. I am writing this gist as much for me, but I hope it may also be useful to others. Inspired by progrium/bashstyle and Bash Guide

Main Rules

  • All code goes in a function. Use the main function for runing script
  • Always double quote variables.
@urlichLivonian
urlichLivonian / nginx-tuning.md
Created May 25, 2021 18:37 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.