<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: ilhamsabir</title>
    <description>The latest articles on Forem by ilhamsabir (@ilhamsabir).</description>
    <link>https://forem.com/ilhamsabir</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F379045%2Fd2c13f71-2bbe-4430-8a16-3ef9e3000d5c.jpeg</url>
      <title>Forem: ilhamsabir</title>
      <link>https://forem.com/ilhamsabir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ilhamsabir"/>
    <language>en</language>
    <item>
      <title>💬 Waaku: Manage Multiple WhatsApp Sessions with One Dashboard</title>
      <dc:creator>ilhamsabir</dc:creator>
      <pubDate>Mon, 06 Oct 2025 02:57:49 +0000</pubDate>
      <link>https://forem.com/ilhamsabir/waaku-manage-multiple-whatsapp-sessions-with-one-dashboard-1d54</link>
      <guid>https://forem.com/ilhamsabir/waaku-manage-multiple-whatsapp-sessions-with-one-dashboard-1d54</guid>
      <description>&lt;p&gt;Ever tried running &lt;strong&gt;more than one WhatsApp Web session&lt;/strong&gt;… and realized you &lt;em&gt;can’t&lt;/em&gt;? 😩  &lt;/p&gt;

&lt;p&gt;For developers building &lt;strong&gt;chatbots, automation tools, or customer service dashboards&lt;/strong&gt;, that’s a huge limitation.  &lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://github.com/ilhamsabir/waaku_project" rel="noopener noreferrer"&gt;Waaku&lt;/a&gt;&lt;/strong&gt; 🚀 —&lt;br&gt;&lt;br&gt;
an &lt;strong&gt;open-source multi-session WhatsApp manager&lt;/strong&gt; with:  &lt;/p&gt;

&lt;p&gt;✅ Real-time dashboard&lt;br&gt;&lt;br&gt;
✅ Secure API (REST + WebSocket)&lt;br&gt;&lt;br&gt;
✅ Docker support out of the box  &lt;/p&gt;

&lt;p&gt;Fork it, run it, and instantly manage multiple WhatsApp accounts like a pro.  &lt;/p&gt;


&lt;h2&gt;
  
  
  🔥 Why You’ll Love Waaku
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multi-session&lt;/strong&gt; → no more juggling one account at a time
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-time dashboard&lt;/strong&gt; → scan QR, see status, monitor errors instantly
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swagger API&lt;/strong&gt; → send messages, validate numbers, restart sessions via REST
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure Auth&lt;/strong&gt; → SHA-512 API keys (raw key never touches the server)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dockerized&lt;/strong&gt; → works anywhere in minutes
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s basically &lt;strong&gt;WhatsApp Web on steroids&lt;/strong&gt; 💪  &lt;/p&gt;


