Skip to content

Instantly share code, notes, and snippets.

View squizduos's full-sized avatar
💭
Senior Bitard Developer

Semyon Bochkaryov squizduos

💭
Senior Bitard Developer
View GitHub Profile
@squizduos
squizduos / docker-compose.yml
Last active September 23, 2019 20:33
Telegram MTProto proxy with Docker
version: '3'
services:
mtproto:
image: telegrammessenger/proxy:latest
ports:
- 51820:443
restart: always
volumes:
- ./data:/data # Replace it to your volume, if need
@squizduos
squizduos / README.md
Last active September 17, 2019 12:08
nginx-proxy + letsencrypt

.env file:

DEFAULT_HOST=example.com
DEFAULT_EMAIL=yourname@example.com

Create network:

docker network create nginx-proxy
@squizduos
squizduos / code-styling-isort.sh
Created October 9, 2019 13:57
Git diff code style fix and check: isort + autopep8 + flake8
#!/bin/bash
DIFF_FILES=$(git diff --name-only origin/master | grep '.*\.py')
if [ "$DIFF_FILES" ]; then
echo -e "Changed files:\n$DIFF_FILES\n" && DIFF=$(echo $DIFF_FILES | xargs)
isort &>/dev/null $DIFF && autopep8 --in-place --aggressive --aggressive $DIFF && flake8 $DIFF
[ $? -eq 0 ] && echo "Code quality check success" || echo "Code quality check failed"
else
echo -e "No changes detected"
fi
@squizduos
squizduos / README.md
Last active March 8, 2023 01:48
nginx-based Reverse Proxy with Let'sEncrypt + services

Docker + services

Установка Docker

В большинстве распространенных дистрибутивов Linux для установки Docker вам необходимо выполнить в терминале:

$ curl -fsSL get.docker.com -o /tmp/get-docker.sh && sudo sh /tmp/get-docker.sh

Для Windows и macOS воспользуйтесь официальным гайдом.

@squizduos
squizduos / README.md
Last active March 11, 2023 04:22
Генерируем пароли руками... и не только
@squizduos
squizduos / docker-compose.yml
Created October 14, 2019 10:48
miniflux.app in Docker
version: '3'
services:
reader:
image: miniflux/miniflux:latest
expose:
- 8080
depends_on:
- db
env_file: .env
@squizduos
squizduos / hex_encode_int.py
Created October 14, 2019 11:45
Encode integer to short url-friendly string with Python 3
import string
def hex_encode_int(n):
alphabet = string.digits + string.ascii_uppercase + string.ascii_lowercase
result = ""
while n:
n, t = divmod(n, len(alphabet))
result += alphabet[t]
return result or "0"
@squizduos
squizduos / Dockerfile
Created October 15, 2019 13:28
Hugo in Docker image, packed with Alpine Lunux
FROM alpine:latest
# ARG PACKAGE="hugo_extended"
ARG PACKAGE="hugo"
ARG REPOSITORY="gohugoio/hugo"
ARG VERSION="0.58.2"
WORKDIR /opt
# Install dependencies (bash, curl and jq for parsing Github)
@squizduos
squizduos / README.md
Last active April 24, 2022 20:10
VPN99 HTTP Proxy Servers List

VPN99 HTTP Proxy Servers List

List

Connection params

  • Type: HTTPS
@squizduos
squizduos / README.md
Created October 31, 2019 15:48
traefik with Docker Registry and VS Code

traefik

Env:

CONFIGS=/srv/config
EMAIL=squizduos@gmail.com
DOMAIN=sqds.me
RESTARTS=unless-stopped