<?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>DEV Community: Omer Sayem</title>
    <description>The latest articles on DEV Community by Omer Sayem (@sayem_omer).</description>
    <link>https://dev.to/sayem_omer</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%2F322935%2Fa42c31d3-0225-4f88-8256-9e7625d165c1.jpg</url>
      <title>DEV Community: Omer Sayem</title>
      <link>https://dev.to/sayem_omer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sayem_omer"/>
    <language>en</language>
    <item>
      <title>Infrastructure as code: part-1 (Terraform to emancipate?)</title>
      <dc:creator>Omer Sayem</dc:creator>
      <pubDate>Sat, 22 May 2021 19:28:50 +0000</pubDate>
      <link>https://dev.to/sayem_omer/infrastructure-as-code-part-1-terraform-to-emancipate-4n9j</link>
      <guid>https://dev.to/sayem_omer/infrastructure-as-code-part-1-terraform-to-emancipate-4n9j</guid>
      <description>&lt;p&gt;Lately, I have been working on a project, which is based on cloud-native architecture (AWS) and I was in a dilemma about the perfect IaC solution. Despite going into detailed project requirements,simply added the draft diagram below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fgnn03meubvnupf4qzj80.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fgnn03meubvnupf4qzj80.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, from the above diagram, it is quite conspicuous that this system is based on some AWS components and it's a messaging system. Firstly, it maybe seems overkill to think about the IaC solution deeply. However, In the long run, it can save a ton of deployment time. Thus, I decided to leverage the IasC solutions, which codifies the entire architecture. There are several tools for managing serverless applications, such as AWS SAM, serverless framework, and terraform. However, for the sake of minimality, I will decide between SAM and serverless framework in this part.&lt;/p&gt;

&lt;p&gt;On the one hand, the serverless framework is a provider-agnostic solution. Thus, its possible to deploy FaaS functions into multiple serverless vendors. Interestingly, the Deployment process is magical (Creates s3 buckets to store artifacts automatically) in SF, and indeed, it's easy. Offline testing needs to install an extra package(serverless offline) and does not need a docker.&lt;/p&gt;

&lt;p&gt;On the other hand, as SAM is an abstract layer of AWS cloud formation, it is easy for running AWS users. Moreover, it consists of fewer boilerplate.SAM Local creates the same environment as Lambda, which spins up local API gateway and then runs function in docker. Finally, it has deep integration of AWS tools for debugging, testing, and development such as  AWS Serverless Application Repository, AWS Toolkit for Visual Studio Code, AWS Cloud9 IDE, Jenkins plugin.&lt;/p&gt;

&lt;p&gt;Considering the above options with my solution, I decided to stick with SAM:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Owing to this solution is utterly based on AWS, it will be overkill to use a multi-cloud solution tool.&lt;/li&gt;
&lt;li&gt;Development and testing with the more AWS-like tools with SAM may ease the process.&lt;/li&gt;
&lt;li&gt;Local development will be more likely to AWS Lambda.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, until now, AWS sam looks like the perfect solution. Is it really? What about if the business wants to scale it beyond serverless applications? Also, for a big project Cloudformation template is manageable? ( I will give my opinion on part 2, till share your experience )&lt;/p&gt;

&lt;p&gt;P.S. Just to ensure, I might provide the entire solution on Github once it is completed.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>serverless</category>
    </item>
    <item>
      <title>My First three month as a Machine Learning Engineer</title>
      <dc:creator>Omer Sayem</dc:creator>
      <pubDate>Mon, 09 Nov 2020 17:12:21 +0000</pubDate>
      <link>https://dev.to/sayem_omer/my-first-three-month-as-a-machine-learning-engineer-24d7</link>
      <guid>https://dev.to/sayem_omer/my-first-three-month-as-a-machine-learning-engineer-24d7</guid>
      <description>&lt;p&gt;It's been about three months since I'm working as an MLE. The most frequent question I've been asked is that I don't have any ML research, how I am working! This is true that I've been working as an SWE since early 2019 and I have research in a distributed system for the automotive industry and yet not published! What I experienced in these three months is there is a good borderline between MLE and ML researchers. and obviously MLE vs SWE.&lt;/p&gt;

