Posts

Live engine important stuffs

Image
  How to configure reconnection timeout in LiveKit server? Use environment variable: Set the environment variable LIVEKIT_PARTICIPANT_RECONNECTION_TIMEOUT in your docker-compose file or Docker environment: services:   livekit:     image: livekit/livekit-server     environment:       - LIVEKIT_PARTICIPANT_RECONNECTION_TIMEOUT=120s  # default is 15 seconds     # other config To apply changes: cd /opt/livekit/ #Must go into this directory  docker-compose up -d --force-recreate livekit To Verify: docker exec -it $(docker ps -qf "name=livekit") printenv | grep LIVEKIT_PARTICIPANT_RECONNECTION_TIMEOUT sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw allow 7881/tcp sudo ufw allow 443/udp sudo ufw allow 50000:60000/udp sudo ufw enable For separate Redis server: On Redis VPS sudo ufw allow 6379 For Livekit load balancing : On Livekit VPS ufw allow 7880 ufw allow 3478/udp sudo ufw allow 534...

Protect VPS from Disk space Eater

For Docker: nano /etc/docker/daemon.json Put: {   "log-driver": "json-file",   "log-opts": {     "max-size": "50m",     "max-file": "3"   } } sudo systemctl daemon-reload sudo systemctl restart docker Sometimes needed  After editing: docker-compose down docker-compose up -d To check validity: jq . /etc/docker/daemon.json Verify settings are active: docker info | grep -A3 "Logging Driver" You should see: Logging Driver: json-file ... For System Logs: nano  /etc/systemd/journald.conf Uncomment and make: ForwardToSyslog=no Then reload: sudo systemctl restart systemd-journald

How to create virtual environment in python

 python3.9 -m venv myenv Notes: Here specifying python 3.9 version source myenv/bin/activate pip install package_name Django Run: python3.9 manage.py runserver 0.0.0.0:8000 deactivate

Deploy nextjs in nginx with PM2

Step by Step In next.config.mjs comment // output: 'export' $ npm run build  In next.config.mjs Uncomment // output: 'export' $ npm run build Move nextjs directory to /var/www/ in VPS without node_modules (It's Big files) $ npm i $ cd /etc/nginx/sites-available server {     listen 80;     server_name proj.consultechbd.com;  # Replace with your actual domain name     location / {         #root   /var/www/nextjs-paikari/out;         #index  index.html;         proxy_pass http://localhost:3000;         proxy_http_version 1.1;         proxy_set_header Upgrade $http_upgrade;         proxy_set_header Connection $connection_upgrade;         proxy_set_header Host $host;         proxy_cache_bypass $http_upgrade;     }     location /_next/static/ { ...

Transfer file to Server and vice versa

Local to Server:   scp -P 2222 /absolute_path/source-folder/some-file user@example.com:/absolute_path/destination-folder Server to Local: scp -P 2222 u ser@example.com:/absolute_path/destination-folder /absolute_path/source-folder/some-file How do I extract tar.xz files in Linux? The syntax is: Install xz using the  dnf install xz  on a CentOS/RHEL/Fedora Linux. Debian/Ubuntu Linux users try  apt install xz-utils  command. Extract tar.xz using the  tar -xf  backup.tar.xz  command To decompress filename.tar.xz file run:  xz -d -v  filename.tar.xz

Timezone missing in mysql database (celery periodic task)

 Ref:  https://stackoverflow.com/questions/21351251/database-returned-an-invalid-value-in-queryset-dates#21571350 You have to load timezone tables into mysql ( http://dev.mysql.com/doc/refman/5.6/en/mysql-tzinfo-to-sql.html ). Try execute on your database server: mysql_tzinfo_to_sql / usr / share / zoneinfo | mysql - D mysql - u root - p And then run "flush tables" or "flush query cache", otherwise the problem may not disappear even though you've loaded the correct timezone data: mysql - u root - p - e "flush tables;" mysql

How to Import and Export MySQL Database Command line in Linux

************ TO EXPORT ************ 1. SSH login as root. 2. Run command   mysqldump -a -u ejobsolution_db_user --password= db_password ejobsolution_db > ejobsolution_db.sql Download ejobsolution_db.sql from root directory Reference:  https://webhostinggeeks.com/howto/import-and-export-mysql-database-command-line-in-linux/ Reference:  https://archive.virtualmin.com/node/6032 How to Export MySQL Database Command line in Linux 1. Syntax to Export: mysqldump -u USERNAME -p DATABASE_NAME > filename.sql How to Export MySQL Database Command line in Linux 2. Syntax to Import: mysql -u USERNAME -p DATABASE_NAME < filename.sql CREATE USER 'db_user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON * . * TO 'db_user'@'localhost'; mysql -u db_user -p CREATE DATABASE db_name;