<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Diyar Parwana on Medium]]></title>
        <description><![CDATA[Stories by Diyar Parwana on Medium]]></description>
        <link>https://medium.com/@diyar.parwana?source=rss-3db97932a51d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Kc0Pq7NAHteF3hn55lQAzA.jpeg</url>
            <title>Stories by Diyar Parwana on Medium</title>
            <link>https://medium.com/@diyar.parwana?source=rss-3db97932a51d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:24:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@diyar.parwana/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Nginx and PHP 8.3 on EC2 AWS & DigitalOcean (digitalocean.se)]]></title>
            <link>https://medium.com/@diyar.parwana/nginx-and-php-8-3-on-ec2-aws-digitalocean-digitalocean-se-1d49c45ca6ad?source=rss-3db97932a51d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d49c45ca6ad</guid>
            <category><![CDATA[ufw]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[digitalocean]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[nginx]]></category>
            <dc:creator><![CDATA[Diyar Parwana]]></dc:creator>
            <pubDate>Sat, 15 Feb 2025 22:36:18 GMT</pubDate>
            <atom:updated>2025-02-22T07:17:29.790Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide will help you set up a linux webserver for production, install Nginx, PHP, and configure your server on AWS EC2 and DigitalOcean. I allways will avoid using the root user and instead create a new user with less privileges.</p><h3><strong>Create a New User</strong></h3><blockquote><em>adduser ubuntu<br>usermod -aG sudo ubuntu<br>rsync — archive — chown=ubuntu:ubuntu ~/.ssh /home/ubuntu</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*8AixeEsGXjOpCT2JukbnsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*8AixeEsGXjOpCT2JukbnsQ.png" /></figure><h3><strong>Install Nginx and PHP</strong></h3><p>Update your machine</p><blockquote><strong>sudo apt-get update</strong></blockquote><p>Install Nginx</p><blockquote>s<strong>udo apt-get install nginx -y</strong></blockquote><p>Install PHP-FPM and MySQL extension</p><blockquote><strong>sudo apt-get install php-fpm php-mysql -y</strong></blockquote><p>Verify Nginx configuration</p><blockquote><strong>sudo nginx -t</strong></blockquote><p>Check PHP-FPM service</p><blockquote>sudo systemctl status php8.3-fpm</blockquote><p>Start PHP-FPM (if not running)</p><blockquote>sudo systemctl status php8.3-fpm</blockquote><h3>Install PHP Extensions</h3><p>Add the Ondrej Sury PPA (for latest PHP versions)<br>Good for curl</p><blockquote><strong>sudo add-apt-repository ppa:ondrej/php -y<br>sudo apt-get update</strong></blockquote><p>Install PHP-CURL</p><blockquote><strong>sudo apt install php-curl -y</strong></blockquote><p>Update the package list again</p><blockquote><strong>sudo apt-get update</strong></blockquote><p>Restart PHP-FPM and Nginx</p><blockquote><strong>sudo systemctl restart php8.3-fpm<br>sudo systemctl restart nginx</strong></blockquote><h3>Configure Firewall</h3><p><strong>Allow HTTP traffic through UFW (Uncomplicated Firewall)</strong></p><blockquote>sudo ufw allow ‘Nginx HTTP’<br>sudo ufw allow 22</blockquote><p><strong>Check firewall status and enable it</strong></p><blockquote><strong>sudo ufw status<br>sudo ufw enable</strong></blockquote><p>Adapt Nginx for PHP</p><p><strong>Open default Nginx configuration file</strong></p><blockquote><strong>sudo nano /etc/nginx/sites-available/default</strong></blockquote><p>Change the existing nginx code with this new code</p><blockquote>server {<br> listen 80;<br> server_name your_domain_or_ip;<br> root /var/www/html;</blockquote><blockquote>index index.php index.html index.htm;</blockquote><blockquote>location / {<br> try_files $uri $uri/ /404.html;<br> }</blockquote><blockquote>error_page 404 /404.html;<br> location = /404.html {<br> internal;<br> }</blockquote><blockquote>location ~ \.php$ {<br> include snippets/fastcgi-php.conf;<br> fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;<br> }</blockquote><blockquote>location ~ /\.ht {<br> deny all;<br> }<br>}</blockquote><p>Save and exit</p><blockquote>Test the configuration, yes do test allways before reloading nginx<br><strong>sudo nginx -t</strong></blockquote><p>Reload Nginx</p><blockquote><strong>sudo systemctl reload nginx</strong></blockquote><p>Have correct File and folder Permissions</p><p><strong>Set the correct ownership and permissions for the web directory</strong></p><blockquote><strong>sudo chown -R www-data:www-data /var/www/html<br>sudo chmod -R 755 /var/www/html<br>sudo chown -R ubuntu:ubuntu /var/www/html</strong></blockquote><p>Nginx + PHP 8.3 setup is now complete! <br>So now you can access your localhost, http://localhost<br>Your files should normaly be in the var/www/html/ a</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d49c45ca6ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nmap (*_*) Network Mapper]]></title>
            <link>https://medium.com/@diyar.parwana/nmap-network-mapper-1a6d4645581b?source=rss-3db97932a51d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a6d4645581b</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[nmap]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[ethical-hacker]]></category>
            <category><![CDATA[commands]]></category>
            <dc:creator><![CDATA[Diyar Parwana]]></dc:creator>
            <pubDate>Tue, 23 Jan 2024 08:46:51 GMT</pubDate>
            <atom:updated>2024-01-23T08:47:09.929Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, Iam going to write some good info about Nmap and I will allso provide a list of linux commands to Install Nmap and commands that are helpfull for knowing when we are working with netowkring.</p><p>Nmap, or the Network Mapper, is like a detective for computer networks. Imagine your computer network as a big city with lots of buildings (devices) connected by streets, in this case network cables. Nmap helps us explore this city and discover what’s happening inside.</p><p>Nmap is like a friendly explorer that knocks on the doors (ports) of these homes and asks, “Hey, what services are you running? Are you open for business?” It then creates a map, telling you which doors are open and what services each home provides.</p><p>But Nmap isn’t just about saying hi. It can also detect the type of <strong>operating system</strong> a computer is using. It’s like Nmap has a special radar to figure out if a computer is a Mac or Windows or a Linux OS</p><p>Comming to good part of Nmap, it can even perform secret-agent moves. It can<strong> sneak around </strong>firewalls and find hidden vulnerabilities, and if we know vulnerabilities, then we can try to fix it and make it hard for anyone try to enter our systems.</p><p>In short, Nmap is a good tool to test our network. With its help, we can use it to ensure what is secure and what is not.</p><h3>How to Install Nmap on Ubuntu:</h3><p>Installing Nmap on Ubuntu is a easy. Follow these simple steps:</p><ol><li>Open Terminal and type these commands</li></ol><p><strong>sudo apt update <br>sudo apt install nmap</strong></p><p>2. Verify Installation:</p><p>After the installation completes, type nmap --version and press Enter. <br>You should see information about the installed Nmap version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*5_RNC2bM_S8gXksIHx52Og.png" /></figure><h3>Nmap commands with explanations</h3><p><strong>nmap 192.168.0.1</strong><br>Displaying open ports and services.</p><p><strong>nmap -sn 192.168.0.1:<br></strong>Ping scan to discover live hosts without initiating port scanning.</p><p><strong>nmap -Pn 192.168.0.1:<br></strong>Treat all hosts as online, skipping the host discovery phase.</p><p><strong>nmap -sV 192.168.0.1:<br></strong>Know service versions on open ports.</p><p><strong>nmap — version-intensity 5 192.168.0.1:<br></strong>Increase version detection intensity (0–9).<br>Operating System Detection:</p><p><strong>nmap -O 192.168.0.1:</strong><br>Attempt to identify the operating system of the specified IP address.<br>Aggressive Scanning:</p><p><strong>nmap -A 192.168.0.1:</strong><br>Enable OS detection, version detection, script scanning, and traceroute.<br>Script Scanning:</p><p><strong>nmap — script &lt;script-name&gt; 192.168.0.1:<br></strong>Run a specific Nmap script.</p><p><strong>nmap — script vuln 192.168.0.1:<br></strong>Run scripts that check for common vulnerabilities.<br>Output Options:</p><p><strong>nmap -oN output.txt 192.168.0.1:<br></strong>Save results in normal format to a file.</p><p><strong>nmap -oX output.xml 192.168.0.1:<br></strong>Save results in XML format.</p><p><strong>nmap -oG output.txt 192.168.0.1:<br></strong>Save results in a greppable format.<br>Timing and Performance:</p><p><strong>nmap -T&lt;0–5&gt; 192.168.0.1:<br></strong>Set timing template (0: Paranoid, 5: Insane).</p><p><strong>nmap — min-rate=100 192.168.0.1:<br></strong>Set the minimum, limit scan rate.<br>Firewall Evasion Techniques:</p><p><strong>nmap -f 192.168.0.1:<br></strong>Use fragmented IP packets to bypass packet filters.</p><p><strong>nmap — mtu 24 192.168.0.1:<br></strong>Set the maximum transmission unit for scans.<br>Idle Scan:</p><p><strong>nmap -sI zombie_host 192.168.0.1:</strong><br>Perform an idle scan using a zombie host.<br>Scan a Range of Hosts:</p><p><strong>nmap 192.168.1.1–50:</strong><br>Scan a range of IP addresses.<br>Exclude Hosts from Scan:</p><p><strong>nmap — exclude 192.168.1.5 192.168.0.1:</strong><br>Exclude a specific host from the scan.<br>Customizing Port States:</p><p><strong>nmap — open 192.168.0.1:<br></strong>Show only open ports.</p><p><strong>nmap — unprivileged 192.168.0.1:<br></strong>Show only unprivileged ports.<br>Verbose Output:</p><p><strong>nmap -v 192.168.0.1:</strong><br>Increase verbosity level (up to -vvv).<br>Trace Route:</p><p><strong>nmap — traceroute 192.168.0.1:</strong><br>Perform a traceroute to the specified IP address.<br>Scan IPv6 Addresses:</p><p><strong>nmap -6 192.168.0.1:</strong><br>Perform a scan on IPv6 addresses.<br>Scan using a Proxy:</p><p><strong>nmap — proxy socks4://proxy_host:1080 192.168.0.1:</strong><br>Use a proxy for the scan.<br>List NSE Scripts:</p><p><strong>nmap — script-help &lt;script-name&gt;:</strong><br>Get help for a specific NSE script.<br>Update Nmap Script Database:</p><p><strong>nmap -iL targets.txt:</strong><br>Read target IP addresses from a file.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a6d4645581b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure applications on a Linux server, setting the correct file permissions and ownership.]]></title>
            <link>https://medium.com/@diyar.parwana/secure-applications-on-a-linux-server-setting-the-correct-file-permissions-and-ownership-3c00cc217795?source=rss-3db97932a51d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c00cc217795</guid>
            <dc:creator><![CDATA[Diyar Parwana]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 18:38:01 GMT</pubDate>
            <atom:updated>2024-01-08T18:38:01.019Z</atom:updated>
            <content:encoded><![CDATA[<p>This is crucial for ensuring that your applications runs smoothly while also maintaining security against unauthorized access. <br>So let’s walk through the process using a hypothetical user ‘test’ and a group ‘www-data’, focusing on a website hosted in the directory /var/www/domain.com/.</p><p><strong>Understanding the Basics</strong><br>Before diving into the commands, it’s essential to understand the basics of Linux permissions and ownership. Linux file system permissions are based on three types of access: read, write, and execute. <br>These permissions can be set differently for the file owner, the group members, and others.</p><p><strong>Setting the File Ownership</strong><br>The first step in securing your website is to set the correct ownership. This is where the chown command comes into play. For instance, using chown -R test /var/www/domain.com/ sets the ownership of all files and directories inside /var/www/domain.com/ to the user ‘test’. The -R option makes the command recursive, ensuring that every file and subdirectory within the specified directory is updated.</p><p><strong>Assigning Group Ownership</strong><br>Group ownership allows users within the same group to share access to the files. The command chgrp -R www-data /var/www/domain.com/ assigns the group ‘www-data’ as the group owner of all the files within your website directory. This is particularly useful in a web server environment where multiple users might need access to these files.</p><p><strong>Modifying File Permissions</strong><br>After setting the ownership, the next step is to define the correct permissions. This is where chmod plays a vital role. By executing chmod -R 750 /var/www/domain.com/, you’re setting specific permissions for the user, group, and others. Here, ‘7’ grants the user (test) full read, write, and execute permissions. ‘5’ grants the group (www-data) read and execute permissions, and ‘0’ ensures that others have no permissions.</p><p><strong>Setting Group ID</strong><br>The command chmod g+s /var/www/domain.com/ sets the setgid bit on the directory. This means any new files created within this directory will inherit the group ID of the directory, ensuring that new files have the same group as the parent directory.</p><p><strong>Write Permissions for Group Owner</strong><br>Finally, you may want to give write access to the group owner for specific directories. For instance, chmod g+w /var/www/domain.com/uploads/userid grants write permissions to the group owner (www-data) on the uploads directory. This is crucial for directories where files need to be uploaded or modified by web applications.</p><blockquote><strong>Conclusion</strong><br>By carefully setting ownership and permissions, you ensure that your Linux-hosted website is both functional and secure. Remember, the key is to provide the minimum necessary permissions to reduce the risk of unauthorized access or accidental modifications. With these steps, your website on /var/www/domain.com/ will be well-configured for both performance and security.</blockquote><blockquote>Username is test<br>chown -R test /var/www/domain.com/<br>chgrp -R www-data /var/www/domain.com/<br>chmod -R 750 /var/www/domain.com/<br>chmod g+s /var/www/domain.com/</blockquote><blockquote>Have the write permissions for www-data to have write access<br>chmod g+w /var/www/domain.com/uploads/userid</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c00cc217795" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[nftables for usLinux Administrators — a simple guide]]></title>
            <link>https://medium.com/@diyar.parwana/nftables-for-uslinux-administrators-a-simple-guide-d13c5f0cf40f?source=rss-3db97932a51d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d13c5f0cf40f</guid>
            <category><![CDATA[firewall-security]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[nftables]]></category>
            <category><![CDATA[iptables]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Diyar Parwana]]></dc:creator>
            <pubDate>Tue, 20 Jun 2023 19:43:52 GMT</pubDate>
            <atom:updated>2024-01-24T06:12:54.289Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>nftables for us Linux Administrators — a simple guide</strong></h3><p>When it comes to Linux, <strong>iptables</strong> has long been the trusted services, the robust firewall protecting our systems for years. But time brings change and innovation, and today I will introduce you to nftables, the new King Arthur’s knight in shining armor, all set to replace the age-old iptables.</p><p>Why should you care about nftables? Well, nftables not only encompasses all the features of iptables but goes a step further by introducing new ones that enhance flexibility, efficiency, and simplicity in firewall management. Let’s dive in and see how we can use nftables.</p><h3>Installation and Setup of nftables</h3><p>Setting up nftables is a breeze. Open your terminal and enter the following commands:</p><p><strong>sudo apt update<br>sudo apt install nftables</strong></p><p>These commands ensure your system is up to date before installing nftables.</p><p>To verify if nftables is installed and running, type:</p><p><strong>sudo systemctl status nftables</strong></p><p>If nftables is not running, don’t fret! Just enter the following commands to start it up and enable it to boot at startup:</p><p><strong>sudo systemctl start nftables<br>sudo systemctl enable nftables</strong></p><p>Verify the status once more to ensure everything is working as it should:<br><strong>sudo systemctl status nftables</strong></p><h3>Working with nftables: Creating Rules</h3><p>nftables boasts a robust rule-set that can be tailored to specific needs. For instance, you might want to allow incoming traffic only on specific ports like SSH (port 22). You can easily do this by adding the relevant rule in nftables.</p><p>Let’s see how we can allow only SSH (port 22), HTTP (port 80), and HTTPS (port 443) traffic. Enter the following commands:</p><p><strong>sudo nft add table inet filter<br>sudo nft add chain inet filter input { type filter hook input priority filter \; }<br>sudo nft add chain inet filter forward { type filter hook forward priority filter \; }</strong></p><p><strong>sudo nft add chain inet filter output { type filter hook output priority filter \; }</strong></p><p><strong>sudo nft add rule inet filter input tcp dport 22 accept<br>sudo nft add rule inet filter input tcp dport 80 accept<br>sudo nft add rule inet filter input tcp dport 443 accept</strong></p><blockquote><strong><em>input tcp dport 22 accept, for ccepts incoming TCP traffic on port 22 (SSH).</em></strong></blockquote><blockquote>If the server is not used as router or gateway, we can have the policy drop for it.</blockquote><blockquote><strong>sudo nft add chain inet filter forward { type filter hook forward priority filter \; policy drop \; }</strong></blockquote><h3>Ensuring Rule Persistence</h3><p>It’s great that we have set up some rules, but what about making them persist through system reboots? nftables has got us covered!</p><p>Save the rules to a file, typically /etc/nftables.conf, using the following command:</p><p><strong>sudo nft list ruleset &gt; /etc/nftables.conf<br></strong>Check your ruleset anytime using:</p><p><strong>sudo nft list ruleset</strong></p><p>Your machine’s security is as good as your rules! If you see something like this, you can rest assured that your machine is secure and only accepting traffic on ports 22, 80, and 443.</p><p><strong>table inet filter {<br>chain input {<br>type filter hook input priority filter; policy drop;<br>tcp dport 22 drop<br>tcp dport 80 accept<br>tcp dport 443 accept<br>}</strong></p><p><strong>chain forward {<br>type filter hook forward priority filter; policy drop;<br>}</strong></p><p><strong>chain output {<br>type filter hook output priority filter; policy accept;}<br>}</strong></p><h3>Modify the rules in nftables</h3><p>To modify the rules in nftables to close port 22 (SSH), you can simply remove the line that accepts incoming traffic on port 22 from the “input” chain. Here’s how you can do it:<br><strong>sudo nano /etc/nftables.conf</strong></p><p>After doing changes, it is good to restart the nftables<br><strong>sudo systemctl restart nftables<br>sudo nft list ruleset</strong></p><p>Locate the “input” chain in the “filter” table, and remove the line that accepts incoming traffic on port 22 (TCP).</p><p>And that’s it! You’ve embarked on your journey to mastering nftables. Embrace the change, explore more, and remember — your system security is no more an iptables game, it’s an nftables play now!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d13c5f0cf40f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CloudFront Distribution for EC2, Step-by-Step Guide]]></title>
            <link>https://medium.com/@diyar.parwana/step-by-step-guide-to-create-a-cloudfront-distribution-for-ec2-cbf5b7862c41?source=rss-3db97932a51d------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbf5b7862c41</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[cloudfront]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[route-53]]></category>
            <dc:creator><![CDATA[Diyar Parwana]]></dc:creator>
            <pubDate>Thu, 01 Jun 2023 06:23:50 GMT</pubDate>
            <atom:updated>2023-06-25T11:27:27.586Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide will walk you through the process of creating an Amazon CloudFront distribution for your Amazon EC2 instance. It assumes that you have a running EC2 instance and a domain (in our example, ‘domain.com’) already set up.</p><p><strong>Step 1: Identify Your EC2 Origin Domain</strong><br>First, you need to find the Public IPv4 DNS for your EC2 instance. This is your origin domain. You can find it in the EC2 console under the “Instances” section.</p><p><strong>Step 2: Create a CloudFront Distribution</strong><br>Next, go to the CloudFront console and click on ‘Create Distribution’. Then click on ‘Web’.</p><p><strong>Step 3: Configure Origin Settings</strong><br>Under ‘Origin Settings’, for ‘Origin Domain Name’, choose your EC2 instance or enter the Public IPv4 DNS you found in Step 1.</p><p><strong>Step 4: Choose HTTP Only</strong><br>Under the ‘Origin Protocol Policy’, select ‘HTTP Only’. This ensures that CloudFront communicates with your EC2 instance using HTTP.</p><p><strong>Step 5: Redirect HTTP to HTTPS</strong><br>In the ‘Default Cache Behavior Settings’, set ‘Viewer Protocol Policy’ to ‘Redirect HTTP to HTTPS’. This forces users to connect to your CloudFront distribution with HTTPS for secure connections.</p><p><strong>Step 6: Allowed HTTP Methods</strong><br>Select ‘GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE’. This allows CloudFront to cache responses to these HTTP methods.</p><p><strong>Step 7: Cache Policy and Origin Request Policy</strong><br>In the same section (‘Default Cache Behavior Settings’), for ‘Cache Policy’ select ‘Managed-CachingDisabled’. For ‘Origin Request Policy’ select ‘Managed-AllViewer’. This effectively disables caching.</p><p><strong>Step 8: Custom SSL Certificate</strong><br>Under the ‘Distribution Settings’, for ‘SSL Certificate’, choose ‘Custom SSL Certificate (example.com)’. From the dropdown list, choose the certificate that matches your domain name (it should have been requested for the domain and created in AWS Certificate Manager in the N. Virginia region).</p><p><strong>Step 9: Configure CNAMEs</strong><br>Still under the ‘Distribution Settings’, in the ‘Alternate Domain Names (CNAMEs)’ field, enter your domain name and its www variant, like this:<br>domain.com <a href="http://www.domain.com/">www.domain.com</a></p><p><strong>Step 10: Create the Distribution</strong><br>Finally, click on ‘Create Distribution’. This process might take a while.</p><p><strong>Step 11: Update Route 53 Record Set</strong><br>Once the distribution is created and deployed, copy the domain name of the distribution (it should look something like d111111abcdef8.cloudfront.net).</p><p>Go to Route 53 console, find the hosted zone for your domain, and create or update a record set to point your domain (‘domain.com’ and <a href="http://www.domain.com,/">www.domain.com,</a> to this CloudFront distribution.<br>Usually, I do create an ALIAS for the distribution</p><p>That’s it! Now you have set up a CloudFront distribution for your EC2 instance with SSL and a custom domain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbf5b7862c41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Convincing Case for Moving Away from Windows]]></title>
            <link>https://medium.com/@diyar.parwana/embracing-linux-the-convincing-case-for-moving-away-from-windows-654b966c8946?source=rss-3db97932a51d------2</link>
            <guid isPermaLink="false">https://medium.com/p/654b966c8946</guid>
            <category><![CDATA[avoid-using-windows]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[welcome-to-linux]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[Diyar Parwana]]></dc:creator>
            <pubDate>Tue, 30 May 2023 06:57:04 GMT</pubDate>
            <atom:updated>2023-05-30T06:59:06.652Z</atom:updated>
            <content:encoded><![CDATA[<p>In a world dominated by Windows, many individuals find themselves hesitant to explore alternatives. However, the Linux operating system presents a compelling case for why people should consider transitioning away from Windows and embracing Linux machines. With a wealth of benefits ranging from enhanced security and stability to flexibility and customization, Linux offers an exceptional computing experience that can revolutionize the way we work and interact with technology. In this essay, I will delve into the most convincing reasons why individuals should make the switch to Linux.</p><h4>Security:</h4><p>One of the most compelling reasons to adopt Linux is its robust security. Linux is inherently more secure than Windows due to its open-source nature, which allows for continuous community-driven scrutiny. This transparency leads to prompt identification and resolution of security vulnerabilities, significantly reducing the risk of malware, viruses, and cyberattacks. Furthermore, Linux’s user-based permission system grants meticulous control over access rights, enhancing overall system security.</p><h4>Stability and Reliability:</h4><p>Linux is renowned for its stability and reliability. Unlike Windows, which often requires frequent updates and restarts, Linux systems can run for extended periods without interruptions. Linux’s architecture is designed to handle heavy workloads efficiently, resulting in fewer crashes and system failures. This stability is particularly beneficial for critical tasks, server environments, and professional workstations, ensuring uninterrupted productivity.</p><h4>Flexibility and Customization:</h4><p>Linux offers unparalleled flexibility and customization options. Users have the freedom to choose from a wide range of desktop environments and distributions that suit their preferences and needs. Whether it’s a lightweight environment for older hardware or a feature-rich interface for power users, Linux provides a vast ecosystem of options. Additionally, Linux allows users to modify and tweak the system to tailor it to their workflow, fostering a personalized computing experience.</p><h4>Open-Source Philosophy:</h4><p>The open-source philosophy behind Linux fosters collaboration, innovation, and knowledge-sharing. Linux users benefit from a global community of developers and enthusiasts continuously improving and expanding the ecosystem. This collaborative spirit ensures rapid bug fixes, software updates, and access to a vast array of free and open-source software, providing an unparalleled level of freedom and choice.</p><h4>Performance and Resource Efficiency:</h4><p>Linux is renowned for its exceptional performance and resource efficiency. The operating system is designed to optimize hardware resources, resulting in faster boot times, efficient memory management, and minimal system requirements. Linux can breathe new life into older hardware, enabling users to maximize their investments and reduce the need for frequent hardware upgrades.</p><h4>Cost-effectiveness:</h4><p>Linux provides a cost-effective alternative to Windows. While Windows often comes with licensing fees, Linux distributions are generally free to use and distribute. This aspect makes Linux an attractive choice for individuals, educational institutions, small businesses, and organizations looking to reduce their software-related expenses without compromising on functionality or security.</p><h4>Extensive Software Repositories:</h4><p>Linux offers extensive software repositories, which provide easy access to a vast range of applications for various purposes. These repositories contain a wealth of software, including productivity tools, creative applications, development environments, and server applications. With a few simple commands, users can install and update software efficiently, eliminating the need for manual downloads and installations.</p><h4>Community Support and Documentation:</h4><p>Linux benefits from an active and passionate community of users and developers who are always willing to help and share knowledge. Online forums, documentation, and tutorials provide comprehensive resources for troubleshooting, learning, and exploring the vast potential of Linux. This supportive ecosystem ensures that users are never alone in their journey and can rely on the collective expertise of the community.</p><p>The advantages of adopting Linux machines over Windows are undeniable. From heightened security and stability to unparalleled customization and flexibility, Linux offers an exceptional computing experience that empowers users and fosters innovation. Its open-source philosophy, extensive software repositories, and cost-effectiveness make it an attractive choice for individuals, businesses, and institutions alike. By making the switch to Linux, users can unlock a world of possibilities, transform their computing experience, and join a global community that embodies collaboration, creativity, and technological advancement.</p><p>Diyar P</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=654b966c8946" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Essential Linux Commands for Text File Management]]></title>
            <link>https://medium.com/@diyar.parwana/exploring-essential-linux-commands-for-text-file-management-1bf57e24ae99?source=rss-3db97932a51d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bf57e24ae99</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[commands]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[text]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Diyar Parwana]]></dc:creator>
            <pubDate>Tue, 30 May 2023 06:47:23 GMT</pubDate>
            <atom:updated>2023-05-30T06:47:23.739Z</atom:updated>
            <content:encoded><![CDATA[<p>Linux commands offer powerful tools for managing text files, providing various functionalities to efficiently manipulate and extract information from files. In this essay, we will explore a diverse collection of Linux commands commonly used for text file management. From displaying file contents to advanced text transformations, these commands empower users to efficiently handle and process text files.</p><h4>cat:</h4><p>The “cat” command allows users to display the contents of a file directly on the terminal. It is a simple yet effective way to quickly view the contents of a text file without any modifications.</p><h4>head:</h4><p>With the “head” command, users can conveniently view the first few lines of a file. This command is particularly useful when dealing with large files, as it allows us to get a glimpse of the file’s content and decide how to proceed.</p><h4>tail:</h4><p>Similar to “head,” the “tail” command displays the last few lines of a file. It proves handy when we want to check the end of a file or monitor log files in real-time.</p><h4>less:</h4><p>The “less” command provides an interactive way to view file contents. It enables scrolling through the file, searching for specific text, and navigating with ease. “Less” is particularly beneficial for examining large files without overwhelming the terminal.</p><h4>more:</h4><p>While “less” offers advanced features, the “more” command provides a simpler approach. It displays the contents of a file one screen at a time, pausing after each screen. This allows for a controlled reading experience and prevents information from scrolling off the screen too quickly.</p><h4>grep:</h4><p>The “grep” command is a powerful tool for searching files for a specific pattern. Whether it’s a word, phrase, or regular expression, “grep” efficiently scans files and highlights matching lines. It is invaluable for filtering relevant information from large datasets or log files.</p><h4>sed:</h4><p>With the “sed” command, users can perform text transformations and edits. As a stream editor, “sed” applies changes to the file as it passes through, making it ideal for find-and-replace operations, formatting adjustments, and more complex text manipulations.</p><h4>awk:</h4><p>“Awk” is a versatile text processing tool designed for extracting and manipulating data within files. Its strength lies in its ability to split lines into fields, perform calculations, apply conditionals, and generate formatted reports. “Awk” provides immense power for data extraction and manipulation.</p><h4>wc:</h4><p>The “wc” command allows users to count the number of lines, words, and characters in a file. It provides a quick summary of the file’s structure and helps analyze its content and size.</p><h4>sort:</h4><p>The “sort” command enables sorting lines within a file. It arranges lines in either ascending or descending order, making it useful for alphabetizing lists, organizing data, and preparing files for further analysis.</p><h4>uniq:</h4><p>When dealing with files containing duplicate lines, the “uniq” command filters out adjacent duplicate lines, leaving only unique lines behind. This command is especially valuable when working with large datasets or logs that may contain redundant entries.</p><h4>cut:</h4><p>The “cut” command allows users to extract specific columns or fields from a file based on a specified delimiter. It proves handy for extracting specific information from structured data, such as CSV files or tab-separated values.</p><h4>paste:</h4><p>The “paste” command merges lines from multiple files, aligning them side by side. This facilitates the combination of information from different sources, making it easier to analyze and compare related data.</p><h4>join:</h4><p>“Join” is a command that combines lines from two files based on a common field. By matching the specified field, it creates a cohesive output, allowing users to merge related data from different sources.</p><h4>diff:</h4><p>The “diff” command compares two files and displays the differences between them. It identifies additions, deletions, and modifications, enabling users to understand changes between versions or track modifications made to files.</p><h4>comm:</h4><p>When working with sorted files, the “comm” command helps identify common or unique lines between two files. It provides a clear distinction between shared lines, lines unique to the first file, and lines unique to the second file.</p><h4>tr:</h4><p>The “tr” command translates or deletes characters from a file. It proves useful for tasks such as substituting characters, removing unwanted characters, or transforming the case of letters within a file.</p><h4>split:</h4><p>When dealing with large files, the “split” command allows users to split them into smaller, more manageable files. This can be based on the number of lines or specific size requirements, facilitating easier handling and processing.</p><h4>tee:</h4><p>The “tee” command reads from standard input and simultaneously writes to standard output and files. It is a useful tool when you want to view and capture the output of a command simultaneously.</p><h4>find:</h4><p>The “find” command enables users to search for files and directories based on various criteria such as name, size, or modification time. It offers flexibility and efficiency in locating specific files within a directory structure.</p><h4>Conclusion:</h4><p>Linux provides a rich set of commands for managing text files efficiently. From displaying file contents to advanced text transformations and data extraction, these commands empower users to handle and manipulate text files effectively. Whether you’re searching for patterns, sorting data, comparing files, or extracting specific information, the extensive toolkit of Linux commands ensures you have the right tool for the job. By mastering these commands, users can streamline their text file management tasks and enhance their productivity in a Linux environment.</p><p>Diyar Parwana</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bf57e24ae99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating an OpenAI Response Interface]]></title>
            <link>https://medium.com/@diyar.parwana/creating-an-openai-response-interface-3337728eb8cc?source=rss-3db97932a51d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3337728eb8cc</guid>
            <category><![CDATA[jquery]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Diyar Parwana]]></dc:creator>
            <pubDate>Thu, 18 May 2023 12:47:01 GMT</pubDate>
            <atom:updated>2023-05-18T12:47:01.006Z</atom:updated>
            <content:encoded><![CDATA[<p>We’ll walk through the steps to create an HTML file that allows users to input text and receive AI-generated responses. The interface will utilize the OpenAI API to generate the responses. Let’s get started!</p><h3>Step 1: Set Up the HTML Structure</h3><ol><li>Create a new HTML file using any text editor or an integrated development environment (IDE).</li><li>Add the following HTML code to the file to define the basic structure of the OpenAI Response interface:</li></ol><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>    &lt;title&gt;OpenAI Response&lt;/title&gt;<br>    &lt;style&gt;<br>        body {<br>            font-family: Arial, sans-serif;<br>        }<br>        textarea {<br>            width: 100%;<br>            height: 150px;<br>            padding: 10px;<br>            box-sizing: border-box;<br>            margin-bottom: 10px;<br>        }<br>        button {<br>            padding: 10px 20px;<br>        }<br>    &lt;/style&gt;<br>    &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js&quot;&gt;&lt;/script&gt;<br>    &lt;script&gt;<br>        // JavaScript code will go here<br>    &lt;/script&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;!-- Interface elements will be added here --&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br></pre><h3>Step 2: Add the Interface Elements</h3><ol><li>Inside the &lt;body&gt; tag of the HTML file, add the following elements to create the interface for user input and response display:</li></ol><pre>&lt;h1&gt;OpenAI Response&lt;/h1&gt;<br>&lt;textarea id=&quot;input&quot; placeholder=&quot;Enter your content here&quot;&gt;&lt;/textarea&gt;<br>&lt;button id=&quot;fetchButton&quot;&gt;Get Response&lt;/button&gt;<br>&lt;textarea id=&quot;output&quot; placeholder=&quot;AI response will be shown here&quot; readonly&gt;&lt;/textarea&gt;<br><br><br><br></pre><p>This code adds a heading, two text areas (one for input and one for output), and a button that triggers the AI response generation.</p><h3>Step 3: Incorporate JavaScript Code</h3><ol><li>Locate the &lt;script&gt; tag inside the &lt;head&gt; section of the HTML file.</li><li>Replace the comment // JavaScript code will go here with the provided JavaScript code:</li></ol><pre>$(document).ready(function() {<br>    $(&quot;#fetchButton&quot;).click(function() {<br>        var inputText = $(&quot;#input&quot;).val().trim();<br>        if (inputText === &quot;&quot;) {<br>            alert(&quot;You must enter some text.&quot;);<br>            return;<br>        }<br>        var contents = inputText + &quot;\nAnswer the following question.&quot;;<br>        var modelId = &quot;text-davinci-003&quot;;<br>        $(&quot;#output&quot;).val(&quot;AI is generating the response...&quot;);<br><br>        $.ajax({<br>            url: &quot;https://api.openai.com/v1/engines/&quot; + modelId + &quot;/completions&quot;,<br>            type: &quot;POST&quot;,<br>            headers: {<br>                &quot;Content-Type&quot;: &quot;application/json&quot;,<br>                &quot;Authorization&quot;: &quot;Bearer YOUR_API_KEY&quot;<br>            },<br>            data: JSON.stringify({<br>                prompt: contents,<br>                max_tokens: 256,<br>                temperature: 0.7,<br>                top_p: 1<br>            }),<br>            success: function(response) {<br>                if (response.choices &amp;&amp; response.choices.length &gt; 0) {<br>                    var responseText = response.choices[0].text.trim();<br>                    $(&quot;#output&quot;).val(&quot;AI response:\n&quot; + responseText);<br>                } else {<br>                    $(&quot;#output&quot;).val(&quot;Error: No completion found&quot;);<br>                }<br>            },<br>            error: function(xhr, status, error) {<br>                $(&quot;#output&quot;).val(&quot;Error: &quot; + error);<br>            }<br>        });<br>    });<br>});<br><br><br><br></pre><p>Make sure to replace &quot;YOUR_API_KEY&quot; in the JavaScript code with your</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3337728eb8cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Packages Manually in Atom and Pulsar]]></title>
            <link>https://medium.com/@diyar.parwana/installing-packages-manually-in-atom-and-pulsar-fdedac77ebbc?source=rss-3db97932a51d------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdedac77ebbc</guid>
            <category><![CDATA[pulsa]]></category>
            <category><![CDATA[atom]]></category>
            <dc:creator><![CDATA[Diyar Parwana]]></dc:creator>
            <pubDate>Sat, 07 Jan 2023 23:57:04 GMT</pubDate>
            <atom:updated>2023-01-07T23:57:04.898Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qVAq5DoQjrQl91td.png" /></figure><p>To install packages manually in Atom and Pulsar, you will need to first download the package you want to install. In this case, we will use the ftp-remote-editor package as an example, which can be found on GitHub at the following link: <a href="https://github.com/diypa571/ftp-remote-edit">https://github.com/diypa571/ftp-remote-edit</a>. Many packages for Pulsar can even be found using the Pulsar package documentation at <a href="https://pulsar-edit.dev/docs/packages/">https://pulsar-edit.dev/docs/packages/</a>.</p><p>Once you have downloaded the package, you will need to move it to the appropriate packages directory for the text editor you are using. On Linux, the Atom packages directory is located at /home/theUser/.var/app/io.atom.Atom/data/packages, while the Pulsar packages directory is located at /home/theUser/.var/app/io.pulsar.Pulsar/data/packages. To move the package to the desired directory, you can use the following command:</p><pre>mv path/to/downloaded/package /home/theUser/.var/app/io.(atom/pulsar).(Atom/Pulsar)/data/packages</pre><p>Next, navigate to the package directory by using the following command:</p><pre>cd /home/theUser/.var/app/io.(atom/pulsar).(Atom/Pulsar)/data/packages/ftp-remote-editor</pre><pre>Finally, use the following command to install the package and make it work in Atom or Pulsar:</pre><pre>sudo npm install</pre><p>This will install the package and all of its dependencies, allowing you to use it in your preferred text editor.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdedac77ebbc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Atom is dead long live the Pulsar]]></title>
            <link>https://medium.com/@diyar.parwana/atom-is-dead-long-live-the-pulsar-96e795b14b24?source=rss-3db97932a51d------2</link>
            <guid isPermaLink="false">https://medium.com/p/96e795b14b24</guid>
            <dc:creator><![CDATA[Diyar Parwana]]></dc:creator>
            <pubDate>Mon, 02 Jan 2023 20:20:44 GMT</pubDate>
            <atom:updated>2023-12-12T14:41:49.875Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mR9Kb0e4jx6YRQqs.png" /><figcaption>Pulsar</figcaption></figure><p>Pulsar is a text and source code editor that was developed as a fork of the Atom text editor. A fork is a copy of a software project that is developed independently from the original project. In the case of Pulsar, the developers decided to create a new version of Atom that addressed some of the issues and limitations they saw in the original project.</p><p>Like Atom, Pulsar is an open source project, which means that it is developed and maintained by a community of volunteers who contribute their time and expertise to the project. This also means that Pulsar is freely available for anyone to use and modify.</p><p>One of the key features of Pulsar is its performance. The developers of Pulsar have focused on optimizing the editor to make it faster and more responsive, especially when working with large files or projects. Pulsar also includes a number of features that are designed to improve the workflow of developers, such as a built-in terminal and support for multiple cursors.</p><p>In addition to its performance and productivity features, Pulsar is also highly customizable. Like Atom, Pulsar allows users to install packages to add new functionality to the editor, and it includes a built-in package manager to make it easy to find and install new packages. Pulsar also supports themes, which allow users to change the appearance of the editor to suit their preferences.</p><p>Overall, Pulsar is a powerful and versatile text and code editor that offers many of the same features as Atom. Its focus on performance and productivity, as well as its customization options, make it a good choice for developers and other users who need a flexible and reliable tool for editing text and code.</p><p>There are many text editors available, so why consider using Pulsar? Some options like Sublime and TextMate offer convenience, but have limited customization options. On the other hand, editors like Emacs and Vim offer a high level of flexibility, but can be difficult to learn and only offer limited customization options through special scripting languages.</p><p>Pulsar aims to offer the best of both worlds by providing both ease of use and extensive customization options. Our goal is to create an editor that is approachable for beginners, but also powerful enough for experienced developers to use effectively.</p><p>In addition to its own features and capabilities, one of the key benefits of Pulsar is that it is compatible with many of the packages that have been developed for Atom. This means that users of Pulsar can take advantage of the extensive ecosystem of packages that have been created for Atom to add new functionality to the editor and improve their workflow.</p><p>There are hundreds of packages available for Atom that cover a wide range of purposes, including support for specific programming languages, tools for debugging and testing code, and enhancements for working with version control systems. Many of these packages are also compatible with Pulsar, which means that users of Pulsar can take advantage of this rich ecosystem of packages to customize and extend the functionality of the editor.</p><p>In addition to the packages that are available for Atom, Pulsar also has its own community of developers who are creating new packages specifically for Pulsar. These packages are designed to take advantage of the unique features and capabilities of Pulsar, and they can further enhance the functionality of the editor.</p><p>Overall, the ability to use packages from the Atom ecosystem and the availability of packages specifically designed for Pulsar make Pulsar a highly customizable and extensible text and code editor. This, combined with its focus on performance and productivity, makes it a good choice for developers and other users who need a powerful and flexible tool for editing text and code.</p><p>Downloading and Installing</p><p>1- <a href="https://pulsar-edit.dev/download.html">https://pulsar-edit.dev/download.html</a></p><p>Pulsar packages<br>2- <a href="https://web.pulsar-edit.dev/packages/">https://web.pulsar-edit.dev/packages/</a></p><p>Developers<br>3- <a href="https://github.com/pulsar-edit">https://github.com/pulsar-edit</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96e795b14b24" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>