<?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: mridul037</title>
    <description>The latest articles on Forem by mridul037 (@mridul037).</description>
    <link>https://forem.com/mridul037</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%2F272868%2Feff0bc60-62b4-4f01-b195-2b928d41c572.jpeg</url>
      <title>Forem: mridul037</title>
      <link>https://forem.com/mridul037</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mridul037"/>
    <language>en</language>
    <item>
      <title>GO:lack of synchronization</title>
      <dc:creator>mridul037</dc:creator>
      <pubDate>Wed, 27 Nov 2024 14:50:04 +0000</pubDate>
      <link>https://forem.com/mridul037/golack-of-synchronization-1p9f</link>
      <guid>https://forem.com/mridul037/golack-of-synchronization-1p9f</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var a string
var done bool

func setup() {
    a = "hello, world"
    done = true
}

func doprint() {
    if !done {
        once.Do(setup)
    }
    print(a)
}

func twoprint() {
    go doprint()
    go doprint()
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code Analysis
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Variables:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a and b are global variables of type int, shared by all goroutines.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Functions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;f():

&lt;ul&gt;
&lt;li&gt;Writes to a and b sequentially (a = 1 and b = 2).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;g():&lt;/li&gt;

&lt;li&gt;Reads and prints b followed by a.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Concurrency in main():&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The function f() is executed as a separate goroutine using go f().&lt;/li&gt;
&lt;li&gt;The function g() is executed directly in the main goroutine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Potential Issues:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The goroutine running f() and the main goroutine executing g() run concurrently.&lt;/li&gt;
&lt;li&gt;The writes to a and b in f() may not complete before g() reads and prints the values of a and b.&lt;/li&gt;
&lt;li&gt;This introduces a data race, where concurrent access (writes in f() and reads in g()) occurs on shared memory (a and b) without synchronization.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Possible Outcomes&lt;/strong&gt;&lt;br&gt;
Due to the lack of synchronization, the program's output is non-deterministic. Here are the possible scenarios:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Case 1&lt;/strong&gt;: g() executes before f() modifies a and b:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initial values of a and b are 0 (default for uninitialized int in Go).
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0
0

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

&lt;/div&gt;


&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;CASE 2&lt;/strong&gt;: If b = 2 is completed before g() but a = 1 is not, the output could be:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key Observations&lt;/strong&gt;&lt;br&gt;
Data Race: The concurrent access to a and b without synchronization introduces a data race. This makes the program's behavior undefined and unpredictable&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fixing the Code&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using a &lt;code&gt;sync.WaitGroup:&lt;/code&gt;
Ensure f() completes before g() executes
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var a, b int
var wg sync.WaitGroup

func f() {
    a = 1
    b = 2
    wg.Done()
}

func g() {
    print(b)
    print(a)
}

func main() {
    wg.Add(1)
    go f()
    wg.Wait()
    g()
}

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Using &lt;strong&gt;Channels:&lt;/strong&gt;
Signal when f() is done:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var a, b int

func f(done chan bool) {
    a = 1
    b = 2
    done &amp;lt;- true
}

func g() {
    print(b)
    print(a)
}

func main() {
    done := make(chan bool)
    go f(done)
    &amp;lt;-done
    g()
}

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

&lt;/div&gt;



&lt;p&gt;Here, g() waits until f() sends a signal over the done channel.&lt;/p&gt;

</description>
      <category>go</category>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Generate stunning, unique images from text descriptions</title>
      <dc:creator>mridul037</dc:creator>
      <pubDate>Wed, 27 Nov 2024 14:39:13 +0000</pubDate>
      <link>https://forem.com/mridul037/generate-stunning-unique-images-from-text-descriptions-5clj</link>
      <guid>https://forem.com/mridul037/generate-stunning-unique-images-from-text-descriptions-5clj</guid>
      <description>&lt;p&gt;I just created a Text to image app &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%2F50dde25vuon7mptmqomd.png" 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%2F50dde25vuon7mptmqomd.png" alt="Image description" width="800" height="493"&gt;&lt;/a&gt;&lt;br&gt;
You can subscribe to the model using below link for just $5.9&lt;/p&gt;

&lt;p&gt;&lt;a href="https://bhram-ai.netlify.app/" rel="noopener noreferrer"&gt;https://bhram-ai.netlify.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;or if you want to know how to make it Email me on &lt;a href="mailto:mridulshukla037@gmail.com"&gt;mridulshukla037@gmail.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>learning</category>
    </item>
    <item>
      <title>What is SYN Flooding ?</title>
      <dc:creator>mridul037</dc:creator>
      <pubDate>Sat, 23 Nov 2024 06:11:34 +0000</pubDate>
      <link>https://forem.com/mridul037/what-is-syn-flooding--1360</link>
      <guid>https://forem.com/mridul037/what-is-syn-flooding--1360</guid>
      <description>&lt;h1&gt;
  
  
  SYN Flooding: Exploit and Mitigation
&lt;/h1&gt;

&lt;p&gt;A SYN flood exploits a vulnerability in the TCP/IP handshake in an attempt to disrupt a web service.&lt;/p&gt;

&lt;p&gt;A SYN flood (half-open attack) is a type of &lt;strong&gt;denial-of-service (DDoS)&lt;/strong&gt; attack which aims to make a server unavailable to legitimate traffic by consuming all available server resources. By repeatedly sending initial connection request (SYN) packets, the attacker is able to overwhelm all available ports on a targeted server machine, causing the targeted device to respond to legitimate traffic sluggishly or not at all.&lt;/p&gt;




&lt;h2&gt;
  
  
  How does a SYN flood attack work?
&lt;/h2&gt;

&lt;p&gt;SYN flood attacks work by exploiting the handshake process of a TCP connection. Under normal conditions, a TCP connection exhibits three distinct steps to establish a connection:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Client Sends SYN&lt;/strong&gt;: The client sends a SYN packet to the server to initiate the connection.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server Responds with SYN/ACK&lt;/strong&gt;: The server responds to the initial packet with a SYN/ACK packet, acknowledging the communication.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Client Sends ACK&lt;/strong&gt;: The client returns an ACK packet to acknowledge the receipt of the SYN/ACK packet from the server. Once this sequence is completed, the TCP connection is open and ready to transmit data.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Effects of SYN Flooding
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Resource Exhaustion&lt;/strong&gt;: Overwhelms server resources like memory and CPU.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Denial of Service&lt;/strong&gt;: Prevents legitimate users from accessing the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Disruption&lt;/strong&gt;: Can slow down or crash affected network segments.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How to Mitigate SYN Flooding
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Rate Limiting&lt;/strong&gt;: Restrict the number of SYN packets allowed per IP or over time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SYN Cookies&lt;/strong&gt;: A technique where the server doesn't allocate resources for half-open connections. It encodes connection information into the SYN-ACK response and verifies it when the ACK is received.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Firewalls and Intrusion Prevention Systems (IPS)&lt;/strong&gt;: Use firewalls or specialized devices to detect and filter malicious SYN packets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Distributed Defenses&lt;/strong&gt;: Use Content Delivery Networks (CDNs) or cloud-based DDoS protection services to absorb the attack.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Increase Backlog Size&lt;/strong&gt;: Configure the server to handle more simultaneous connections, although this only provides temporary relief.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  Detailed Examples of SYN Flooding Detection and Mitigation
&lt;/h1&gt;




&lt;h2&gt;
  
  
  1. Rate Limiting
&lt;/h2&gt;

&lt;p&gt;Rate limiting restricts the number of SYN packets a server can accept from a single IP or within a given timeframe.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example: &lt;code&gt;iptables&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Limit incoming SYN packets to 10 per second from a single IP&lt;/span&gt;
iptables &lt;span class="nt"&gt;-A&lt;/span&gt; INPUT &lt;span class="nt"&gt;-p&lt;/span&gt; tcp &lt;span class="nt"&gt;--syn&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; limit &lt;span class="nt"&gt;--limit&lt;/span&gt; 10/second &lt;span class="nt"&gt;--limit-burst&lt;/span&gt; 20 &lt;span class="nt"&gt;-j&lt;/span&gt; ACCEPT

&lt;span class="c"&gt;# Log and drop packets exceeding the limit&lt;/span&gt;
iptables &lt;span class="nt"&gt;-A&lt;/span&gt; INPUT &lt;span class="nt"&gt;-p&lt;/span&gt; tcp &lt;span class="nt"&gt;--syn&lt;/span&gt; &lt;span class="nt"&gt;-j&lt;/span&gt; LOG &lt;span class="nt"&gt;--log-prefix&lt;/span&gt; &lt;span class="s2"&gt;"SYN Flood: "&lt;/span&gt;
iptables &lt;span class="nt"&gt;-A&lt;/span&gt; INPUT &lt;span class="nt"&gt;-p&lt;/span&gt; tcp &lt;span class="nt"&gt;--syn&lt;/span&gt; &lt;span class="nt"&gt;-j&lt;/span&gt; DROP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. SYN Cookies
&lt;/h2&gt;

&lt;p&gt;SYN cookies ensure that the server doesn't store incomplete connection states, reducing memory consumption.&lt;/p&gt;

&lt;h3&gt;
  
  
  Linux Configuration Example
&lt;/h3&gt;

&lt;p&gt;Enable SYN cookies on Linux:&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="c"&gt;# Enable SYN cookies&lt;/span&gt;
&lt;span class="nb"&gt;echo &lt;/span&gt;1 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /proc/sys/net/ipv4/tcp_syncookies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3.Increase Backlog Size
&lt;/h2&gt;

&lt;p&gt;A short-term solution is to increase the backlog queue size for half-open connections.&lt;/p&gt;

&lt;p&gt;Linux Configuration Example&lt;br&gt;
Modify the TCP backlog parameters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Copy code
&lt;span class="c"&gt;# Increase the SYN backlog size&lt;/span&gt;
&lt;span class="nb"&gt;echo &lt;/span&gt;4096 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /proc/sys/net/ipv4/tcp_max_syn_backlog

&lt;span class="c"&gt;# Reduce the timeout for incomplete connections&lt;/span&gt;
&lt;span class="nb"&gt;echo &lt;/span&gt;30 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /proc/sys/net/ipv4/tcp_synack_retries
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make these settings permanent in&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/etc/sysctl.conf:

bash
Copy code
net.ipv4.tcp_max_syn_backlog &lt;span class="o"&gt;=&lt;/span&gt; 4096
net.ipv4.tcp_synack_retries &lt;span class="o"&gt;=&lt;/span&gt; 30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>networking</category>
      <category>ddos</category>
      <category>devops</category>
      <category>coding</category>
    </item>
    <item>
      <title>𝗖𝗣𝗨 𝗧𝗵𝗿𝗼𝘁𝘁𝗹𝗶𝗻𝗴 𝗶𝗻 𝗞𝘂𝗯𝗲𝗿𝗻𝗲𝘁𝗲𝘀 ☸️</title>
      <dc:creator>mridul037</dc:creator>
      <pubDate>Thu, 21 Nov 2024 15:27:48 +0000</pubDate>
      <link>https://forem.com/mridul037/-15hp</link>
      <guid>https://forem.com/mridul037/-15hp</guid>
      <description>&lt;p&gt;𝗖𝗣𝗨 𝗧𝗵𝗿𝗼𝘁𝘁𝗹𝗶𝗻𝗴 𝗶𝗻 𝗞𝘂𝗯𝗲𝗿𝗻𝗲𝘁𝗲𝘀 ☸️ : occurs when a container’s CPU usage hits its limit, causing Kubernetes to restrict CPU access, leading to potential performance degradation. &lt;br&gt;
𝗛𝗼𝘄 𝗖𝗣𝗨 𝗧𝗵𝗿𝗼𝘁𝘁𝗹𝗶𝗻𝗴 𝗪𝗼𝗿𝗸𝘀 𝗶𝗻 𝗞𝘂𝗯𝗲𝗿𝗻𝗲𝘁𝗲𝘀 ☸️ &lt;br&gt;
In Kubernetes, CPU resources for containers are managed with CPU requests and CPU limits:&lt;/p&gt;

&lt;p&gt;𝟭. 𝗖𝗣𝗨 𝗥𝗲𝗾𝘂𝗲𝘀𝘁𝘀: This is the minimum amount of CPU that Kubernetes guarantees to a container. When a container requests a certain CPU amount, Kubernetes tries to ensure that amount is available on the node.&lt;/p&gt;

&lt;p&gt;𝟮. 𝗖𝗣𝗨 𝗟𝗶𝗺𝗶𝘁𝘀: This is the maximum CPU that a container is allowed to use. If a container tries to exceed this limit, Kubernetes throttles the CPU usage by enforcing the limit.&lt;/p&gt;

&lt;p&gt;Kubernetes uses the Completely Fair Scheduler (CFS) to enforce CPU limits. When a container exceeds its limit, CFS reduces its CPU usage by briefly "pausing" it, impacting performance and increasing latency, especially for high-demand tasks like initialisation or intensive processing.&lt;/p&gt;

&lt;p&gt;𝗞𝗲𝘆 𝗿𝗲𝗮𝘀𝗼𝗻𝘀 𝗳𝗼𝗿 𝗖𝗣𝗨 𝘁𝗵𝗿𝗼𝘁𝘁𝗹𝗶𝗻𝗴 𝗶𝗻𝗰𝗹𝘂𝗱𝗲:&lt;br&gt;
• 𝗧𝗶𝗴𝗵𝘁 𝗖𝗣𝗨 𝗟𝗶𝗺𝗶𝘁𝘀: If CPU limits are set too low relative to the container’s demand, the container quickly hits the limit and gets throttled.&lt;br&gt;
• 𝗛𝗶𝗴𝗵 𝗖𝗣𝗨 𝗦𝗽𝗶𝗸𝗲𝘀: Background tasks like garbage collection (GC) or intensive computations can trigger high CPU usage that exceeds limits.&lt;br&gt;
• 𝗟𝗶𝗺𝗶𝘁𝗲𝗱 𝗖𝗹𝘂𝘀𝘁𝗲𝗿 𝗥𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀: In environments with high contention, such as dev or CI environments with strict limits, containers are more likely to hit CPU limits.&lt;/p&gt;

&lt;p&gt;𝗜𝗻𝗱𝗶𝗰𝗮𝘁𝗼𝗿𝘀 𝗼𝗳 𝗖𝗣𝗨 𝗧𝗵𝗿𝗼𝘁𝘁𝗹𝗶𝗻𝗴:&lt;br&gt;
• 𝗰𝗼𝗻𝘁𝗮𝗶𝗻𝗲𝗿&lt;em&gt;𝗰𝗽𝘂&lt;/em&gt;𝗰𝗳𝘀&lt;em&gt;𝘁𝗵𝗿𝗼𝘁𝘁𝗹𝗲𝗱&lt;/em&gt;𝘀𝗲𝗰𝗼𝗻𝗱𝘀_𝘁𝗼𝘁𝗮𝗹: This metric shows the cumulative time a container has been throttled, providing insight into the frequency and duration of throttling.&lt;br&gt;
• 𝗣𝗲𝗿𝗳𝗼𝗿𝗺𝗮𝗻𝗰𝗲 𝗗𝗲𝗴𝗿𝗮𝗱𝗮𝘁𝗶𝗼𝗻: Symptoms like increased response times, slower processing, or latency spikes can suggest throttling is affecting the application.&lt;/p&gt;

&lt;p&gt;𝗧𝗼 𝗿𝗲𝗱𝘂𝗰𝗲 𝗖𝗣𝗨 𝘁𝗵𝗿𝗼𝘁𝘁𝗹𝗶𝗻𝗴, 𝘆𝗼𝘂 𝗰𝗮𝗻:&lt;/p&gt;

&lt;p&gt;• 𝗔𝗱𝗷𝘂𝘀𝘁 𝗖𝗣𝗨 𝗟𝗶𝗺𝗶𝘁𝘀: Ensure limits are realistic for the container’s expected workload.&lt;br&gt;
• 𝗦𝗲𝘁 𝗖𝗣𝗨 𝗥𝗲𝗾𝘂𝗲𝘀𝘁𝘀 𝗖𝗮𝗿𝗲𝗳𝘂𝗹𝗹𝘆: Balancing requests and limits prevents frequent throttling while reserving sufficient CPU.&lt;br&gt;
• 𝗠𝗼𝗻𝗶𝘁𝗼𝗿 𝗮𝗻𝗱 𝗣𝗿𝗼𝗳𝗶𝗹𝗲 𝗨𝘀𝗮𝗴𝗲: Tracking CPU usage over time can reveal the need for higher limits or more efficient resource allocation.&lt;br&gt;
• 𝗜𝗺𝗽𝗹𝗲𝗺𝗲𝗻𝘁 𝗔𝘂𝘁𝗼𝘀𝗰𝗮𝗹𝗶𝗻𝗴: For high-demand periods, horizontal autoscaling can provide more resources to avoid throttling.&lt;br&gt;
By balancing CPU allocation and setting realistic limits, CPU throttling can be minimised, enhancing performance and stability for applications in Kubernetes&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>webdev</category>
      <category>cloud</category>
    </item>
    <item>
      <title>𝗛𝗼𝘄 𝗕𝗮𝗰𝗸𝗲𝗻𝗱 𝗔𝗰𝗰𝗲𝗽𝘁 𝗖𝗼𝗻𝗻𝗲𝗰𝘁𝗶𝗼𝗻𝘀.</title>
      <dc:creator>mridul037</dc:creator>
      <pubDate>Thu, 21 Nov 2024 15:26:19 +0000</pubDate>
      <link>https://forem.com/mridul037/-40of</link>
      <guid>https://forem.com/mridul037/-40of</guid>
      <description>&lt;p&gt;The TCP Connection Lifecycle&lt;br&gt;
Server Binds and Listens&lt;br&gt;
• The server creates a listening socket and binds it to a port.&lt;br&gt;
• It calls the listen() system call to mark the socket as passive, ready to accept connections.(example : port 3000)&lt;/p&gt;

&lt;p&gt;𝗦𝗬𝗡 𝗤𝘂𝗲𝘂𝗲&lt;br&gt;
• When a client initiates a connection, the TCP handshake begins:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Client sends a SYN (synchronize) packet to the server.&lt;/li&gt;
&lt;li&gt;The server responds with a SYN-ACK (synchronize-acknowledge).&lt;/li&gt;
&lt;li&gt;The client completes the handshake with an ACK.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;• Before the handshake completes, the connection is placed in the SYN queue.&lt;br&gt;
• Connections in this queue are in a half-open state (SYN received but not yet acknowledged by the client).&lt;br&gt;
• If the handshake isn't completed (e.g., due to a timeout), the entry is dropped from the SYN queue.&lt;/p&gt;

&lt;p&gt;𝗔𝗰𝗰𝗲𝗽𝘁 𝗤𝘂𝗲𝘂𝗲&lt;br&gt;
• Once the TCP handshake completes, the connection moves from the SYN queue to the accept queue.&lt;br&gt;
• The server can then call the accept() system call to retrieve the connection.&lt;/p&gt;

&lt;p&gt;𝗙𝗶𝗹𝗲 𝗗𝗲𝘀𝗰𝗿𝗶𝗽𝘁𝗼𝗿&lt;br&gt;
 𝘐𝘵'𝘴 𝘢𝘯 𝘪𝘯𝘵𝘦𝘨𝘦𝘳 𝘵𝘩𝘢𝘵 𝘴𝘦𝘳𝘷𝘦𝘴 𝘢𝘴 𝘢𝘯 𝘪𝘯𝘥𝘦𝘹 𝘵𝘰 𝘢𝘯 𝘦𝘯𝘵𝘳𝘺 𝘪𝘯 𝘵𝘩𝘦 𝘧𝘪𝘭𝘦 𝘥𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘰𝘳 𝘵𝘢𝘣𝘭𝘦 𝘮𝘢𝘪𝘯𝘵𝘢𝘪𝘯𝘦𝘥 𝘣𝘺 𝘵𝘩𝘦 𝘰𝘱𝘦𝘳𝘢𝘵𝘪𝘯𝘨 𝘴𝘺𝘴𝘵𝘦𝘮. 𝘛𝘩𝘪𝘴 𝘪𝘯𝘵𝘦𝘨𝘦𝘳 𝘳𝘦𝘱𝘳𝘦𝘴𝘦𝘯𝘵𝘴 𝘢 𝘳𝘦𝘧𝘦𝘳𝘦𝘯𝘤𝘦 𝘵𝘰 𝘢𝘯 𝘰𝘱𝘦𝘯 𝘧𝘪𝘭𝘦 𝘰𝘳 𝘴𝘰𝘤𝘬𝘦𝘵&lt;/p&gt;

&lt;p&gt;• The accept() call returns a new file descriptor representing the client connection.&lt;br&gt;
• The server application uses this descriptor to read from and write to the client socket.&lt;/p&gt;

&lt;p&gt;𝗖𝗼𝗻𝗻𝗲𝗰𝘁𝗶𝗼𝗻 𝗠𝗮𝗻𝗮𝗴𝗲𝗺𝗲𝗻𝘁:&lt;br&gt;
𝙎𝙔𝙉 𝙌𝙪𝙚𝙪𝙚 𝙊𝙫𝙚𝙧𝙛𝙡𝙤𝙬𝙨:&lt;br&gt;
• If the SYN queue is full, new connection attempts are dropped.&lt;br&gt;
• Mitigation: Tune kernel parameters like 𝘯𝘦𝘵.𝘪𝘱𝘷4.𝘵𝘤𝘱&lt;em&gt;𝘮𝘢𝘹&lt;/em&gt;𝘴𝘺𝘯_𝘣𝘢𝘤𝘬𝘭𝘰𝘨 or use SYN cookies.&lt;/p&gt;

&lt;p&gt;𝗔𝗰𝗰𝗲𝗽𝘁 𝗤𝘂𝗲𝘂𝗲 𝗢𝘃𝗲𝗿𝗳𝗹𝗼𝘄𝘀:&lt;br&gt;
• If the accept queue is full, new connections are ignored or reset.&lt;br&gt;
• Mitigation: Increase the backlog size in the listen() call and adjust net.core.somaxconn.&lt;/p&gt;

&lt;p&gt;𝗙𝗶𝗹𝗲 𝗗𝗲𝘀𝗰𝗿𝗶𝗽𝘁𝗼𝗿 𝗘𝘅𝗵𝗮𝘂𝘀𝘁𝗶𝗼𝗻:&lt;br&gt;
• The system has a limit on open file descriptors (ulimit -n or /proc/sys/fs/file-max).&lt;br&gt;
• Exceeding this limit prevents new connections.&lt;br&gt;
• Mitigation: Increase the descriptor limit for the process.&lt;/p&gt;

</description>
      <category>backenddevelopment</category>
      <category>node</category>
      <category>linux</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Processes in Elixir</title>
      <dc:creator>mridul037</dc:creator>
      <pubDate>Sat, 26 Jun 2021 16:12:01 +0000</pubDate>
      <link>https://forem.com/mridul037/processes-in-elixir-3a0m</link>
      <guid>https://forem.com/mridul037/processes-in-elixir-3a0m</guid>
      <description>&lt;h3&gt;
  
  
  spawn
&lt;/h3&gt;

&lt;p&gt;The basic mechanism for spawning new processes is the auto-imported spawn/1 function:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;iex&amp;gt; spawn(fn -&amp;gt; 1 + 2 end)&lt;br&gt;
 # PID&amp;lt;0.43.0&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Notice spawn/1 returns a PID (process identifier). At this point, the process you spawned is very likely dead. The spawned process will execute the given function and exit after the function is done:&lt;/p&gt;

&lt;p&gt;Can we see if its dead or alive&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex&amp;gt; pid = spawn(fn -&amp;gt; 1 + 2 end)
#PID&amp;lt;0.44.0&amp;gt;
iex&amp;gt; Process.alive?(pid)
false 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Lets send a Message from one process to another
&lt;/h5&gt;

&lt;p&gt;&lt;em&gt;We can retrieve the PID of the current process by calling self :&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex(6)&amp;gt; parent=self()
#PID&amp;lt;0.103.0&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Sender
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex(7)&amp;gt; spawn(fn-&amp;gt;send(parent,{:hello,self()}) end) 
#PID&amp;lt;0.115.0&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;When a message is sent to a process, the message is stored in the process mailbox. The receive/1 block goes through the current process mailbox searching for a message that matches any of the given patterns&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Receiver
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex(8)&amp;gt; receive do                                      
...(8)&amp;gt; {:hello,pid}-&amp;gt;"Got hello form #{inspect pid}"  
...(8)&amp;gt; end                                               
"Got hello form #PID&amp;lt;0.115.0&amp;gt;"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>elixir</category>
      <category>erlang</category>
      <category>html</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Learn Elixir the language behind Whatsapp,Telegram, Discord and Pinterest</title>
      <dc:creator>mridul037</dc:creator>
      <pubDate>Thu, 24 Jun 2021 16:07:56 +0000</pubDate>
      <link>https://forem.com/mridul037/learn-elixir-the-language-behind-watsapp-telegram-discord-and-pinterest-2c20</link>
      <guid>https://forem.com/mridul037/learn-elixir-the-language-behind-watsapp-telegram-discord-and-pinterest-2c20</guid>
      <description>&lt;p&gt;&lt;strong&gt;Elixir&lt;/strong&gt; is a dynamic, functional language for building scalable and maintainable applications.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Elixir leverages the Erlang VM, known for running low-latency, distributed, and fault-tolerant systems. Elixir is successfully used in web development, embedded software, data ingestion, and multimedia processing, across a wide range of industries. Here is a peek:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Performance feature's of elixir:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Scalability
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;All Elixir code runs inside lightweight threads of execution 
(called processes) that are isolated and exchange information 
via messages&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Erlang compatible
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Elixir runs on the Erlang VM giving developers complete access to Erlang's ecosystem, used by companies like Heroku, WhatsApp, Klarna and many more to build distributed, fault-tolerant applications&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Fault-tolerance
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;To cope with failures, Elixir provides supervisors which describe how to restart parts of your system when things go awry, going back to a known initial state that is guaranteed to work&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;If you haven’t yet installed Elixir, visit &lt;a href="https://elixir-lang.org/install.html" rel="noopener noreferrer"&gt;installation page&lt;/a&gt;. Once you are done, you can run &lt;code&gt;elixir --version&lt;/code&gt; to get the current Elixir version.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;let’s start by running &lt;code&gt;iex&lt;/code&gt;  means interactive elixir&lt;/p&gt;

&lt;h6&gt;
  
  
  some basic code
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex(1)&amp;gt; 40 + 2
42

iex(2)&amp;gt; "hello" &amp;lt;&amp;gt; " world"
"hello world"

iex&amp;gt; String.length("The quick brown fox jumps over the lazy dog")
43
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Support for binary, octal, and hexadecimal numbers comes built in:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex&amp;gt; 0b0110
6
iex&amp;gt; 0o644
420
iex&amp;gt; 0x1F
31
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  ATOMS
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex&amp;gt; :apple
:apple
iex&amp;gt; :orange
:orange
iex&amp;gt; :apple == :apple
true
iex&amp;gt; :apple == :orange
false
iex&amp;gt; true == :true
true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  You can print a string using the &lt;code&gt;IO.puts/1&lt;/code&gt; function from the IO module
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex&amp;gt; IO.puts("hello\nworld")
hello
world
:ok
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;IO.puts/1&lt;/code&gt; function returns the atom :ok after printing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  In next Article we will go more deep into Elixir Laguage.
&lt;/h4&gt;

</description>
      <category>elixir</category>
      <category>erlang</category>
      <category>distributedsystems</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Create Your Github readme with automated news data</title>
      <dc:creator>mridul037</dc:creator>
      <pubDate>Sat, 01 Aug 2020 19:26:44 +0000</pubDate>
      <link>https://forem.com/mridul037/create-your-github-readme-with-automated-news-data-3a7n</link>
      <guid>https://forem.com/mridul037/create-your-github-readme-with-automated-news-data-3a7n</guid>
      <description>&lt;p&gt;GitHub added a new feature ,where you could have a README on your GitHub profile.It could be used as portfolio or just a fun project.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub profile README
&lt;/h2&gt;

&lt;p&gt;So what is that GitHub profile README thingy? Its a cool new feature by GitHub which allows you to have a README on your profile. Sounds cool? Surely it is. Time to get creative 😋.&lt;/p&gt;

&lt;h1&gt;
  
  
  How to include TeachCrunch news api data in readme
&lt;/h1&gt;

&lt;p&gt;So to access the news API, you need to have an access key.&lt;br&gt;
which you can get here &lt;a href="https://newsapi.org/" rel="noopener noreferrer"&gt;https://newsapi.org/&lt;/a&gt;&lt;br&gt;
So how do we get TeachCrunch news? Well, the answer is really easy. So we will do it in NodeJS. We will install some dependencies.&lt;/p&gt;

&lt;p&gt;We installed 3 dependencies here, but &lt;em&gt;express&lt;/em&gt; , &lt;em&gt;dotenv&lt;/em&gt; and &lt;em&gt;isomorphic-unfetch&lt;/em&gt;.&lt;br&gt;
&lt;code&gt;npm i isomorphic-unfetch&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;index.js&lt;/em&gt;&lt;br&gt;
(code snipit)&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%2Fi%2Fzfx4k911nkzmylfpp56x.PNG" 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%2Fi%2Fzfx4k911nkzmylfpp56x.PNG" alt="Alt Text" width="800" height="674"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  The auto updating README
&lt;/h1&gt;

&lt;p&gt;Create README.template.md with replacement tags&lt;/p&gt;

&lt;p&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%2Fi%2Fc98amj1li06kt7cw0jdb.PNG" 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%2Fi%2Fc98amj1li06kt7cw0jdb.PNG" alt="Alt Text" width="392" height="237"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Using Github Actions for AutoUpdate
&lt;/h1&gt;

&lt;p&gt;Now we have created the scripts, we need to automate it to update the README every hour. For this, we will use GitHub's actions.&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%2Fi%2Fkxab5p0mvez27w6micl4.PNG" 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%2Fi%2Fkxab5p0mvez27w6micl4.PNG" alt="Alt Text" width="716" height="840"&gt;&lt;/a&gt;&lt;br&gt;
As a bonus, I also used the Programming Quotes API to get the quote of the hour.&lt;/p&gt;
&lt;h2&gt;
  
  
  what you get
&lt;/h2&gt;

&lt;p&gt;github link: &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mridul037" rel="noopener noreferrer"&gt;
        mridul037
      &lt;/a&gt; / &lt;a href="https://github.com/mridul037/github_profile_markdown" rel="noopener noreferrer"&gt;
        github_profile_markdown
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Hi,&lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/ABSphreak/ABSphreak/master/gifs/Hi.gif"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FABSphreak%2FABSphreak%2Fmaster%2Fgifs%2FHi.gif" width="40px"&gt;&lt;/a&gt; I'm Mridul&lt;/h3&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;A passionate developer from India&lt;/h3&gt;
&lt;/div&gt;

&lt;p&gt;Hi, I'm Mridul Shukla, a Full Stack Developer 🚀 from India, Freelancer, completed masters of computer application from HBTU-kanpur
I have done some internship's onsite and remote. Beside's programming, I enjoy eating food, practicing yoga and watching anime.&lt;/p&gt;
&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/mridul-shukla-899123174/" rel="nofollow noopener noreferrer"&gt;
  &lt;img alt="mriduls LinkdeIN" width="22px" src="https://camo.githubusercontent.com/70a7364e4cab5012925da3ac158a64a992e400152b366dbb71b90fef4b4a1264/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f6e706d2f73696d706c652d69636f6e734076332f69636f6e732f6c696e6b6564696e2e737667"&gt;
&lt;/a&gt;
&lt;a href="https://leetcode.com/mridul37shukla/" rel="nofollow noopener noreferrer"&gt;
  &lt;img alt="mriduls Leetcode" width="22px" src="https://camo.githubusercontent.com/e74fb8798e93217cfa736bb1c28c1e81d5d8794696494ac499d521a618b668dc/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f6e706d2f73696d706c652d69636f6e734076332f69636f6e732f6c656574636f64652e737667"&gt;
&lt;/a&gt;
&lt;a href="https://www.facebook.com/mridul.shukla.524/" rel="nofollow noopener noreferrer"&gt;
  &lt;img alt="mriduls facebook" width="22px" src="https://camo.githubusercontent.com/dcb825420465ad0ee8d75bb3711613917fe21bc39ac822bffd066b9ac911530c/68747470733a2f2f696d672e69636f6e73382e636f6d2f6475736b2f36342f3030303030302f66616365626f6f6b2d6e65772d2d76322e706e67"&gt;
&lt;/a&gt;
&lt;br&gt;

&lt;p&gt;&lt;strong&gt;Quote of the hour:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I never in my wildest dreams would have predicted the evolution of the Internet. And I never would’ve predicted the degree to which corporate influence over the Internet has changed its character over time.&lt;/p&gt;
&lt;p&gt;~ L. Peter Deutsch&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Languages and Tools:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/devicons/devicon/master/icons/react/react-original-wordmark.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdevicons%2Fdevicon%2Fmaster%2Ficons%2Freact%2Freact-original-wordmark.svg" alt="react" width="20" height="20"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer" href="https://github.com/ReactiveX/rxjs/blob/master/docs_app/assets/Rx_Logo_S.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FReactiveX%2Frxjs%2Fraw%2Fmaster%2Fdocs_app%2Fassets%2FRx_Logo_S.png" alt="android" width="20" height="20"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/devicons/devicon/master/icons/cplusplus/cplusplus-original.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdevicons%2Fdevicon%2Fmaster%2Ficons%2Fcplusplus%2Fcplusplus-original.svg" alt="cplusplus" width="20" height="20"&gt;&lt;/a&gt;   &lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/devicons/devicon/master/icons/html5/html5-original-wordmark.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdevicons%2Fdevicon%2Fmaster%2Ficons%2Fhtml5%2Fhtml5-original-wordmark.svg" alt="html5" width="20" height="20"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/devicons/devicon/master/icons/javascript/javascript-original.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdevicons%2Fdevicon%2Fmaster%2Ficons%2Fjavascript%2Fjavascript-original.svg" alt="javascript" width="20" height="20"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/devicons/devicon/master/icons/typescript/typescript-original.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdevicons%2Fdevicon%2Fmaster%2Ficons%2Ftypescript%2Ftypescript-original.svg" alt="typescript" width="20" height="20"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/devicons/devicon/master/icons/mongodb/mongodb-original-wordmark.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdevicons%2Fdevicon%2Fmaster%2Ficons%2Fmongodb%2Fmongodb-original-wordmark.svg" alt="mongodb" width="20" height="20"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/devicons/devicon/master/icons/mysql/mysql-original-wordmark.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdevicons%2Fdevicon%2Fmaster%2Ficons%2Fmysql%2Fmysql-original-wordmark.svg" alt="mysql" width="20" height="20"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/devicons/devicon/master/icons/postgresql/postgresql-original-wordmark.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdevicons%2Fdevicon%2Fmaster%2Ficons%2Fpostgresql%2Fpostgresql-original-wordmark.svg" alt="postgresql" width="20" height="20"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original-wordmark.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdevicons%2Fdevicon%2Fmaster%2Ficons%2Fnodejs%2Fnodejs-original-wordmark.svg" alt="nodejs" width="20" height="20"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/devicons/devicon/master/icons/nginx/nginx-original.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdevicons%2Fdevicon%2Fmaster%2Ficons%2Fnginx%2Fnginx-original.svg" alt="nginx" width="20" height="20"&gt;&lt;/a&gt;&lt;/p&gt;





&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/8934a1c026500f9568da7c978caa44b081db65caa2cfae2972b5f560406fcc9f/68747470733a2f2f692e696d6775722e636f6d2f416668436951372e676966"&gt;&lt;img alt="GIF" width="45%" src="https://camo.githubusercontent.com/8934a1c026500f9568da7c978caa44b081db65caa2cfae2972b5f560406fcc9f/68747470733a2f2f692e696d6775722e636f6d2f416668436951372e676966"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Talking about Personal Stuffs:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;👨🏽‍💻 I’m currently working on &lt;strong&gt;Node.js,React.js,Angular,MySql,Rxjs&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;🌱 I am currently learning &lt;strong&gt;IPFS(peer2peer),docker,Flutter,Data Science&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;👯 I’m looking to collaborate on &lt;strong&gt;anything free and open source&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;🤔 I’m looking for help with Data Structures and Algorithms 😭;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;💬Ask me about react, Angular and nodejs&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;📫 How to reach me: &lt;a href="https://github.com/mridul037/github_profile_markdownmailto:mridulshukla037@gmail.com" rel="noopener noreferrer"&gt;mridulshukla037@gmail.com&lt;/a&gt;;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/190e7d3bb2ff91e8d67d7ddddf458fede09c5f391dc0e66c290c2bb9e84106fa/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f38333648694a633770677a7938694e58436e2f67697068792e676966"&gt;&lt;img width="40%" alt="GIF" src="https://camo.githubusercontent.com/190e7d3bb2ff91e8d67d7ddddf458fede09c5f391dc0e66c290c2bb9e84106fa/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f38333648694a633770677a7938694e58436e2f67697068792e676966"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/92d9c917cb1ec10bb3321bb090672c29c3c02e0e6a97268301a719f689b72951/68747470733a2f2f6769746875622d726561646d652d73746174732e76657263656c2e6170702f6170693f757365726e616d653d6d726964756c3033372673686f775f69636f6e733d7472756526686964655f626f726465723d74727565"&gt;&lt;img width="55%" src="https://camo.githubusercontent.com/92d9c917cb1ec10bb3321bb090672c29c3c02e0e6a97268301a719f689b72951/68747470733a2f2f6769746875622d726561646d652d73746174732e76657263656c2e6170702f6170693f757365726e616d653d6d726964756c3033372673686f775f69636f6e733d7472756526686964655f626f726465723d74727565" alt="mridul"&gt;&lt;/a&gt; &lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Daily News&lt;/strong&gt;&lt;/p&gt;


&lt;ul&gt;

&lt;li&gt;

&lt;p&gt;Ring doorbells…&lt;/p&gt;


&lt;/li&gt;

&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mridul037/github_profile_markdown" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;&lt;br&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%2Fi%2Ff5kq9new4bzq1lpsi8xf.PNG" alt="Alt Text" width="800" height="516"&gt;

</description>
      <category>github</category>
      <category>productivity</category>
      <category>node</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Corona Tracker</title>
      <dc:creator>mridul037</dc:creator>
      <pubDate>Thu, 23 Apr 2020 16:44:17 +0000</pubDate>
      <link>https://forem.com/mridul037/corona-tracker-2695</link>
      <guid>https://forem.com/mridul037/corona-tracker-2695</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mridul037" rel="noopener noreferrer"&gt;
        mridul037
      &lt;/a&gt; / &lt;a href="https://github.com/mridul037/Corona-tracker" rel="noopener noreferrer"&gt;
        Corona-tracker
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Corona-tracker&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;This project was generated with &lt;a href="https://github.com/angular/angular-cli" rel="noopener noreferrer"&gt;Angular CLI&lt;/a&gt; version 9.0.1.
&lt;a rel="noopener noreferrer" href="https://github.com/mridul037/Corona-tracker/blob/master/corona.PNG"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmridul037%2FCorona-tracker%2Fraw%2Fmaster%2Fcorona.PNG" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Development server&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Run &lt;code&gt;ng serve&lt;/code&gt; for a dev server. Navigate to &lt;code&gt;http://localhost:4200/&lt;/code&gt;. The app will automatically reload if you change any of the source files.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Code scaffolding&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Run &lt;code&gt;ng generate component component-name&lt;/code&gt; to generate a new component. You can also use &lt;code&gt;ng generate directive|pipe|service|class|guard|interface|enum|module&lt;/code&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Build&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Run &lt;code&gt;ng build&lt;/code&gt; to build the project. The build artifacts will be stored in the &lt;code&gt;dist/&lt;/code&gt; directory. Use the &lt;code&gt;--prod&lt;/code&gt; flag for a production build.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Running unit tests&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Run &lt;code&gt;ng test&lt;/code&gt; to execute the unit tests via &lt;a href="https://karma-runner.github.io" rel="nofollow noopener noreferrer"&gt;Karma&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Running end-to-end tests&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Run &lt;code&gt;ng e2e&lt;/code&gt; to execute the end-to-end tests via &lt;a href="http://www.protractortest.org/" rel="nofollow noopener noreferrer"&gt;Protractor&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Further help&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;To get more help on the Angular CLI use &lt;code&gt;ng help&lt;/code&gt; or go check out the &lt;a href="https://github.com/angular/angular-cli/blob/master/README.md" rel="noopener noreferrer"&gt;Angular CLI README&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mridul037/Corona-tracker" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>angular</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>rxjs</category>
    </item>
    <item>
      <title>Make your Angular App faster using Dynamic import</title>
      <dc:creator>mridul037</dc:creator>
      <pubDate>Wed, 22 Apr 2020 15:33:25 +0000</pubDate>
      <link>https://forem.com/mridul037/dynamic-import-in-angular-3eho</link>
      <guid>https://forem.com/mridul037/dynamic-import-in-angular-3eho</guid>
      <description>&lt;h1&gt;
  
  
  Tips to make your angular app faster:
&lt;/h1&gt;

&lt;p&gt;while importing your module using lazy loading helps&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{ 𝑝𝑎𝑡ℎ: 'ℎ𝑜𝑚𝑒', 𝑐𝑜𝑚𝑝𝑜𝑛𝑒𝑛𝑡: 𝐻𝑜𝑚𝑒𝐶𝑜𝑚𝑝𝑜𝑛𝑒𝑛𝑡;}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;To using loadChildren:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{𝑝𝑎𝑡ℎ: 'ℎ𝑜𝑚𝑒', 𝑙𝑜𝑎𝑑𝐶ℎ𝑖𝑙𝑑𝑟𝑒𝑛: './ℎ𝑜𝑚𝑒/ℎ𝑜𝑚𝑒.𝑚𝑜𝑑𝑢𝑙𝑒#𝐻𝑜𝑚𝑒𝑀𝑜𝑑𝑢𝑙𝑒'}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;to make even better use dynamic import() function in Javascript.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;br&gt;
    𝑝𝑎𝑡ℎ: 'ℎ𝑜𝑚𝑒',&lt;br&gt;
    𝑙𝑜𝑎𝑑𝐶ℎ𝑖𝑙𝑑𝑟𝑒𝑛: () =&amp;gt; 𝑖𝑚𝑝𝑜𝑟𝑡('./ℎ𝑜𝑚𝑒/ℎ𝑜𝑚𝑒.𝑚𝑜𝑑𝑢𝑙𝑒').𝑡ℎ𝑒𝑛(𝑚 =&amp;gt; &lt;br&gt;
    𝑚.𝐻𝑜𝑚𝑒𝑀𝑜𝑑𝑢𝑙𝑒)&lt;br&gt;
  },&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;import statement return a promise. you read more about in given link.&lt;/p&gt;

&lt;p&gt;link:: &lt;a href="https://javascript.info/modules-dynamic-imports" rel="noopener noreferrer"&gt;https://javascript.info/modules-dynamic-imports&lt;/a&gt; &lt;/p&gt;

</description>
      <category>angular</category>
      <category>javascript</category>
    </item>
    <item>
      <title>count number of word in string using javascript.</title>
      <dc:creator>mridul037</dc:creator>
      <pubDate>Wed, 20 Nov 2019 15:01:46 +0000</pubDate>
      <link>https://forem.com/mridul037/count-number-of-word-in-string-using-javascript-1g1b</link>
      <guid>https://forem.com/mridul037/count-number-of-word-in-string-using-javascript-1g1b</guid>
      <description>&lt;p&gt;function countWords(str) {&lt;br&gt;
let c=0;&lt;br&gt;
for (x in str){&lt;/p&gt;

&lt;p&gt;if(str[x]==" ")&lt;/p&gt;

&lt;p&gt;c++;&lt;/p&gt;

&lt;p&gt;}&lt;br&gt;
    return c+1;&lt;br&gt;
}&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
