Skip to content

Instantly share code, notes, and snippets.

@andreyka26-git
andreyka26-git / gitlab-runner-dind-setup.txt
Last active February 8, 2023 12:43
GitLab runner in docker (using dind) with sample gitlab.ci set up
** run these commands inside your machine
docker run -v /srv/gitlab-runner/config:/etc/gitlab-runner --name runner -v /var/run/docker.sock:/var/run/docker.sock -d gitlab/gitlab-runner
docker exec -it runner bash
gitlab-runner register -n \
--url "https://gitlab.com/" \
--registration-token "qSf6YzdsXjMug69WxVTt" \
--executor "docker" \
@andreyka26-git
andreyka26-git / gist:89138ea2ba44231f5080e2b67f0e2dac
Created August 25, 2021 15:59
[Windows 10] Continuous ping with time on powershell
ping.exe -t google.com|Foreach{"{0} - {1}" -f (Get-Date),$_}
@andreyka26-git
andreyka26-git / gist:3af4c4b4f39dbf3df462a9df9003dfc7
Created July 20, 2022 07:52
nginx dynamic proxy_pass with routes (explaining in the source code)
# this config resolves different containers depending on route path, not on ips/domains
# on top of that it uses dynamic resolving, meaning that if some docker containers are not alive
# nginx will still work. It is achieved by using variables which makes nginx resolve host on runtime and not on start.
# frontend dev env
server {
# nginx container port
listen 3001;
server_name localhost;
@andreyka26-git
andreyka26-git / js
Created July 25, 2022 09:36
Google Docs Add today's date with heading
function onOpen() {
var ui = DocumentApp.getUi();
ui.createMenu('Services')
.addItem('Add Day', 'addNewDay')
.addToUi();
}
function formatTwoDigit(n) {
return n < 10 ? '0' + n : '' + n;
@andreyka26-git
andreyka26-git / project.csproj
Last active March 11, 2024 20:08
.csproj set target path of copied file
<!--
To know <sourcepath> you might just select proprties of the file in Visual Studio and select "Copy To Output Directory = Copy if Newer"
It will add record to csproj with <sourcepath> included.
<targetpath> is the path from the build directory <projectsrc>/bin/x64/Debug/*
-->
@andreyka26-git
andreyka26-git / partitions-flip-traffix.cs
Created July 25, 2024 16:06
The case when we choose bad hash function resulting in flip of the traffic
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
var dict = new Dictionary<string, int>
{
["euwe-0"] = 0,
["euno-0"] = 0,
["euwe-1"] = 0,
["euno-1"] = 0,