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
# Check disk usage of a folder | |
du -hs /folder | |
# Other disk usage commands | |
df -h --total | |
# Check free RAM in MBs | |
free -m |
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
sudo apt-get install fonts-indic fonts-noto -y |
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
poetry init | |
poetry add django==3.2.14 django-environ djangorestframework django-cors-headers drf-spectacular uvicorn redis celery django-celery-beat gunicorn psycopg2 | |
poetry add --dev mypy django-stubs pytest pytest-sugar djangorestframework-stubs flake8==4.0.1 flake8-isort coverage black pylint-django pylint-celery pre-commit factory-boy django-debug-toolbar django-coverage-plugin pytest-django | |
poetry export -f requirements.txt --output requirements.txt |
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
sudo apt-get install libpq5=14.4-0ubuntu0.22.04.1 -y --allow-downgrades | |
sudo apt-get install libpq-dev python3-dev -y | |
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
echo "export PATH=$PATH:/Library/PostgreSQL/13/bin" >> ~/.zshrc |
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
sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl git libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev libedit-dev libncurses5-dev -y | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
brew install openssl readline sqlite3 xz zlib | |
rm -rvf ~/.pyenv | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
brew upgrade pyenv | |
# Add the below in .zshrc |
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
# OS - Debian 10 | |
# AWS EC2 - t3.xlarge | |
# Swap - 16GB | |
# Login into server | |
ssh admin@server-ip-address -i key.pem | |
# Create new user & grant admin privileges | |
sudo adduser praneeth | |
sudo usermod -aG sudo praneeth |
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
clear && celery -A backend worker -l info --queues=celery_ams_regular --concurrency=6 --logfile=celery.log | |
clear && celery -A backend worker --queues=celery_ams_periodic -B -c 1 -l info --logfile=celerybeat.log |
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 backend.celery import app | |
app.conf.timezone = 'Asia/Kolkata' | |
app.conf.worker_prefetch_multiplier = 0 | |
app.conf.broker_connection_retry = True | |
app.conf.broker_connection_max_retries = 0 | |
app.conf.task_default_queue = 'celery_ams_regular' |
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 kombu.utils.url import safequote | |
SQS = config('SQS', cast=bool, default=False) | |
if SQS: | |
SQS_ACCESS_KEY = config('SQS_ACCESS_KEY', cast=str) | |
SQS_SECRET_KEY = config('SQS_SECRET_KEY', cast=str) | |
SQS_URL = config('SQS_URL', cast=str) | |
CELERY_BROKER_URL = f'sqs://{safequote(SQS_ACCESS_KEY)}:{safequote(SQS_SECRET_KEY)}@' | |
CELERY_TASK_DEFAULT_QUEUE = 'main-queue.fifo' | |
CELERY_BROKER_TRANSPORT_OPTIONS = { |
NewerOlder