# nano /etc/bash.bashrc
### Уведомление об авторизации на сервере
# Получаем ip адрес
USER_IP=$(echo $SSH_CLIENT | awk '{ print $1}')
# Формируем сообщение для отправки
# nano /etc/bash.bashrc
### Уведомление об авторизации на сервере
# Получаем ip адрес
USER_IP=$(echo $SSH_CLIENT | awk '{ print $1}')
# Формируем сообщение для отправки
nmap -T4 -sC -sV -Pn -oN nmap/initial 1.1.1.1
sudo gobuster dir -u http://10.0.2.4 -w /usr/share/wordlists/dirb/common.txt -e
/media/albert/CC0250E00250D0D6/db/SecLists/Discovery/Web-Content/common.txt
pip install asciinema
asciinema rec --overwrite demo.cast
docker run --rm -v $PWD:/data asciinema/asciicast2gif demo.cast demo.gif
https://serebrov.github.io/html/2018-11-29-linux-terminal-screencast.html
# Make sure that the additional_dependencies here match requirements.txt | |
ci: | |
autofix_prs: false | |
autoupdate_schedule: monthly | |
# We currently only need this behavior on the v13.x branch were we have the vendored urllib | |
# TODO: Remove once we discontinue v13 | |
submodules: true | |
repos: |
install: | |
poetry install | |
lint: | |
poetry run flake8 mediasoft --exclude=mediasoft/settings.py | |
test: | |
poetry run python manage.py test | |
test_coverage: |
import logging
logger = logging.getLogger() # object of LogRecord
logger.warning('Enter test func')
logger.debug('Enter test func') # do not show
Redis Key:
Do not use command KEYS in production, instead use SCAN
KEYS command - block until complete UNLICK command - not blocking command
import os | |
from cachelib import FileSystemCache | |
CACHE_FOLDER = os.path.join( | |
os.path.dirname(os.path.abspath(__file__)), ".cache" | |
) | |
def download_url(url: str) -> str: |
# В лофте n хипстерам достались m смузи. При этом все хипстеры - люди вежливые, и поэтому должны выпить одинаковое количество смузи (можно выбросить несколько). | |
# Напишите функцию distributeSmoothies(int $m, int $n): int, результатом которой будет количество смузи, которое выпьет каждый хипстер. | |
def distribute_smoothies(m: int, n: int) -> int: | |
if m == 0 or n == 0: | |
return 0 | |
return m // n |