&lt;p&gt;Firstly in SWE, everything is practical, you get immediate feedback on everything you do, It may be good or bad  ! whereas MLE is extremely ambiguous. The problem might be in data cleaning, hyperparameters tuning, wrong models selection, or even wrong data for training, etc.&lt;/p&gt;

&lt;p&gt;Secondly, ML researcher are smart people who can build interesting models, insights, predictions and also use some libraries on the other hand  MLE can write maintainable, sustainable code, efficient way to store the data, and deploy the models so that it can be accessed from almost every machine and at the same time should understand the models, basic understanding of the maths behind the model.&lt;/p&gt;

&lt;p&gt;These are my experience, correct me if I am wrong. One thing I mentioned first about academic research or advance higher degree. To some extent, I think it will be beneficial to do Msc in applied mathematics or specialization in ML if an experienced MLE wants to pursue more.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Ephemeral Diffie-Hellman Algorithm, Handshake you need even in pendamic!</title>
      <dc:creator>Omer Sayem</dc:creator>
      <pubDate>Sun, 05 Jul 2020 17:33:00 +0000</pubDate>
      <link>https://dev.to/sayem_omer/ephemeral-diffie-hellman-algorithm-handshake-you-need-even-in-pendamic-4dn0</link>
      <guid>https://dev.to/sayem_omer/ephemeral-diffie-hellman-algorithm-handshake-you-need-even-in-pendamic-4dn0</guid>
      <description>&lt;p&gt;Did you ever think that how your TCP/IP connection is secured? TCP/IP connection requires sync and acknowledgment sending data between server to the client also known as a handshake.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NSN01xYg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1mjmjr2gyy0ryiy7un6y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NSN01xYg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1mjmjr2gyy0ryiy7un6y.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Communication between two computers in TCP/IP connection needs to be secured when it comes to sensitive private data. Only the sender and receiver should decipher the data with a shared key. So this is the kinda idea.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U-xPOZbu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3o8xqm0rcj8yczksfw21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U-xPOZbu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3o8xqm0rcj8yczksfw21.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To secure the HTTP connection we came with the idea of an SSL/TLS connection. SSL/TLS connection uses encryption methods to secure the connection. So far we use two types of encryption, symmetric and asymmetric encryption. symmetric encryption uses a strong block cipher to encrypt and decrypt data. On the other hand, asymmetric encryption uses public and private key methods to secure connection. Sounds confusing right? if your key is public how can it ensure privacy!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IrT9Ex2j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/f9u8tf8ack52cgidacbt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IrT9Ex2j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/f9u8tf8ack52cgidacbt.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Relax! Don't panic. A public key is essential by which you can cipher the message and broadcast it with a public key, you can decipher the message if you only have the private key and it kept secret. So it's like the two sides locked door. You may have the public key but can't open the door if it's locked inside with private key! Interesting right? more then 52% of websites today use public-key methods to secure connection. but whats the underlining maths or engineering behind it?&lt;/p&gt;

&lt;p&gt;Suppose Alal and Dulal are brothers. they want to share there location information secrecy so their father can't find them. let's see whats they can do with Diffie-helmen,&lt;/p&gt;

&lt;p&gt;Step 1: Alal, Dulal agrees to share a share public key pair (G,p), where G = 9, p = 23.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const power = 23;
const generator = 9;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;step 2: Alal's Private key a = 4. And Dulal's private key b=3&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const alals_private = 4;
const dulals_private = 3;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;step 3: Alal and dulal compute public values using&lt;br&gt;
alals_public =(9^4 mod 23) = (6561 mod 23) = 6&lt;br&gt;
dulals_public = (9^3 mod 23) = (729 mod 23)  = 16&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const alals_shared_public = secretGenerator(generator,alals_private,power);
const dulals_shared_public = secretGenerator(generator,dulals_private,power);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;step 4: Alal and Dulal exchange public numbers&lt;/p&gt;

&lt;p&gt;step 5: Alal receives public key 16 and&lt;br&gt;
        Dulal receives public key 6&lt;/p&gt;

&lt;p&gt;Step 6: Alal Dulal decipher the key with their private key&lt;br&gt;
       Alal:  ka = 16^4 mod 23 = 65536 mod 23 = 9&lt;br&gt;
       Dulal:    kb = 6^3 mod p = 216 mod 23 = 9&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const shared_secret_of_alal = secretGenerator(dulals_shared_public,alals_private,power);
