PROJECT=project; pg_dump -h localhost -U $PROJECT -d $PROJECT -f /tmp/$PROJECT.sql -bcOv --column-inserts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from argparse import ArgumentParser | |
from logging import Formatter, getLogger, INFO, Logger, StreamHandler | |
from pathlib import Path | |
from typing import List, Optional | |
import httpx # pip install httpx | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# **************************************************************** | |
# PROFILE | |
# включаем поддержку цветов в терминале | |
sed -i 's/xterm-color)/xterm-color|*-256color)/g' ~/.bashrc | |
# подсвечиваем root'а красным | |
sed -i 's/033\[01;32m/033\[01;31m/g' ~/.bashrc | |
# подкрашиваем: @ — белым, hostname — жёлтым | |
sed -i 's/\]\\u@\\h/\]\\u\\\[\\033\[00m\\\]@\\\[\\033\[33;1m\\\]\\h/g' ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
project_base="$HOME/SITE-FOLDER" | |
# Restart RQ | |
rqworker_name="$(basename $project_base)-rqworker" | |
rqworker_pidfile="$project_base/etc/rqworker.pid" | |
pkill -e -F "$rqworker_pidfile" || true | |
"$project_base/.env/bin/python" "$project_base/app/manage.py" \ | |
rqworker --name "$rqworker_name" --pid "$rqworker_pidfile" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine | |
MAINTAINER Petr Zelenin (https://github.com/petrikoz) | |
# uWSGI | |
ENV UWSGI_SRC_DIR /opt/uwsgi | |
ENV UWSGI_USER uwsgi | |
ENV UWSGI_VASSAL /etc/uwsgi/conf.d/vassal-php.ini | |
COPY --chown=nobody:nobody alpine.buildconf ${UWSGI_SRC_DIR}/alpine.buildconf | |
RUN set -x \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[API] | |
API_KEY = Get API_KEY from https://panel.netangels.ru/api_keys/ | |
DOMAINS = example.com,пример.рф | |
Archive_path = /root/ssl-renew | |
Archive_type = tar | |
Nginx_ssl = /etc/nginx/ssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/nginx/snippets/letsencrypt.conf | |
location /.well-known { | |
root /var/www/html; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Случайное распрделение участников для "гуся". | |
На выходе получаем спиоск пар "дарящий - получающий": | |
[(5, 4), (3, 2), (4, 7), (2, 1), (6, 3), (7, 5), (1, 6)] | |
Нужно просто задать количество участников в группе. | |
И потом просто распределить их в какую-нить таблицу. Например: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Put this file in 'project/src/.git/hooks' folder | |
# Change author in Python's source code | |
my_credits='My Name ([email protected])' | |
company_credits='Company ([email protected])' | |
find . -type f -iname '*.py' -exec sed -i -e "s/$my_credits/$company_credits/g" {} + | |
# Sort Python's imports in source code | |
find . -type f -iname '*.py' -exec isort {} + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[uwsgi] | |
emperor-tyrant = true | |
emperor = %dvassals | |
emperor-pidfile = %demperor.pid | |
uid = web | |
gid = www-data | |
vassals-include = %dvassals-include.ini |
NewerOlder