Metadata-Version: 2.1
Name: arpakitlib
Version: 1.5.18
Summary: arpakitlib
License: Apache-2.0
Author: arpakit
Author-email: arpakit@gmail.com
Requires-Python: >=3.12,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: aiogram (>=3.15.0,<4.0.0)
Requires-Dist: aiohttp-socks (>=0.9.1,<0.10.0)
Requires-Dist: alembic (>=1.14.0,<2.0.0)
Requires-Dist: asyncpg (>=0.30.0,<0.31.0)
Requires-Dist: asyncssh (>=2.18.0,<3.0.0)
Requires-Dist: bs4 (>=0.0.2,<0.0.3)
Requires-Dist: cachetools (>=5.5.0,<6.0.0)
Requires-Dist: celery (>=5.4.0,<6.0.0)
Requires-Dist: cryptography (>=44.0.0,<45.0.0)
Requires-Dist: fastapi (>=0.115.5,<0.116.0)
Requires-Dist: gunicorn (>=23.0.0,<24.0.0)
Requires-Dist: openai (>=1.55.3,<2.0.0)
Requires-Dist: pandas (>=2.2.3,<3.0.0)
Requires-Dist: paramiko (>=3.5.0,<4.0.0)
Requires-Dist: psycopg-binary (>=3.2.3,<4.0.0)
Requires-Dist: psycopg2-binary (>=2.9.10,<3.0.0)
Requires-Dist: pydantic-settings (>=2.6.1,<3.0.0)
Requires-Dist: pyjwt (>=2.10.1,<3.0.0)
Requires-Dist: pymongo (>=4.10.1,<5.0.0)
Requires-Dist: pytz (>=2024.2,<2025.0)
Requires-Dist: pyzabbix (>=1.3.1,<2.0.0)
Requires-Dist: redis (>=5.2.0,<6.0.0)
Requires-Dist: requests (>=2.32.3,<3.0.0)
Requires-Dist: sqladmin (>=0.20.1,<0.21.0)
Requires-Dist: sqlalchemy (>=2.0.36,<3.0.0)
Requires-Dist: twine (>=6.0.1,<7.0.0)
Requires-Dist: uvicorn (>=0.32.1,<0.33.0)
Description-Content-Type: text/markdown

# ARPAKITLIB

## 🚀 Simplify Your Development Workflow

A collection of lightweight and convenient development tools by Arpakit, designed to simplify and accelerate your
workflow

---

### Links

- https://pypi.org/project/arpakitlib/
- https://test.pypi.org/project/arpakitlib/
- https://github.com/ARPAKIT-Company/arpakitlib
- https://t.me/arpakit (author telegram)
- arpakit@gmail.com (author email)

---

## Below is a set of information to assist with development at Arpakit Company

Note: This is not related to ArpakitLib, it is just a collection of helpful information

### Emoji

- https://www.prosettings.com/emoji-list/

### Timezones

- https://gist.github.com/heyalexej/8bf688fd67d7199be4a1682b3eec7568

### Docker help

- https://www.ionos.com/digitalguide/server/configuration/install-docker-on-ubuntu-2204/

```
sudo apt update
sudo apt upgrade
sudo apt install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo groupadd docker
sudo usermod -aG docker $USER

docker ps -a
docker stop $(docker ps -a -q)
docker container rm $(docker ps -a -q)
docker rmi $(docker images -a -q)
docker stop $(docker ps -a -q) && docker container rm $(docker ps -a -q)
docker stop $(docker ps -a -q) && docker container rm $(docker ps -a -q) && docker rmi $(docker images -a -q)
docker build -p 8080:8080 -t tagname -f Dockerfile .
docker stats


docker rm ...
docker run --name ... -d -p ...:5432 -e POSTGRES_USER=... -e POSTGRES_PASSWORD=... -e POSTGRES_DB=... postgres:16 -c max_connections=100
docker start ...
```

### Systemd help

```
[Unit]
Description=...
After=network.target

[Service]
User=...
WorkingDirectory=...
ExecStart=...
RestartSec=5
Restart=always

[Install]
WantedBy=multi-user.target

sudo systemctl start ...
sudo systemctl stop ...


[Unit]
Description=divar_site

[Service]
User=divar_site
WorkingDirectory=/home/divar_site/divar_site
Environment=PATH=/home/divar_site/.nvm/versions/node/v18.16.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
ExecStart=/bin/bash -c "npm run start"
RestartSec=5
Restart=always

[Install]
WantedBy=multi-user.target
```