const shared_secret_of_dulal = secretGenerator(alals_shared_public,dulals_private,power);

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

&lt;/div&gt;



&lt;p&gt;finally, they got there shared secret 9!&lt;/p&gt;

&lt;p&gt;completed code can be found here :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function secretGenerator(generator,power,mod_number){

  return power === 1 ? generator : Math.pow(generator,power)%mod_number ;

}

(function DH(){

const power = 23;
const generator = 9;

const alals_private = 4;
const dulals_private = 3;

const alals_shared_public = secretGenerator(generator,alals_private,power);
const dulals_shared_public = secretGenerator(generator,dulals_private,power);

const shared_secret_of_alal = secretGenerator(dulals_shared_public,alals_private,power);
const shared_secret_of_dulal = secretGenerator(alals_shared_public,dulals_private,power);

console.log(shared_secret_of_alal,shared_secret_of_dulal);

})();

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

&lt;/div&gt;



&lt;p&gt;So the final thought is if you have the public keys G and P and the shared public key's you can't decipher the secret because you don't have the private key a and b. And for a large number, this logarithmic calculation is computationally costly.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>STUN,TURN and ICE servers - NAT traversal for WebRTC</title>
      <dc:creator>Omer Sayem</dc:creator>
      <pubDate>Wed, 10 Jun 2020 15:10:45 +0000</pubDate>
      <link>https://dev.to/sayem_omer/stun-turn-and-ice-servers-nat-traversal-for-webrtc-5e29</link>
      <guid>https://dev.to/sayem_omer/stun-turn-and-ice-servers-nat-traversal-for-webrtc-5e29</guid>
      <description>&lt;p&gt;Because of the absence of IP address space and the need to keep a hidden system's engineering obscure to outside clients, NATs are utilized. These decipher inside private IP delivers to outside open IP addresses.Approaching traffic into the private system is steered through an open location restricting that happens on the NAT gadget. This coupling is made when an inside machine with a private IP address attempts to get to an open IP address (through the NAT).&lt;/p&gt;

&lt;p&gt;VoIP and WebRTC requires to pass media packets like video/audio into two peers which needs to pass external packets into internal networks.For these situation webRTC needs mechanisms like STUN , TURN and ICE server. Whats these do ! going forward.&lt;/p&gt;

&lt;p&gt;We know webRTC is p2p connection. So in a private network connection between two client don't need any server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwa2t5dse8ygkw7det6z1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwa2t5dse8ygkw7det6z1.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But when a client A from private network need to connect to Client B who is in a public network , it gets block by NAT firewall and it doesn't know the public ip to connect. TO rescue first see how STUN server do.&lt;/p&gt;

&lt;p&gt;Client query the STUN server for his public ip and STUN provides public IP.With this provided public IP Client A can connect to Client B .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F46cy9n130sjgia38kdc0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F46cy9n130sjgia38kdc0.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SO, problem solved! Not yet ! STUN servers doesn't provide same public IP if the client call in different servers. so the bindings is not unique. Thats a problem ! another life-saving mechanism is TURN server.&lt;/p&gt;

&lt;p&gt;TURN server actually don't provide any Public IP , its relays media . it takes media from client A and provide to client B , without looking the packet. Compare to STUN server it's very much operation expensive. To reduce cost both STUN and TURN can be use in case of STUN server failure . &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fby0mk3kua3c24t3skgg2.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fby0mk3kua3c24t3skgg2.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These STUN and TURN servers has dawbacks.STUN is backend inexpensive but doesn't work always . TURN server is reliable but backend expensive .Finally ICE servers comes handy !&lt;/p&gt;

&lt;p&gt;What ICE server do , its holds everything , its a collector . It collects local IP , STUN server's reflexive IP , TURN sever's relay media addess and stored in a remore peer via Session Description Protocol (SDP) . WebRTC client receives the ICE address of itself and the peers and send media through connectivity checking .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F73t3r526rjvr4cfcu4wi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F73t3r526rjvr4cfcu4wi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thats all upto ICE server which is used in most of the WebRTC implimentation . Good news there more optimized WebRTC Natting named ICE Trickle . Maybe talks about it some other day . Happy learning !&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
