*ARGS.TECH | BLOG | PAGE 3 | Shakhzhakhan Maxudbek's personal blog
Loading...
BLOG

DD (Data Definition) - powerful command line interface utility, designed for work with files (copy, converting, etc...) byte-by-byte. Similar to cp command it may copy from source file (if=...) to destination file (of=...). But difference from cp command - DD may control input/output parameters in low level. Also DD may clone, backup, mirror partitions. DD is preinstalled in GNU/Linux distributions.


Most frequently used args:

if - input file, which must be copied. May be plain fil…


Your virtual private servers (VPS) is under brute-force attacks by SSH protocol, or bad bots crawling your site and searching locations like admin panels, index.php files, etc? I tried to find solution for protecting projects in WEB. His name - Fail2ban.


Note: this is not completely 100 percent protection, but is better than nothing.


Here some examples of bad bots' headers:

Go-http-client/1.1
python-requests/2.32.3
Python/3.11 aiohttp/3.9.3
Python-urllib/3.8
python-httpx/0.27.0
Ruby
curl/7.61.1
libwww-pe…


This tutorial shows, how to build search view for your Django application with SearchVector class.

Why SearchQuery? SearchQuery translates the terms the user provides into a search query object that the database compares to a search vector. By default, all the words the user provides are passed through the stemming algorithms, and then it looks for matches for all of the resulting terms (documentation).


1. Configure DATABASE dictionary for using PostgreSQL database management system in your proje…


For protecting data in views from anonymous users you need to use authenticating system. Django provides built-in functions for auth implementation (documentation).

What is authentication? Authentication - process of user identification data comparison. Authentication passes in two steps:

- User identification - searching in database entered username.

- Authentication. If username from first step exists, system comparing value from "password" field in HTML page with password, saved …


Why exactly Docker compose? Docker compose used when you want to run your applications on any machine and start it by one click. This way called as serverless and cross platform architecture. Docker allow you to run applications on any computer, where it installed. It's very convenient and simple.


Complete structure of project:

demo_project/
    |
    |-- manage.py
    |
    |-- env/
    |
    |-- backend/
 &n…


Django SECRET_KEY need for providing cryptographic signing (documentation). This value is stored in <your_app>/settings.py file. When you start new project it will be generated from built-in function (source code). For production deployment SECRET_KEY must be strong and reliably protected.


These steps help you for generating new SECRET_KEY value:


1. Activate your project's virtual environment:

source env/bin/activate


2. Enter in Django's manage.py shell:

python3 manage.py shell


3. Import get_ra…


Telegram provides API for sending messages to users from bot. You may send messages via HTTP POST method using any programming language. I use Python and Requests library.


The URL address for sending message (require HTTP POST method):

https://api.telegram.org/bot<token_from_botfather>/sendMessage


Body of message:

{
    "chat_id": 123,
    "text": "Hello World!"
}


If you want to markup your message with Markdown - add parse_mode parameter in body of JSON:

{
  …


Hardcoding tokens, database credentials and other sensitive data in .py files is not secure. Many people use django-environ library, but I think it inconvenient. So I use yaml files for storing sensitive data and pyyaml library for reading data of them.

Create project folder:

mkdir myproject

Switch in created folder:
cd myproject

Create virtual environment:
python3 -m venv env

Activate virtual environment:
source env/bin/activate

Install Django and pyyaml:
pip3 install django pyyaml

Start new Django proje…


# Docker overview

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker's methodologies for shipping, testing, and deploying code, you can significantly reduce the delay between writing code and running it in production. Documentation.

# Ba…


If you've worked with Python's requests library to make HTTPS calls, you've almost certainly run into this wall of yellow text in your console:

InsecureRequestWarning: Unverified HTTPS request is being made.

Adding certificate verification is strongly advised.

See: https://urllib3.readthedocs.io/en/latest/advanced-layout.html#ssl-warnings


This warning is common, frequently Googled, and often "f…

Top button
© *ARGS.TECH
2025
v 2.29.0