### Nginx help

```
sudo apt update
sudo apt install nginx
systemctl start nginx
systemctl stop nginx
systemctl restart nginx

server {
    listen 80;
    listen [::]:80;

    server_name ...;

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://127.0.0.1:...;
    }
}
```

### Poetry help

- https://python-poetry.org/docs/

```
curl -sSL https://install.python-poetry.org | python3 -
# After downloading u should update .profile, bashrc etc...
exec "$SHELL"
# export PATH="$HOME/.local/bin:$PATH"
poetry config virtualenvs.in-project true
poetry self add poetry-plugin-export
poetry self update

poetry env use ...
poetry install
poetry update

pyproject.toml
package-mode = false

poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi ...
poetry publish --build --repository testpypi
poetry source add --priority=explicit testpypi https://test.pypi.org/legacy/
poetry config pypi-token.pypi <your-pypi-token>

poetry export -f requirements.txt --without-hashes --output requirements.txt

poetry cache clear pypi --all

export TWINE_HTTP_TIMEOUT=60
poetry publish

poetry cache clear --all PyPI
```

### Pyenv help

- https://kfields.me/blog/pyenv_on_ubuntu_22

```
sudo apt update
sudo apt install make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
curl https://pyenv.run | bash
# After downloading u should update .profile, bashrc etc...
# export PYENV_ROOT="$HOME/.pyenv"
# [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
# eval "$(pyenv init -)"
exec "$SHELL"
pyenv install ...
pyenv versions
```

### Certbot help

```
sudo apt install snapd -y
sudo snap install --classic certbot
su - root

certbot --nginx -d "a.domain.com" -d "b.domain.com"
sudo certbot certificates
```

### Proxy example help

```
socks5://user:passwd@hostname:port
https://user:passwd@hostname:port
```

### PostgreSQL help

- https://selectel.ru/blog/tutorials/how-to-install-and-use-postgresql-on-ubuntu-20-04/

```
# install postgresql
sudo apt install postgresql postgresql-contrib
sudo apt install postgresql-client
sudo systemctl start postgresql.service
sudo systemctl status postgresql.service
sudo -i -u postgres
psql
\conninfo - info
\q - exit
\list - databases
\du - users
createuser --interactive --pwprompt
createdb -U postgres ...
ALTER ROLE username WITH PASSWORD 'newpassword';
sudo nano /etc/postgresql/<версия>/main/pg_hba.conf
host    all             all             0.0.0.0/0               md5
sudo nano /etc/postgresql/<версия>/main/postgresql.conf
listen_addresses = '*'
#port = 5432
CREATE USER ... WITH PASSWORD '...';
ALTER USER ... WITH SUPERUSER;
CREATE DATABASE ... OWNER '...';

# postgresql db url, db_url
postgresql://username:password@host:port/database_name

# postgresql pg_dump
pg_dump -U postgres -h localhost -t <имя_таблицы> mydb > table_dump.sql
pg_dump -U ... -h ... ... -p ... > ...

# postgresql db_restore
pg_restore -U ... -h ... -p ... -d ... ....dump

```

### Install Python from apt help

```
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.12
sudo apt install python3.12-venv

# create venv with python
python3 -m venv .venv
```

### Git help

```
git remote -v
git remote remove origin_name
git remote add origin_name URL
git remote set-url origin_name URL
git remote rename old new
git fetch --all
git branch -r
git branch -a
```

### Linux help

```
free -h проверка оперативной памяти
df -h - проверка постоянной памяти
nano /etc/apt/sources.list.d
deluser --remove-home user
adduser user
usermode -aG sudo user
```

### Swagger-ui, /docs help

- https://github.com/swagger-api/swagger-ui (folder dist for download static docs)

### npm, nvm help

- https://github.com/nvm-sh/nvm
- https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04

```
# install nvm, npm, node (https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
exec "$SHELL"
npm -v
nvm current
nvm ls
nvm list-remote
nvm install --lts
nvm use ...
npm install
npm run build
npm run start
```

### Xray help

- https://github.com/XTLS/Xray-install

```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install-geodata
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove
```

### Celery help

```
celery -A app worker --loglevel=info -Q queue_name -c 1 -n worker_name &
celery -A app beat --loglevel=info &
wait
```

### Licence help

- https://choosealicense.com/

---

## ❤️ Made with Care by Arpakit ❤️


