diff --git a/pages/guides/database/install-mongodb.en-US.mdx b/pages/guides/database/install-mongodb.en-US.mdx index db010e9..d2cca74 100644 --- a/pages/guides/database/install-mongodb.en-US.mdx +++ b/pages/guides/database/install-mongodb.en-US.mdx @@ -126,7 +126,7 @@ Qo'shimcha parametrlarsiz ushbu buyruq local serverdagi default `27017` portida mongosh ``` -```txt filename="Natija" +```txt filename="Natija" /7.0.3/ /2.0.2/ Current Mongosh Log ID: 655782d3c03672d6c9f0e9aa Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.0.2 Using MongoDB: 7.0.3 @@ -159,7 +159,7 @@ switched to db admin 3. Administrator yaratish uchun `db.createUser` buyrug'idan foydalaning. Foydalanuvchi uchun foydalanuvchi nomini `user` va `pwd` uchun parolni kiriting. Yaxshiroq xavfsizlik uchun `pwd` maydonining qiymati sifatida `passwordPrompt()` buyrug'idan foydalaning. Bu MongoDB ga parolni so'rashni aytadi. Administratorga ikkita rol bering, `userAdminAnyDatabase` va `readWriteAnyDatabase`. MongoDB sheldagi buyruqni quyidagi tarzda kiriting va `userAdmin` o'rniga haqiqiy administrator nomini almashtiring. -```json +```json {3} db.createUser( { user: "userAdmin", @@ -250,7 +250,7 @@ net: Mana `mongod.conf` ni to'liq ko'rinishi -```conf filename="/etc/mongod.conf" /security:/ /authorization:/ /enabled/ /net:/ /port:/ /bindIp:/ /0.0.0.0/ /27017/ +```conf filename="/etc/mongod.conf" {19-21,28-29} # mongod.conf # for documentation of all options, see: diff --git a/pages/guides/database/postgres-monitoring.en-US.mdx b/pages/guides/database/postgres-monitoring.en-US.mdx index 062f1c9..ec941bd 100644 --- a/pages/guides/database/postgres-monitoring.en-US.mdx +++ b/pages/guides/database/postgres-monitoring.en-US.mdx @@ -55,9 +55,9 @@ Buni environment variable yordamida o'rnating. Bu yerda biz `DATA_SOURCE_NAME` ```bash cd /opt/postgres_exporter sudo nano postgres_exporter.env -```bash +``` -```bash filename="/opt/postgres_exporter/postgres_exporter.env" +```bash filename="/opt/postgres_exporter/postgres_exporter.env" {2,4} # birorta databaseni kuzatish uchun quyidagi configratsiyani o'zingizga moslab oling DATA_SOURCE_NAME="postgresql://username:password@localhost:5432/database-name?sslmode=disable" # yoki barcha databaselarni monitoring qilmoqchi bo'lsangi quyidagi configratsiyani o'zingizga moslab oling @@ -74,7 +74,7 @@ sudo useradd -rs /bin/false postgres sudo nano /etc/systemd/system/postgres_exporter.service ``` -```bash filename="/etc/systemd/system/postgres_exporter.service" +```bash filename="/etc/systemd/system/postgres_exporter.service" {8-10} [Unit] Description=Prometheus exporter for Postgresql Wants=network-online.target diff --git a/pages/guides/konteyner/dockerfile-yozish.en-US.mdx b/pages/guides/konteyner/dockerfile-yozish.en-US.mdx index 09d1e6a..d50302b 100644 --- a/pages/guides/konteyner/dockerfile-yozish.en-US.mdx +++ b/pages/guides/konteyner/dockerfile-yozish.en-US.mdx @@ -13,7 +13,7 @@ Ushbu qo'llanma Dockerfilelar qanday yozishni uni elementlarini ko'rib chiqamiz. Dockerfiledagi `FROM` instructioni sizning imagengiz asosida quriladigan asosiy imageni belgilash uchun ishlatiladi. Bu yangi konteyner imegaseni yaratish uchun boshlang'ich nuqtadir. Docker imageni yaratishni boshlaganingizda, odatda uni ma'lum muhit yoki funksiyalar to'plamini ta'minlaydigan mavjud imagega asoslashni xohlaysiz. `FROM` instructioni ushbu asosiy imageni belgilaydi. -```bash /FROM/ +```bash /FROM/ {1} FROM [:] [@] #Node.js namunalar FROM node @@ -33,7 +33,7 @@ Dockerfile-dagi `MAINTAINER` instructioni qurilayotgan imagening muallifi yoki m Maintainerni ko'rsatish uchun `LABEL` dan qanday foydalanish mumkinligiga misol: -```bash /MAINTAINER/ /LABEL/ +```bash /MAINTAINER/ /LABEL/ {2,4} FROM node:18 MAINTAINER Otabek Ismoilov # LABEL bilan @@ -46,7 +46,7 @@ Docker faylidagi `RUN` buyrug'i Docker imagedagi buyruqlarni bajarish uchun ishl `RUN` qanday ishlatilishiga misol: -```bash /RUN/ +```bash /RUN/ {4-7} FROM ubuntu:latest # Konteynerni yangilash va konteynerga zip, git, unzip o'rnatish @@ -58,7 +58,7 @@ RUN apt-get update && apt-get install -y \ Javascript applicationlar uchun misol -```bash /RUN/ +```bash /RUN/ {3-4} FROM node:18 RUN npm install @@ -70,7 +70,7 @@ Dockerfiledagi `WORKDIR` ko'rsatmasi(instructioni) Dockerfiledagi har qanday key `WORKDIR` ga misol: -```bash /WORKDIR/ +```bash /WORKDIR/ {2} FROM python:3.9-slim WORKDIR /usr/src/app ``` @@ -85,7 +85,7 @@ Dockerfiledagi `COPY` buyrug'i fayllar yoki jildlarni host mashinasidan qurilayo `COPY` qanday ishlatilishiga misol: -```bash /COPY/ +```bash /COPY/ {4} FROM ubuntu:latest RUN mkdir /myapp @@ -96,7 +96,7 @@ app-files jildidagi fayllarni host mashinasidan image ichidagi `/myapp` jildiga Python applicationlari uchun real namuna -```bash /COPY/ +```bash /COPY/ {3} FROM python:3.9-slim WORKDIR /usr/src/app COPY . /usr/src/app @@ -110,7 +110,7 @@ Dockerfiledagi `ENV` buyrug'i konteyner ichidagi muhit o'zgaruvchilarini(environ `ENV` insturctionlaridan foydalanishni ko'rsatadigan oddiy Dockerfile misoli: -```bash /ENV/ +```bash /ENV/ {3-4} FROM node:14 ENV NODE_ENV=production @@ -118,7 +118,7 @@ ENV PORT=3000 ``` Real mysql database uchun `ENV` ishlatilishi -```bash /ENV/ +```bash /ENV/ {3-6} FROM mysql:latest ENV MYSQL_ROOT_PASSWORD=my-secret-pw @@ -133,7 +133,7 @@ Dockerfile-dagi `ADD` insturctioni fayllarni, jildlarni yoki masofaviy URL-larni `ADD` insturctioni sintaksisi quyidagicha: -```bash /ADD/ +```bash /ADD/ {3} FROM node:14 ADD myapp /usr/src/app @@ -142,7 +142,7 @@ Bu yerda Docker build kontekstidan `myapp` nomli local jildni image ichidagi `/u Masofaviy fayl qo'shsih quyidagicha -```bash /ADD/ +```bash /ADD/ {3} FROM python:3.9 ADD https://example.com/file.txt /app/file.txt @@ -155,7 +155,7 @@ ADD https://example.com/file.txt /app/file.txt CMD insturctioni sintaksisi quyidagicha: -```bash /CMD/ +```bash /CMD/ {3} FROM python:3.9 CMD ["python", "app.py"] @@ -164,7 +164,7 @@ Ushbu misolda, ushbu imagega asoslangan konteyner ishga tushirilganda, u standar Web Serverni ishga tushirishga misol -```bash +```bash {3} FROM nginx:latest CMD ["nginx", "-g", "daemon off;"] @@ -177,7 +177,7 @@ Bu yerda CMD instructioni Nginx veb-serverini konteyner ichida ishga tushirish b `ENTRYPOINT` instructioni sintaksisi `CMD` ga o'xshaydi: -```bash /ENTRYPOINT/ +```bash /ENTRYPOINT/ {3} FROM python:3.9 ENTRYPOINT ["python", "app.py"] @@ -186,7 +186,7 @@ Bunday holda, `ENTRYPOINT` instructioni konteyner ishga tushirilganda Python skr `CMD` bilan birga ishlatilishi -```bash /ENTRYPOINT/ /CMD/ +```bash /ENTRYPOINT/ /CMD/ {3-4} FROM nginx:latest ENTRYPOINT ["nginx", "-g", "daemon off;"] @@ -203,7 +203,7 @@ Ushbu Dockerfile Nginx serverini standart sozlamalar bilan ishga tushirish uchun `EXPOSE` insturctionining sintaksisi oddiy: -```bash /EXPOSE/ +```bash /EXPOSE/ {4} FROM nginx:latest # HTTP trafigi uchun 80 portini ochadi(expose) @@ -224,7 +224,7 @@ Bu buyruq Docker-ga `80`-portni konteynerdan hostdagi `8080`-portga publish qili Misol uchun Node.js dasturiga namuna Dockerfile -```bash /EXPOSE/ +```bash /EXPOSE/ {15} FROM node:14 WORKDIR /usr/src/app @@ -252,7 +252,7 @@ Ushbu Node.js misolida `EXPOSE` insturctioni konteyner ichidagi Node.js ilovasi `VOLUME` instructioni sintaksisiga misol: -```bash /VOLUME/ +```bash /VOLUME/ {5} # Use a base image FROM ubuntu:latest @@ -301,7 +301,7 @@ USER `` asosiy imagedagi mavjud foydalanuvchining yoki Dockerfile-da yaratilgan foydalanuvchining usernamesi yoki UID boʻlishi mumkin. Docker faylida USER instructionian foydalanishni ko'rsatadigan bir nechta misollar: -```bash /USER/ +```bash /USER/ {5} FROM ubuntu:latest # Yangi foydalanuvchi "appuser" yaratadi va o'sha foydalanuvchiga o'tadi @@ -317,7 +317,7 @@ Ushbu misolda, `useradd` yordamida `appuser` nomli yangi foydalanuvchi yaratilga UID dan foyalanishga misol -```bash /USER/ +```bash /USER/ {7} FROM node:14 WORKDIR /usr/src/app diff --git a/pages/guides/web-server/nginx-load-balancing.en-US.mdx b/pages/guides/web-server/nginx-load-balancing.en-US.mdx index a5c2a4a..e356a35 100644 --- a/pages/guides/web-server/nginx-load-balancing.en-US.mdx +++ b/pages/guides/web-server/nginx-load-balancing.en-US.mdx @@ -183,7 +183,7 @@ nano devops-journey.uz ``` `devops-journey.uz` konfiguratsiya ochib olganimzidan keyin quyidagicha Load Balancing konfiguratsiya qilamiz. -```bash filename="/etc/nginx/sites-available/devop-journey.uz" +```bash filename="/etc/nginx/sites-available/devop-journey.uz" {1-5,8,11} upstream backend { server 185.168.1.21:9000; server 185.168.1.22:9000; @@ -240,7 +240,7 @@ server { * `server_name devops-journey.uz;` `server` blokidagi konfiguratsiyani `devops-journey.uz` domeni bilan bog‘laydi. Ushbu domen uchun so'rov kelib tushganda, ushbu server blokida belgilangan konfiguratsiyalar qo'llaniladi. -```bash +```bash {2} location / { proxy_pass http://backend/; proxy_set_header Host $host; @@ -310,7 +310,7 @@ NGINX configuratsiyamizga quyidagi o'zgartisihni kiritamiz NGINXga reload berami sudo nano /etc/nginx/sites-available/devop-journey.uz ``` -```bash filename="/etc/nginx/sites-available/devop-journey.uz" /ip_hash;/ +```bash filename="/etc/nginx/sites-available/devop-journey.uz" /ip_hash;/ {2,9,12} upstream backend { ip_hash; server 185.168.1.21:9000; @@ -365,7 +365,7 @@ Buning uchun NGINX configuratsiyamizni quyidagidek yangilaymiz va NGINXga reload sudo nano /etc/nginx/sites-available/devop-journey.uz ``` -```bash filename="/etc/nginx/sites-available/devop-journey.uz" /weight/ +```bash filename="/etc/nginx/sites-available/devop-journey.uz" /weight/ {1-5,8,11} upstream backend { server 185.168.1.21:9000 weight=10; server 185.168.1.22:9000 weight=8; @@ -402,7 +402,7 @@ sudo nano /etc/nginx/sites-available/devop-journey.uz ``` -```bash filename="/etc/nginx/sites-available/devop-journey.uz" /weight/ /ip_hash;/ +```bash filename="/etc/nginx/sites-available/devop-journey.uz" /weight/ /ip_hash;/ {2,9,12} upstream backend { ip_hash; server 185.168.1.21:9000 weight=10; @@ -427,7 +427,7 @@ NGINXda yana bir load balancing metodini qo'llashimiz mumkin bu **Least Connecti **Least Connections** uchun NGINX configuratsiya quyidagicha -```bash filename="/etc/nginx/sites-available/devop-journey.uz" /least_conn;/ +```bash filename="/etc/nginx/sites-available/devop-journey.uz" /least_conn;/ {2,9,12} upstream backend { least_conn; server 185.168.1.21:9000 weight=10; @@ -464,7 +464,7 @@ Keling bu uchun NGINX Load Balancing konfiguratsiyamizni yangilab NGINXga reload sudo nano /etc/nginx/sites-available/devop-journey.uz ``` -```bash filename="/etc/nginx/sites-available/devop-journey.uz" /weight/ /least_time header;/ +```bash filename="/etc/nginx/sites-available/devop-journey.uz" /weight/ /least_time header;/ {2,9,12} upstream backend { least_time header; server 185.168.1.21:9000 weight=10; diff --git a/pages/tutorials/article/gnp-monitoring.en-US.mdx b/pages/tutorials/article/gnp-monitoring.en-US.mdx index 4588316..8f95a61 100644 --- a/pages/tutorials/article/gnp-monitoring.en-US.mdx +++ b/pages/tutorials/article/gnp-monitoring.en-US.mdx @@ -249,7 +249,7 @@ sudo nano /etc/systemd/system/node_exporter.service Faylga quyidagi kodni kiriting: -```bash filename="/etc/systemd/system/node_exporter.service" +```bash filename="/etc/systemd/system/node_exporter.service" {2,7-8,12} [Unit] Description=Node Exporter Wants=network-online.target diff --git a/pages/tutorials/article/netflix-deploy.en-US.mdx b/pages/tutorials/article/netflix-deploy.en-US.mdx index 471da3c..04026f0 100644 --- a/pages/tutorials/article/netflix-deploy.en-US.mdx +++ b/pages/tutorials/article/netflix-deploy.en-US.mdx @@ -177,7 +177,7 @@ sudo nano /etc/nginx/sites-available/jenkins.xilol.uz ``` Fayl `nano` matn muhrarrida ochilganidan keyin quyidagi NGINX konfiguratsiyani joylashtiring. -```bash filename="/etc/nginx/sites-available/jenkins.xilol.uz" +```bash filename="/etc/nginx/sites-available/jenkins.xilol.uz" {3,6} server { listen 80; server_name jenkins.xilol.uz; @@ -325,7 +325,7 @@ nano /etc/nginx/sites-available/sonarqube.xilol.uz ``` Ushbu faylga quyidagi NGINX configuratsiyani joylashtiramiz. -```nginx filename="/etc/nginx/sites-available/sonarqube.xilol.uz" /proxy_pass/ /9000/ /sonarqube.xilol.uz/ +```nginx filename="/etc/nginx/sites-available/sonarqube.xilol.uz" /proxy_pass/ /9000/ /sonarqube.xilol.uz/ {3,6} server { listen 80; server_name sonarqube.xilol.uz; @@ -458,7 +458,7 @@ sudo nano /etc/nginx/sites-available/grfaana.xilol.uz Grafana `3000` portda ishlab turadi bizni reverse-proxy proxy_pass qilib expose qilamiz. -```bash filename="/etc/nginx/sites-available/grafana.xilol.uz" /grafana.xilol.uz/ /3000/ +```bash filename="/etc/nginx/sites-available/grafana.xilol.uz" /grafana.xilol.uz/ /3000/ {3,6} server { listen 80; server_name grafana.xilol.uz; @@ -518,7 +518,7 @@ nano /etc/prometheus/prometheus.yml `0.0.0.0:8080` bu yerda siz jenkins o'rnatilgan serveringiz **IP** manzilini kiritasiz. Quyida `prometheus.yml` faylining to'liq ko'rinishi. -```yaml filename="/etc/prometheus/prometheus.yml" /static_configs/ /targets/ +```yaml filename="/etc/prometheus/prometheus.yml" /static_configs/ /targets/ {28-29, 32-34, 36-39} # my global config global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. @@ -637,7 +637,7 @@ Hammasini rasmda ko'rsatilganidek o'zingizga moslab sozlab olganingizdan keyin ` Email Notificationni sozlab olganimizdan keyin Jenkins pipelineda email notificationdan quyidagicha foydalanamiz: -```groovy filename="Jenkinsfile" +```groovy filename="Jenkinsfile" {8-9} post { always { emailext attachLog: true, @@ -776,7 +776,7 @@ Bu yerda siz itemga nom berasiz masalan **Netflix** keyin **Pipline**-ni tanlab Ushbu `Pipeline` qismida biz **CI/CD** pipelinemizni yozamiz u quyidagicha. -```groovy +```groovy {8-12,15, 20,25,33,40} pipeline { agent any tools { @@ -975,7 +975,7 @@ Jenkins pipelenimizga quyidagi bosqichni qo'shamiz. Bu bosqich ilovamizdan docke Pipelinega yangi environmentlar qo'shib olamiz: -```groovy /DOCKERHUB_CREDENTIALS/ /REGISTRY_URL/ /CONTAINER_NAME/ +```groovy /DOCKERHUB_CREDENTIALS/ /REGISTRY_URL/ /CONTAINER_NAME/ {4-6} environment { GIT_URL = 'https://github.com/ismoilovdevml/netflix.git' GITHUB_TOKEN = credentials('github-token') @@ -1028,7 +1028,7 @@ Koddagi qism `[usernamePassword(credentialsId: 'dockerhub', usernameVariable: 'D Loyihamizdagi Dockerfile -```bash filename="Dockerfile" /TMDB_V3_API_KEY/ +```bash filename="Dockerfile" /TMDB_V3_API_KEY/ {7-8} FROM node:16.17.0-alpine as builder WORKDIR /app COPY ./package.json . @@ -1054,7 +1054,7 @@ ENTRYPOINT ["nginx", "-g", "daemon off;"] Hozirgi holat uchun to'liq Jenkins pipeline uni Jenkinsda yangilab qayta ishga tushiring. -```groovy filename="Jenkins" +```groovy filename="Jenkins" {10-12,48-53,59-77} pipeline { agent any tools { @@ -1239,7 +1239,7 @@ Bu qismda esa `Secret`ga Serverimiz IP manzilini yozishimiz kerak. Endi Serverimizga kerakli `environment`larni qo'shib chiqishimiz kerak. -```groovy /SERVER_USERNAME/ /SERVER_IP/ +```groovy /SERVER_USERNAME/ /SERVER_IP/ {8-9} environment { GIT_URL = 'https://github.com/ismoilovdevml/netflix.git' GITHUB_TOKEN = credentials('github-token') @@ -1275,7 +1275,7 @@ Shu qismda bizda bitta muammo bor yani oldindan shu nomli container ishlab turga nano deployer.sh ``` -```bash filename="deployer.sh" +```bash filename="deployer.sh" {44} !/bin/bash while [ $# -gt 0 ]; do case "$1" in @@ -1356,7 +1356,7 @@ Ilovamiz uchun NGINX konfiguratsiya quyidagicha. sudo nano /etc/nginx/sites-available/netflix.xilol.uz ``` -```bash filename="/etc/nginx/sites-available/netflix.xilol.uz" /netflix.xilol.uz/ +```bash filename="/etc/nginx/sites-available/netflix.xilol.uz" /netflix.xilol.uz/ {3,6} server { listen 80; server_name netflix.xilol.uz;