&lt;h2&gt;
  
  
  🛠️ Tech Stack at a Glance
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Tech&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Frontend&lt;/td&gt;
&lt;td&gt;Vue 3 + Vite + Tailwind + Socket.IO&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend&lt;/td&gt;
&lt;td&gt;Node.js + Express + whatsapp-web.js&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Real-time&lt;/td&gt;
&lt;td&gt;Socket.IO&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Auth&lt;/td&gt;
&lt;td&gt;UUIDv4 + SHA-512 API keys&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Docs&lt;/td&gt;
&lt;td&gt;Swagger (&lt;code&gt;/api-docs&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deploy&lt;/td&gt;
&lt;td&gt;Docker + docker-compose&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h2&gt;
  
  
  🚀 Quick Start
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clone the repo&lt;/span&gt;
git clone https://github.com/ilhamsabir/waaku_project.git
&lt;span class="nb"&gt;cd &lt;/span&gt;waaku_project

&lt;span class="c"&gt;# Copy env file and configure&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.example .env

&lt;span class="c"&gt;# Build &amp;amp; run with Docker&lt;/span&gt;
docker compose up &lt;span class="nt"&gt;--build&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;⚡ Example: Validate a Number&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST http://localhost:4300/api/sessions/session1/validate &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-API-Key: &amp;lt;your-raw-uuidv4&amp;gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"to": "6281234567890"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boom 💥 — instant validation.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔎 Behind the Scenes
&lt;/h2&gt;

&lt;p&gt;Waaku keeps your dashboard in sync without polling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;QR code generated? → pushed instantly via Socket.IO&lt;/li&gt;
&lt;li&gt;Session ready? → dashboard updates in real-time&lt;/li&gt;
&lt;li&gt;Error? → you’ll see it right away&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Built on whatsapp-web.js but wrapped in a much more developer-friendly flow.&lt;/p&gt;




&lt;h2&gt;
  
  
  🗺️ Roadmap
&lt;/h2&gt;

&lt;p&gt;Some ideas in the pipeline:&lt;/p&gt;

&lt;p&gt;✅ Automated testing (unit + integration)&lt;br&gt;
✅ Redis for distributed rate limiting&lt;br&gt;
✅ Notifications (Slack/Telegram when a session drops)&lt;br&gt;
✅ Plugin-ready UI&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Got suggestions? Open an &lt;a href="https://github.com/ilhamsabir/waaku_project/issues" rel="noopener noreferrer"&gt;issue&lt;/a&gt; or PR 🙌&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🚀 Final Thoughts
&lt;/h3&gt;

&lt;p&gt;WhatsApp is powerful, but its limits slow us down.&lt;br&gt;
With Waaku, you finally get a multi-session, real-time, Dockerized WhatsApp manager that’s flexible enough for side projects, startups, or production systems.&lt;/p&gt;

&lt;p&gt;I’m excited to see what you build with it. Fork the repo today 👇&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/ilhamsabir/waaku_project" rel="noopener noreferrer"&gt;https://github.com/ilhamsabir/waaku_project&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>vue</category>
      <category>docker</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Send Message BOT Telegram NodeJs</title>
      <dc:creator>ilhamsabir</dc:creator>
      <pubDate>Wed, 13 Mar 2024 04:08:38 +0000</pubDate>
      <link>https://forem.com/ilhamsabir/send-message-bot-telegram-nodejs-1hi2</link>
      <guid>https://forem.com/ilhamsabir/send-message-bot-telegram-nodejs-1hi2</guid>
      <description>&lt;h1&gt;
  
  
  Send Message BOT Telegram NodeJs
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Intruduction
&lt;/h2&gt;

&lt;p&gt;Create telegram bot to send message from NODEJS Apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create BOT Telegram
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Goto &lt;a href="https://t.me/BotFather" rel="noopener noreferrer"&gt;BotFather&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Open it from mobile device or web.telegram.org&lt;/li&gt;
&lt;li&gt;type
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  \newbot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Follow instruction&lt;/li&gt;
&lt;li&gt;When completed youll get API Token, copy it to somewhere saved.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Test BOT
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open Postman/Insomnia or anything like that.&lt;/li&gt;
&lt;li&gt;Create GET request sample.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    # HTTP request format
    # https://api.telegram.org/bot&amp;lt;token&amp;gt;/METHOD_NAME

    # our first method /getMe
    https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now you can see your user data&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Building NodeJS
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Init nodejs app
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    # configure as needed
    npm init;

    # install dependencies
    npm i express axios body-parser --save;

    # create main file
    touch index.js;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create index.js
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // Dependencies
    const express = require('express');
    const app = express();
    const axios = require('axios');
    const bodyParser = require('body-parser');
    const port = 80;
    const url = 'https://api.telegram.org/bot';
    const apiToken = '{api-token-given-by-BotFather}';
    // Configurations
    app.use(bodyParser.json());
    // Endpoints
    app.post('/', (req, res) =&amp;gt; {
        // console.log(req.body);
        const chatId = req.body.message.chat.id;
        const sentMessage = req.body.message.text;
        // Regex for hello
        if (sentMessage.match(/hello/gi)) {
            axios.post(`${url}${apiToken}/sendMessage`,
                {
                        chat_id: chatId,
                        text: 'hello back 👋'
                })
                .then((response) =&amp;gt; {
                        res.status(200).send(response);
                }).catch((error) =&amp;gt; {
                        res.send(error);
                });
        } else {
            // if no hello present, just respond with 200
            res.status(200).send({});
        }
    });
    // Listening
    app.listen(port, () =&amp;gt; {
        console.log(`Listening on port ${port}`);
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Try access route and it will send notif to your telegram&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reference
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://codingwithmanny.medium.com/building-a-telegram-bot-with-nodejs-46660f05b42f" rel="noopener noreferrer"&gt;Create bot telegram&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>node</category>
      <category>telegram</category>
      <category>bot</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Dockerize NodeJS</title>
      <dc:creator>ilhamsabir</dc:creator>
      <pubDate>Wed, 13 Mar 2024 04:04:27 +0000</pubDate>
      <link>https://forem.com/ilhamsabir/dockerize-nodejs-113b</link>
      <guid>https://forem.com/ilhamsabir/dockerize-nodejs-113b</guid>
      <description>&lt;h1&gt;
  
  
  How to dockerize nodejs app
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Step 1: Install Docker
&lt;/h2&gt;

&lt;p&gt;To begin with, it’s required to have Docker on your computer. You can download Docker Desktop from the below link and once it’s downloaded and installed successfully, launch the Docker Desktop on your computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Create a containerised application
&lt;/h2&gt;

&lt;p&gt;The next step is to containerise your application using Docker. To containerise your application you need to have a Dockerfile that is written in YAML. Let’s create a Dockerfile using node as the base image.&lt;/p&gt;

&lt;p&gt;I created a simple Node.js application and my working directory contains the below files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hello-world
  - app.js
  - package-lock.json
  - package.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I need to create a Dockerfile inside this directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM node:10.23-alpine

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 8080

CMD ["node", "app.js"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After you add the Dockerfile, you can create the docker image for your application. Use the below command for that [make sure you’re in the same directory where your Dockerfile resides].&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker build . -t &amp;lt;image-name&amp;gt;
Eg:
$ docker build . -t node-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Push your image to a Container Registry
&lt;/h2&gt;

&lt;p&gt;For this demonstration, I am using Docker Hub as the container registry. But you can choose any other container registry as you prefer.&lt;/p&gt;

&lt;p&gt;To start with, go to Docker Hub and create a new account. Then sign in and go to Repositories &amp;gt; Create Repository. Add a Name to your repository [you can also add a description to your repository but it’s optional] and you can choose whether it keeps as a public or a private repository [if you’re using a free plan, you can create only one private repository in your account].&lt;/p&gt;

&lt;p&gt;Then you need to log in to your Docker Hub account using your terminal. For that, use the below command and provide your credentials where necessary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker login &amp;lt;container-registry-name&amp;gt; -u &amp;lt;username&amp;gt; -p &amp;lt;password&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the general command which you can use to log into your account. But the drawback of using this command is, you have to enter your password in plain text. Therefore, use one of the following commands so that your password will not be visible even on the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker login &amp;lt;container-registry-name&amp;gt;
// then hit enter &amp;amp; provide your username and password
- OR -
$ docker login &amp;lt;container-registry-name&amp;gt; -u &amp;lt;username&amp;gt;
// then hit enter and provide your password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since I’m using Docker Hub as the container registry you can use docker login command on the terminal and provide credentials without specifying the container registry name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Eg: type docker login and hit enter
$ docker login
Username: &amp;lt;username&amp;gt;
Password: &amp;lt;password&amp;gt;
// provide credentials and hit enter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After you get Login Succeeded as the output on your terminal, you can start docker tagging and docker pushing.&lt;/p&gt;

&lt;p&gt;docker tag command help you to give a tag to your docker image while docker push command pushes it into the Docker Hub. Let’s see how to use these commands on the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
SOURCE_IMAGE[:TAG] - you can keep this as your local image
TARGET_IMAGE[:TAG] - &amp;lt;username&amp;gt;/&amp;lt;image-name&amp;gt;:&amp;lt;tag&amp;gt;
Eg:
$ docker tag node-app mikej/node-app:v1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above command will tag your image and next you can use the docker push command as below and it will push your image or a repository to a registry.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker push --help
Usage: docker push [OPTIONS] NAME[:TAG]
Push an image or a repository to a registry
Options:
--disable-content-trust   Skip image signing (default true)
Eg:
$ docker push mikej/node-app:v1.0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>docker</category>
      <category>node</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Install Mongodb on PHP Mac OS Montery (M1)</title>
      <dc:creator>ilhamsabir</dc:creator>
      <pubDate>Wed, 13 Mar 2024 03:43:40 +0000</pubDate>
      <link>https://forem.com/ilhamsabir/install-mongodb-on-php-mac-os-montery-m1-59nk</link>
      <guid>https://forem.com/ilhamsabir/install-mongodb-on-php-mac-os-montery-m1-59nk</guid>
      <description>&lt;h1&gt;
  
  
  Install Mongodb on PHP Mac OS Montery (M1)
&lt;/h1&gt;

&lt;p&gt;Install the PHP MongoDB Extension before installing the PHP Library for MongoDB. It is worth noting, that full MongoDB driver experience is provided by installing both the low-level extension (which integrates with our C driver) and high-level library, which is written in PHP.&lt;/p&gt;

&lt;p&gt;But to make windows terminal look beauty we need to add a theme, so lets start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Install PECL&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install pecl
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install pcre2&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install pcre2
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tutorial
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Install mongodb extension&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pecl &lt;span class="nb"&gt;install &lt;/span&gt;mongodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enabled extension on PHP.ini&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;extension&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;mongodb.so
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To verify installation.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php -i | grep mongodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You shoul see output.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ php -i|grep mongo
mongodb
libmongoc bundled version =&amp;gt; 1.17.2
libmongoc SSL =&amp;gt; enabled
libmongoc SSL library =&amp;gt; Secure Transport
libmongoc crypto =&amp;gt; enabled
libmongoc crypto library =&amp;gt; Common Crypto
libmongoc crypto system profile =&amp;gt; disabled
libmongoc SASL =&amp;gt; enabled
libmongoc ICU =&amp;gt; disabled
libmongoc compression =&amp;gt; enabled
libmongoc compression snappy =&amp;gt; enabled
libmongoc compression zlib =&amp;gt; enabled
libmongoc compression zstd =&amp;gt; enabled
libmongocrypt bundled version =&amp;gt; 1.0.4
libmongocrypt crypto =&amp;gt; enabled
libmongocrypt crypto library =&amp;gt; Common Crypto
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Error
&lt;/h2&gt;

&lt;p&gt;When error appear.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy pcre2 to your php dir
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  cp /opt/homebrew/Cellar/pcre2/10.xxxx/include/pcre2.h /opt/homebrew/Cellar/php@7.xxx/7.xxx/include/php/ext/pcre/pcre2.h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;notes Change pcre2 version &amp;amp; php version with your local machine version.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo pecl install mongodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It should fix your error.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Source
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; &lt;a href="https://stackoverflow.com/questions/66496119/pecl-fails-installing-mongodb-driver-on-apple-silicon-m1" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/66496119/pecl-fails-installing-mongodb-driver-on-apple-silicon-m1&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://www.mongodb.com/developer/quickstart/php-setup/" rel="noopener noreferrer"&gt;https://www.mongodb.com/developer/quickstart/php-setup/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mongodb</category>
      <category>php</category>
      <category>macos</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Install MYSQL on Ubuntu server 18.04</title>
      <dc:creator>ilhamsabir</dc:creator>
      <pubDate>Tue, 18 Jan 2022 02:49:30 +0000</pubDate>
      <link>https://forem.com/ilhamsabir/install-mysql-on-ubuntu-server-1804-47bg</link>
      <guid>https://forem.com/ilhamsabir/install-mysql-on-ubuntu-server-1804-47bg</guid>
      <description>&lt;h1&gt;
  
  
  Install MYSQL on Ubuntu server 18.04
&lt;/h1&gt;

&lt;p&gt;MySQL is an open-source database management system, commonly installed as part of the popular LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack. It uses a relational database and SQL (Structured Query Language) to manage its data.&lt;/p&gt;

&lt;p&gt;The short version of the installation is simple: update your package index, install the mysql-server package, and then run the included security script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;To follow this tutorial you will need:&lt;br&gt;
    - One Ubuntu 18.04 server set up by following this initial server setup guide, including a non-root user with sudo privileges and a firewall.&lt;/p&gt;
&lt;h2&gt;
  
  
  Installing MySQL
&lt;/h2&gt;

&lt;p&gt;To install it, update the package index on your server with apt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then install the default package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install mysql-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will install MySQL, but will not prompt you to set a password or make any other configuration changes. Because this leaves your installation of MySQL insecure, we will address this next.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring MySQL
&lt;/h2&gt;

&lt;p&gt;For fresh installations, you’ll want to run the included security script. This changes some of the less secure default options for things like remote root logins and sample users. On older versions of MySQL, you needed to initialize the data directory manually as well, but this is done automatically now.&lt;/p&gt;

&lt;p&gt;Run the security script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will take you through a series of prompts where you can make some changes to your MySQL installation’s security options. The first prompt will ask whether you’d like to set up the Validate Password Plugin, which can be used to test the strength of your MySQL password. Regardless of your choice, the next prompt will be to set a password for the MySQL root user. Enter and then confirm a secure password of your choice.&lt;/p&gt;

&lt;p&gt;Note that even though you’ve set a password for the root MySQL user, this user is not configured to authenticate with a password when connecting to the MySQL shell. If you’d like, you can adjust this setting by following Step 3.&lt;/p&gt;

&lt;p&gt;Regardless of how you installed it, MySQL should have started running automatically. To test this, check its status.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl status mysql.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you’ll see output similar to the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
   Active: active (running) since Wed 2018-04-23 21:21:25 UTC; 30min ago
 Main PID: 3754 (mysqld)
    Tasks: 28
   Memory: 142.3M
      CPU: 1.994s
   CGroup: /system.slice/mysql.service
           └─3754 /usr/sbin/mysqld
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How To Allow Remote Access to MySQL
&lt;/h2&gt;

&lt;p&gt;One of the more common problems that users run into when trying to set up a remote MySQL database is that their MySQL instance is only configured to listen for local connections. This is MySQL’s default setting, but it won’t work for a remote database setup since MySQL must be able to listen for an external IP address where the server can be reached. To enable this, open up your mysqld.cnf file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate to the line that begins with the bind-address directive. It will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;. . .
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1
. . .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default, this value is set to 127.0.0.1, meaning that the server will only look for local connections. You will need to change this directive to reference an external IP address. For the purposes of troubleshooting, you could set this directive to a wildcard IP address, either *, ::, or 0.0.0.0:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;. . .
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 0.0.0.0
. . .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then restart the MySQL service to put the changes you made to mysqld.cnf into effect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have an existing MySQL user account which you plan to use to connect to the database from your remote host, you’ll need to reconfigure that account to connect from the remote server instead of localhost. To do so, open up the MySQL client as your root MySQL user or with another privileged user account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create user for remotely server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE USER 'user_name'@'%' IDENTIFIED BY 'password';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'%' WITH GRANT OPTION;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now user for accessing remotely db server is on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Allow UFW
&lt;/h2&gt;

&lt;p&gt;Lastly, assuming you’ve configured a firewall on your database server, you will also need to open port 3306 — MySQL’s default port — to allow traffic to MySQL.&lt;br&gt;
If you only plan to access the database server from one specific machine, you can grant that machine exclusive permission to connect to the database remotely with the following command. Make sure to replace remote_IP_address with the actual IP address of the machine you plan to connect with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw allow from remote_IP_address to any port 3306
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw allow 3306
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now access your mysql server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mysql -u user -h database_server_ip -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or use apps like HeidiSQL, SequelPro, Navicat , Workbeanch , etc.&lt;/p&gt;

</description>
      <category>mysql</category>
      <category>devops</category>
      <category>webdev</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Setup NGINX For Load Balancer</title>
      <dc:creator>ilhamsabir</dc:creator>
      <pubDate>Thu, 06 Jan 2022 03:24:15 +0000</pubDate>
      <link>https://forem.com/ilhamsabir/setup-nginx-for-load-balancer-4iih</link>
      <guid>https://forem.com/ilhamsabir/setup-nginx-for-load-balancer-4iih</guid>
      <description>&lt;h1&gt;
  
  
  Setup Nginx Load Balancing
&lt;/h1&gt;

&lt;p&gt;Loadbalancing is a useful mechanism to distribute incoming traffic around several capable Virtual Private servers.By apportioning the processing mechanism to several machines, redundancy is provided to the application -- ensuring fault tolerance and heightened stability. The Round Robin algorithm for load balancing sends visitors to one of a set of IPs. At its most basic level Round Robin, which is fairly easy to implement, distributes server load without implementing considering more nuanced factors like server response time and the visitors’ geographic region.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;The steps in this tutorial require the user to have root privileges on your VPS. You can see how to set that up in the Users Tutorial.&lt;/p&gt;

&lt;p&gt;Prior to setting up nginx loadbalancing, you should have nginx installed on your VPS. You can install it quickly with apt-get:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Upstream Module
&lt;/h2&gt;

&lt;p&gt;In order to set up a round robin load balancer, we will need to use the nginx upstream module. We will incorporate the configuration into the nginx settings.&lt;/p&gt;

&lt;p&gt;Go ahead and open up your website’s configuration (in my examples I will just work off of the generic default virtual host):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/nginx/sites-available/default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We need to add the load balancing configuration to the file.&lt;/p&gt;

&lt;p&gt;First we need to include the upstream module which looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Define which servers to include in the load balancing scheme.&lt;/span&gt;
&lt;span class="c1"&gt;# It's best to use the servers' private IPs for better performance and security.&lt;/span&gt;
&lt;span class="c1"&gt;# You can find the private IPs at your UpCloud control panel Network section.&lt;/span&gt;
&lt;span class="k"&gt;http&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="kn"&gt;upstream&lt;/span&gt; &lt;span class="s"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="s"&gt;domain-1.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="s"&gt;domain-2.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="s"&gt;domain-3.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;# This server accepts all traffic to port 80 and passes it to the upstream.&lt;/span&gt;
   &lt;span class="c1"&gt;# Notice that the upstream name and the proxy_pass need to match.&lt;/span&gt;
   &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;# Add this if use HTTPS&lt;/span&gt;
        &lt;span class="kn"&gt;listen&lt;/span&gt;              &lt;span class="mi"&gt;443&lt;/span&gt; &lt;span class="s"&gt;ssl&lt;/span&gt; &lt;span class="s"&gt;default_server&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;listen&lt;/span&gt;              &lt;span class="s"&gt;[::]:443&lt;/span&gt; &lt;span class="s"&gt;ssl&lt;/span&gt; &lt;span class="s"&gt;default_server&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;server_name&lt;/span&gt;  &lt;span class="s"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;ssl_certificate&lt;/span&gt; &lt;span class="n"&gt;/etc/ssl/certs/nginx-selfsigned.crt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;ssl_certificate_key&lt;/span&gt; &lt;span class="n"&gt;/etc/ssl/private/nginx-selfsigned.key&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kn"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://server&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Upgrade&lt;/span&gt; &lt;span class="nv"&gt;$http_upgrade&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Connection&lt;/span&gt; &lt;span class="s"&gt;"Upgrade"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Host&lt;/span&gt;            &lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Real-IP&lt;/span&gt;       &lt;span class="nv"&gt;$proxy_protocol_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Forwarded-For&lt;/span&gt; &lt;span class="nv"&gt;$proxy_protocol_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="c1"&gt;# Very important, controls proxied websocket connection timeout&lt;/span&gt;
            &lt;span class="kn"&gt;proxy_read_timeout&lt;/span&gt; &lt;span class="s"&gt;600s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart nginx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service nginx restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Load balancing methods
&lt;/h2&gt;

&lt;p&gt;Load balancing with nginx uses a round-robin algorithm by default if no other method is defined, like in the first example above. With round-robin scheme each server is selected in turns according to the order you set them in the load-balancer.conf file. This balances the number of requests equally for short operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Least Connection
&lt;/h2&gt;

&lt;p&gt;Least connections based load balancing is another straightforward method. As the name suggests, this method directs the requests to the server with the least active connections at that time. It works more fairly than round-robin would with applications where requests might sometimes take longer to complete.&lt;/p&gt;

&lt;p&gt;To enable least connections balancing method, add the parameter least_conn to your upstream section as shown in the example below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;upstream backend {
   least_conn;
   server 10.1.0.101;
   server 10.1.0.102;
   server 10.1.0.103;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Weight
&lt;/h2&gt;

&lt;p&gt;One way to begin to allocate users to servers with more precision is to allocate specific weight to certain machines. Nginx allows us to assign a number specifying the proportion of traffic that should be directed to each server.&lt;/p&gt;

&lt;p&gt;A load balanced setup that included server weight could look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;upstream backend  {
  server backend1.example.com weight=1;
  server backend2.example.com weight=2;
  server backend3.example.com weight=4;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Hash
&lt;/h2&gt;

&lt;p&gt;IP hash allows servers to respond to clients according to their IP address, sending visitors back to the same VPS each time they visit (unless that server is down). If a server is known to be inactive, it should be marked as down. All IPs that were supposed to routed to the down server are then directed to an alternate one.&lt;/p&gt;

&lt;p&gt;The configuration below provides an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;upstream backend {
  ip_hash;
  server   backend1.example.com;
  server   backend2.example.com;
  server   backend3.example.com  down;
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Max Fails
&lt;/h2&gt;

&lt;p&gt;According to the default round robin settings, nginx will continue to send data to the virtual private servers, even if the servers are not responding. Max fails can automatically prevent this by rendering unresponsive servers inoperative for a set amount of time.&lt;/p&gt;

&lt;p&gt;There are two factors associated with the max fails: max_fails and fall_timeout. Max fails refers to the maximum number of failed attempts to connect to a server should occur before it is considered inactive. Fall_timeout specifies the length of that the server is considered inoperative. Once the time expires, new attempts to reach the server will start up again. The default timeout value is 10 seconds.&lt;/p&gt;

&lt;p&gt;A sample configuration might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;upstream backend  {
  server backend1.example.com max_fails=3  fail_timeout=15s;
  server backend2.example.com weight=2;
  server backend3.example.com weight=4;
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>devops</category>
      <category>webdev</category>
      <category>nginx</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Create Simple EC2 Instance Using Terraform AWS</title>
      <dc:creator>ilhamsabir</dc:creator>
      <pubDate>Mon, 08 Nov 2021 03:44:46 +0000</pubDate>
      <link>https://forem.com/ilhamsabir/init-terraform-aws-ec2-91k</link>
      <guid>https://forem.com/ilhamsabir/init-terraform-aws-ec2-91k</guid>
      <description>&lt;p&gt;Terraform is an open-source infrastructure as code software tool that enables you to safely and predictably create, change, and improve infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;To follow this tutorial you will need:&lt;br&gt;
    - The &lt;a href="https://learn.hashicorp.com/tutorials/terraform/install-cli?in=terraform/aws-get-started" rel="noopener noreferrer"&gt;Terraform CLI (0.14.9+)&lt;/a&gt; installed.&lt;br&gt;
    - The &lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html" rel="noopener noreferrer"&gt;AWS CLI&lt;/a&gt; installed.&lt;br&gt;
    - An AWS account.&lt;br&gt;
    - Your AWS credentials. &lt;a href="https://console.aws.amazon.com/iam/home?#/security_credentials" rel="noopener noreferrer"&gt;You can create a new Access Key on this page&lt;/a&gt;.&lt;br&gt;
    - Create "Key Pair" on your AWS instances and save .pem file&lt;/p&gt;
&lt;h3&gt;
  
  
  Configure AWS Account
&lt;/h3&gt;

&lt;p&gt;The AWS CLI supports using any of multiple named profiles that are stored in the config and credentials files. You can configure additional profiles by using aws configure with the --profile option, or by adding entries to the config and credentials files.&lt;/p&gt;

&lt;p&gt;The following example shows a credentials file with two profiles. The first [default] is used when you run a AWS CLI command with no profile. The second is used when you run a AWS CLI command with the --profile user1 parameter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    ~/.aws/credentials (Linux &amp;amp; Mac) or %USERPROFILE%\.aws\credentials (Windows)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit your aws credentials&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[default]
aws_access_key_id=AKIAIOSFODNN7EXAMPLE
aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

[user1]
aws_access_key_id=AKIAI44QH8DHBEXAMPLE
aws_secret_access_key=je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit your aws config&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[default]
region=us-west-2
output=json

[profile user1]
region=us-east-1
output=text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Initialize Terraform
&lt;/h3&gt;

&lt;p&gt;Create directory for your configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;learn-terraform-aws-instance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change into directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd learn-terraform-aws-instance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create terraform file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch main.tf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open main.tf in your text editor, paste in the configuration below, and save the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~&amp;gt; 3.27"
    }
  }
}

### Provider
provider "aws" {
  profile = "your_aws_config_profile"
  region  =  "ap-southeast-1"
}

### ECS Security Group - ALB -&amp;gt; ECS, SSH -&amp;gt; ECS
resource "aws_security_group" "ecs_service_sg" {
  name        = "ecs_service_sg"
  description = "Allow HTTP, HTTPS and SSH traffic"

  ingress {
    description = "SSH"
    from_port   = 22
    to_port     = 22
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }

  ingress {
    description = "HTTPS"
    from_port   = 443
    to_port     = 443
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }

  ingress {
    description = "HTTP"
    from_port   = 80
    to_port     = 80
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }

  egress {
    from_port   = 0
    to_port     = 0
    protocol    = "-1"
    cidr_blocks = ["0.0.0.0/0"]
  }

  tags = {
    Name = "global-ecs-service-sg-tf"
  }
}

### EC Instance
resource "aws_instance" "sample_instance_name" {
  ### Ami for ubuntu 18.x.x
  ami           = "ami-0907c2c44ea451f84"
  instance_type = "t2.micro"
  key_name      = "your_key_pair_name"

  ### Get From aws_security_group
  vpc_security_group_ids = [
    aws_security_group.ecs_service_sg.id
  ]

  tags = {
    Name = "SampleTagYourInstanceName"
  }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Initialize your terraform project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deploy terraform&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Destroy terraform&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform destroy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change Terraform infrastructure&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change your configuration on your .tf file  &amp;amp; saved it.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Reinit terraform&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform init
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Re apply&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your prev infrastructure will destroy , and terraform create the new one.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now Yout instance have been created, check your aws instance dashboard&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To access your instance use SSH , from your key pair&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Access Via SSH
&lt;/h3&gt;

&lt;p&gt;Linux &amp;amp; MacOS usage&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open an SSH client.&lt;/li&gt;
&lt;li&gt;Locate your private key file. The key used to launch this instance is your_key.pem&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run this command, if necessary, to ensure your key is not publicly viewable.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod 400 your_key.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Connect to your instance using its Public DNS:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;your_public_ip4_dns or public_ip4_ip_address
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sample access.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    ssh -i "your_key.pem" ubuntu@your_public_ip4_dns
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Windows usage&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download Termius&lt;/li&gt;
&lt;li&gt;Create new host&lt;/li&gt;
&lt;li&gt;Paste your_public_ip4_dns to "address"&lt;/li&gt;
&lt;li&gt;Load your_key.pem&lt;/li&gt;
&lt;li&gt;And Connect.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Notes
&lt;/h2&gt;

&lt;p&gt;Source:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html" rel="noopener noreferrer"&gt;Aws change config&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.hashicorp.com/tutorials/terraform/aws-change?in=terraform/aws-get-started" rel="noopener noreferrer"&gt;Terraform Build&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>devops</category>
      <category>aws</category>
      <category>terraform</category>
    </item>
    <item>
      <title>4 Mistakes I Made as a Programmer, but I Had To Become a CTO To See Them</title>
      <dc:creator>ilhamsabir</dc:creator>
      <pubDate>Fri, 11 Jun 2021 03:00:18 +0000</pubDate>
      <link>https://forem.com/ilhamsabir/4-mistakes-i-made-as-a-programmer-but-i-had-to-become-a-cto-to-see-them-3jj3</link>
      <guid>https://forem.com/ilhamsabir/4-mistakes-i-made-as-a-programmer-but-i-had-to-become-a-cto-to-see-them-3jj3</guid>
      <description>&lt;p&gt;Original POST&lt;br&gt;
&lt;a href="https://betterprogramming.pub/4-mistakes-i-made-as-a-programmer-but-i-had-to-become-a-cto-to-see-them-19a41ba70411" rel="noopener noreferrer"&gt;https://betterprogramming.pub/4-mistakes-i-made-as-a-programmer-but-i-had-to-become-a-cto-to-see-them-19a41ba70411&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Windows 10 Nginx + PHP</title>
      <dc:creator>ilhamsabir</dc:creator>
      <pubDate>Wed, 24 Mar 2021 00:51:16 +0000</pubDate>
      <link>https://forem.com/ilhamsabir/windows-10-nginx-php-2oef</link>
      <guid>https://forem.com/ilhamsabir/windows-10-nginx-php-2oef</guid>
      <description>&lt;p&gt;NGINX can interface with PHP on Windows via a FastCGI daemon, which ships with PHP: php-cgi.exe. You need to run php-cgi.exe -b 127.0.0.1: and use fastcgi_pass 127.0.0.1:; in the NGINX configuration file. After being launched, php-cgi.exe will keep listening for connections in a command prompt window. To hide that window, use the tiny utility &lt;a href="https://redmine.lighttpd.net/attachments/660/RunHiddenConsole.zip" rel="noopener noreferrer"&gt;RunHiddenConsole&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  First
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Download &lt;a href="http://nginx.org/en/download.html" rel="noopener noreferrer"&gt;nginx&lt;/a&gt;, choose stable version.&lt;/li&gt;
&lt;li&gt;Download &lt;a href="https://windows.php.net/download#php-8.0" rel="noopener noreferrer"&gt;PHP&lt;/a&gt;, choose non stable version.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Second
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Extract nginx to "C:\nginx"&lt;/li&gt;
&lt;li&gt;Extract php to "C:\php"&lt;/li&gt;
&lt;li&gt;Create folder "www" in your "C" system , "C:\www"&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Third
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Edit your nginx.conf at "C:\nginx\conf\nginx.conf"&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Change root&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    root c:/www&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Save nginx.conf&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open yout php folder, find php-ini-development&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edit your php-ini-development, like down below.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    extension_dir &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ext"&lt;/span&gt; 
    enable_dl &lt;span class="o"&gt;=&lt;/span&gt; On 
    cgi.force_redirect &lt;span class="o"&gt;=&lt;/span&gt; 1 
    fastcgi.impersonate &lt;span class="o"&gt;=&lt;/span&gt; 1 
    cgi.rfc2616_headers &lt;span class="o"&gt;=&lt;/span&gt; 1 
    &lt;span class="nv"&gt;extension&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;php_gd2.dll 
    &lt;span class="nv"&gt;extension&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;php_mbstring.dll 
    &lt;span class="nv"&gt;extension&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;php_exif.dll 
    &lt;span class="nv"&gt;extension&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;php_mysql.dll 
    &lt;span class="nv"&gt;extension&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;php_mysqli.dll 
    &lt;span class="nv"&gt;extension&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;php_pdo_mysql.dll 
    date.timezone &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Asia/Jakarta"&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Save it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open your nginx.conf again&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Uncoment on php configuration and change to this&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="c"&gt;# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9999&lt;/span&gt;
    location ~ &lt;span class="se"&gt;\.&lt;/span&gt;php&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
        fastcgi_pass   127.0.0.1:9999&lt;span class="p"&gt;;&lt;/span&gt;
        fastcgi_index  index.php&lt;span class="p"&gt;;&lt;/span&gt;
        fastcgi_param  SCRIPT_FILENAME  &lt;span class="nv"&gt;$document_root$fastcgi_script_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        include        fastcgi_params&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Save nginx.conf again.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Fourth
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Set Php path&lt;/li&gt;
&lt;li&gt;Open your environment variable

&lt;ul&gt;
&lt;li&gt;Open "edit the system environment variables"&lt;/li&gt;
&lt;li&gt;Click, "Environtment variables ..."
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsxcxqhrg0f2q4s81lndm.jpg" alt="Alt Text" width="492" height="528"&gt;
&lt;/li&gt;
&lt;li&gt;Edit "path" on "Sytem ariables"
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewvzvvqzx7dcyygxqpqy.jpg" alt="Alt Text" width="691" height="660"&gt;
&lt;/li&gt;
&lt;li&gt;Add new path "C:\php"
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffqz9s45oajvo94finjzk.jpg" alt="Alt Text" width="581" height="555"&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create nginx start, stop &amp;amp; restart .bat
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Download &lt;a href="https://redmine.lighttpd.net/attachments/660/RunHiddenConsole.zip" rel="noopener noreferrer"&gt;RunHiddenConsole&lt;/a&gt; first, and move RunHiddenConsole.exe to "C:\".&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create file "nginx-start.bat", edit file with down below, make your php-cgi.exe port same as in nginx.conf&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    @ECHO OFF

    ECHO Starting PHP FastCGI...
    C:&lt;span class="se"&gt;\R&lt;/span&gt;unHiddenConsole.exe C:&lt;span class="se"&gt;\p&lt;/span&gt;hp8&lt;span class="se"&gt;\p&lt;/span&gt;hp-cgi.exe &lt;span class="nt"&gt;-b&lt;/span&gt; 127.0.0.1:9999

    ECHO Starting NGINX
    start nginx.exe

    &lt;span class="nb"&gt;popd
    &lt;/span&gt;EXIT /b
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create file "nginx-stop.bat", edit with this&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    @ECHO OFF
    taskkill /f /IM nginx.exe
    taskkill /f /IM php-cgi.exe
    EXIT /b
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create file "nginx-restart.bat"&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    @ECHO OFF
    call nginx-stop.bat
    call nginx-start.bat
    EXIT /b
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Test
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Doble click on "nginx-start.bat"&lt;/li&gt;
&lt;li&gt;Open your browser if every thing work you can see like this
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcg5w6pa0xdu6z0xzkye3.jpg" alt="Alt Text" width="800" height="278"&gt;
&lt;/li&gt;
&lt;li&gt;Create folder like "test-php" in "C:\www"&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create file "index.php"&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt; &lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="nb"&gt;phpinfo&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open your browser and go to "localhost/test-php"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If every thing ok you can see&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdzk5u21rmuormk4ymm3v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdzk5u21rmuormk4ymm3v.jpg" alt="Alt Text" width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;At the end , nginx php now working.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Notes:&lt;br&gt;
Sometimes , nginx &amp;amp; php cannot working properly if your run with nginx-start.bat&lt;br&gt;
so you need to run php manually&lt;br&gt;
open your terminal, run your php "php-cgi -b 127.0.0.1:9999"&lt;br&gt;
and now your nginx &amp;amp; php work properly&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>php</category>
      <category>programming</category>
      <category>nginx</category>
      <category>devops</category>
    </item>
    <item>
      <title>Change Windows Terminal Theme</title>
      <dc:creator>ilhamsabir</dc:creator>
      <pubDate>Mon, 22 Mar 2021 06:29:57 +0000</pubDate>
      <link>https://forem.com/ilhamsabir/change-windows-terminal-theme-49l7</link>
      <guid>https://forem.com/ilhamsabir/change-windows-terminal-theme-49l7</guid>
      <description>&lt;p&gt;The Windows Terminal is a modern, fast, efficient, powerful, and productive terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and WSL. Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and custom themes, styles, and configurations.&lt;/p&gt;

&lt;p&gt;But to make windows terminal look beauty we need to add a theme, so lets start.&lt;/p&gt;

&lt;h3&gt;
  
  
  #First
&lt;/h3&gt;

&lt;p&gt;Install &lt;strong&gt;Windows Terminal&lt;/strong&gt; from Microsoft Store, &lt;a href="http://https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab" rel="noopener noreferrer"&gt;Go to Store&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  #Second
&lt;/h3&gt;

&lt;p&gt;Install &lt;strong&gt;Install Modules Oh-my-Posh&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; Install-Module posh-git &lt;span class="nt"&gt;-Scope&lt;/span&gt; CurrentUser
 Install-Module oh-my-posh &lt;span class="nt"&gt;-Scope&lt;/span&gt; CurrentUser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  #Third
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Create *&lt;em&gt;Powershell Profile *&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; // use vscode
 code $PROFILE
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add this on your profile&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Import-Module posh-git
 Import-Module oh-my-posh
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Import theme, to pick a theme check &lt;a href="https://github.com/JanDeDobbeleer/oh-my-posh#themes" rel="noopener noreferrer"&gt;here&lt;/a&gt;, after that import on your profile&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; Import-Module posh-git
 Import-Module oh-my-posh

 &lt;span class="c"&gt;# your theme&lt;/span&gt;
 Set-PoshPrompt &lt;span class="nt"&gt;-Theme&lt;/span&gt; paradox

&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  #Fourth
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Customize your windows terminal color, open your terminal , and click setting.
&lt;a href="https://miro.medium.com/max/700/1*ZK9pkVr5MswTi-NwT0K20Q.png" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdtfxwm0jnp1pjd4bd2ft.png" width="700" height="397"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add this style object on "schemes"&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="s2"&gt;"schemes"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"name"&lt;/span&gt;: &lt;span class="s2"&gt;"CustomeTheme"&lt;/span&gt;,
        &lt;span class="s2"&gt;"black"&lt;/span&gt;: &lt;span class="s2"&gt;"#7d8b8f"&lt;/span&gt;,
        &lt;span class="s2"&gt;"red"&lt;/span&gt;: &lt;span class="s2"&gt;"#b23a52"&lt;/span&gt;,
        &lt;span class="s2"&gt;"green"&lt;/span&gt;: &lt;span class="s2"&gt;"#789b6a"&lt;/span&gt;,
        &lt;span class="s2"&gt;"yellow"&lt;/span&gt;: &lt;span class="s2"&gt;"#b9ac4a"&lt;/span&gt;,
        &lt;span class="s2"&gt;"blue"&lt;/span&gt;: &lt;span class="s2"&gt;"#225a79"&lt;/span&gt;,
        &lt;span class="s2"&gt;"purple"&lt;/span&gt;: &lt;span class="s2"&gt;"#bd4f5a"&lt;/span&gt;,
        &lt;span class="s2"&gt;"cyan"&lt;/span&gt;: &lt;span class="s2"&gt;"#2b7c71"&lt;/span&gt;,
        &lt;span class="s2"&gt;"white"&lt;/span&gt;: &lt;span class="s2"&gt;"#d2d8d9"&lt;/span&gt;,
        &lt;span class="s2"&gt;"brightBlack"&lt;/span&gt;: &lt;span class="s2"&gt;"#888888"&lt;/span&gt;,
        &lt;span class="s2"&gt;"brightRed"&lt;/span&gt;: &lt;span class="s2"&gt;"#f24840"&lt;/span&gt;,
        &lt;span class="s2"&gt;"brightGreen"&lt;/span&gt;: &lt;span class="s2"&gt;"#80c470"&lt;/span&gt;,
        &lt;span class="s2"&gt;"brightYellow"&lt;/span&gt;: &lt;span class="s2"&gt;"#ffeb62"&lt;/span&gt;,
        &lt;span class="s2"&gt;"brightBlue"&lt;/span&gt;: &lt;span class="s2"&gt;"#4196ff"&lt;/span&gt;,
        &lt;span class="s2"&gt;"brightPurple"&lt;/span&gt;: &lt;span class="s2"&gt;"#fc5275"&lt;/span&gt;,
        &lt;span class="s2"&gt;"brightCyan"&lt;/span&gt;: &lt;span class="s2"&gt;"#53cdbd"&lt;/span&gt;,
        &lt;span class="s2"&gt;"brightWhite"&lt;/span&gt;: &lt;span class="s2"&gt;"#d2d8d9"&lt;/span&gt;,
        &lt;span class="s2"&gt;"background"&lt;/span&gt;: &lt;span class="s2"&gt;"#2b2d2e"&lt;/span&gt;,
        &lt;span class="s2"&gt;"foreground"&lt;/span&gt;: &lt;span class="s2"&gt;"#d2d8d9"&lt;/span&gt;,
        &lt;span class="s2"&gt;"selectionBackground"&lt;/span&gt;: &lt;span class="s2"&gt;"#e4e8ed"&lt;/span&gt;,
        &lt;span class="s2"&gt;"cursorColor"&lt;/span&gt;: &lt;span class="s2"&gt;"#708284"&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;]&lt;/span&gt;,
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On list , add that theme&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="s2"&gt;"list"&lt;/span&gt;:
    &lt;span class="o"&gt;[&lt;/span&gt;
        &lt;span class="o"&gt;{&lt;/span&gt;
            // Make changes here to the powershell.exe profile.
            &lt;span class="s2"&gt;"guid"&lt;/span&gt;: &lt;span class="s2"&gt;"{61c54bbd-c2c6-5271-96e7-009a87ff44bf}"&lt;/span&gt;,
            &lt;span class="s2"&gt;"name"&lt;/span&gt;: &lt;span class="s2"&gt;"Windows PowerShell"&lt;/span&gt;,
            &lt;span class="s2"&gt;"commandline"&lt;/span&gt;: &lt;span class="s2"&gt;"powershell.exe"&lt;/span&gt;,
            &lt;span class="s2"&gt;"hidden"&lt;/span&gt;: &lt;span class="nb"&gt;false&lt;/span&gt;,
            &lt;span class="s2"&gt;"fontFace"&lt;/span&gt;: &lt;span class="s2"&gt;"Fira Code"&lt;/span&gt;,
            &lt;span class="s2"&gt;"fontSize"&lt;/span&gt;: 9,
            &lt;span class="s2"&gt;"colorScheme"&lt;/span&gt;: &lt;span class="s2"&gt;"CustomeTheme"&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;,
        &lt;span class="o"&gt;{&lt;/span&gt;
            // Make changes here to the cmd.exe profile.
            &lt;span class="s2"&gt;"guid"&lt;/span&gt;: &lt;span class="s2"&gt;"{0caa0dad-35be-5f56-a8ff-afceeeaa6101}"&lt;/span&gt;,
            &lt;span class="s2"&gt;"name"&lt;/span&gt;: &lt;span class="s2"&gt;"Command Prompt"&lt;/span&gt;,
            &lt;span class="s2"&gt;"commandline"&lt;/span&gt;: &lt;span class="s2"&gt;"cmd.exe"&lt;/span&gt;,
            &lt;span class="s2"&gt;"hidden"&lt;/span&gt;: &lt;span class="nb"&gt;false&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;,
        &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"guid"&lt;/span&gt;: &lt;span class="s2"&gt;"{b453ae62-4e3d-5e58-b989-0a998ec441b8}"&lt;/span&gt;,
            &lt;span class="s2"&gt;"hidden"&lt;/span&gt;: &lt;span class="nb"&gt;false&lt;/span&gt;,
            &lt;span class="s2"&gt;"name"&lt;/span&gt;: &lt;span class="s2"&gt;"Azure Cloud Shell"&lt;/span&gt;,
            &lt;span class="s2"&gt;"source"&lt;/span&gt;: &lt;span class="s2"&gt;"Windows.Terminal.Azure"&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Save it, and reload your terminal&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Notes
&lt;/h3&gt;

&lt;p&gt;You can change your theme color, by open&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; $Home\[My ]Documents\WindowsPowerShell\Modules\oh-my-posh\3.118.0\themes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Select your active theme and edit that json.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
