Skip to content

Instantly share code, notes, and snippets.

View dolgarev's full-sized avatar

Oleg Dolgarev dolgarev

View GitHub Profile

How To Run Yggdrasil In Docker

Want to run Yggdrasil in a Docker container? This is how you can do it.

The keys to getting it working are the following:

  • Give the container access to the TUN interface of the host (or the VM guest in the case of Docker Machine or Docker for Mac)
  • Enable IPv6
  • Assign a dedicated MAC address
@dolgarev
dolgarev / tokens.md
Created November 3, 2024 18:25 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@dolgarev
dolgarev / restic_cron.sh
Created August 20, 2023 08:08 — forked from perfecto25/restic_cron.sh
Restic cron script
#!/bin/bash
# Runs Restic backup on a schedule via cron, emails with status
# 1. add a cred file with your repo logins to /etc/restic/cred
# 2.
FROM="restic@$(hostname)"
EMAIL="user@company.com"
LOG="/var/log/restic.log"
RDIR="/etc/restic"
@dolgarev
dolgarev / socat-tcp-to-unix-socket.sh
Created October 25, 2022 12:55 — forked from ljjjustin/socat-tcp-to-unix-socket.sh
socat-unix-socket-to-tcp.sh
#!/bin/bash
if [ $# -ne 3 ]; then
echo "usage: $0 <unix socket file> <host> <listen port>"
exit
fi
SOCK=$1
HOST=$2
PORT=$3
@dolgarev
dolgarev / 99-replica-set.sh
Created October 20, 2022 21:13 — forked from zhangyoufu/99-replica-set.sh
ugly hack to initialize replica set for MongoDB docker container, put under /docker-entrypoint-initdb.d/
#!/bin/bash
: "${FORKED:=}"
if [ -z "${FORKED}" ]; then
echo >&2 'mongod for initdb is going to shutdown'
mongod --pidfilepath /tmp/docker-entrypoint-temp-mongod.pid --shutdown
echo >&2 'replica set will be initialized later'
FORKED=1 "${BASH_SOURCE[0]}" &
unset FORKED
mongodHackedArgs=(:) # bypass mongod --shutdown in docker-entrypoint.sh
@dolgarev
dolgarev / gist:5887f56c212cd1aed459b50377feb25a
Created November 27, 2020 16:55 — forked from chrishowes/gist:70d35ea122ed921c7fc8
List of environment variables for MeteorJS
process.env.APP_ID
process.env.APP_MONGO
process.env.AUTOUPDATE_VERSION
process.env.BIND_IP
process.env.CONSTRAINT_SOLVER_BENCHMARK
process.env.DDP_DEFAULT_CONNECTION_URL
process.env.DEPLOY_DOMAIN
process.env.DEPLOY_HOSTNAME
process.env.DISABLE_WEBSOCKETS
process.env.DISCOVERY_PORT
@dolgarev
dolgarev / install_sis_graphics_on_linux.sh
Created September 24, 2019 07:34 — forked from fevangelou/install_sis_graphics_on_linux.sh
Bash script to install SiS Mirage 3+ graphics drivers on Linux
#!/bin/bash
# Bash script to install SiS Mirage 3+ graphics drivers on Linux
# Supports 671/672MX graphics cards
#
# Created in March 2019
#
# Tested on:
# - Lubuntu 18.04 (32-bit) with X.Org v1.19
# - Xubuntu 18.04 (64-bit) with X.Org v1.20
@dolgarev
dolgarev / nginx.conf
Created June 25, 2019 18:19 — forked from dnprock/nginx.conf
meteor nginx load balance with sticky session, used by vida.io
# Sticky session module for nginx
# https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/
# nginx configure command: ./configure --with-http_ssl_module --add-module=../nginx-sticky-module-ng/ --sbin-path=/usr/local/sbin --with-http_gzip_static_module
upstream vida_node_server {
sticky path=/;
server 127.0.0.1:3000 max_fails=3 fail_timeout=30s;
server [server2]:3000 max_fails=3 fail_timeout=30s;
}
@dolgarev
dolgarev / README.md
Created January 20, 2019 08:48
SCRIPT-8
@dolgarev
dolgarev / remote_url.md
Created December 5, 2018 09:10 — forked from hofnerb/remote_url.md
git remote set-url

Review and Change Remote URL

git remote -v
# View existing remotes

git remote set-url origin https://github.com/user/repo2.git
# Change the 'origin' remote's URL

git remote -v