<?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: Microsoft Learn Student Chapter</title>
    <description>The latest articles on DEV Community by Microsoft Learn Student Chapter (@mlsc_tiet).</description>
    <link>https://dev.to/mlsc_tiet</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%2Forganization%2Fprofile_image%2F5972%2Fdfb26bea-c6af-4190-99d6-c735ee9dffa5.png</url>
      <title>DEV Community: Microsoft Learn Student Chapter</title>
      <link>https://dev.to/mlsc_tiet</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mlsc_tiet"/>
    <language>en</language>
    <item>
      <title>The Effects of Generative AI on Job Markets</title>
      <dc:creator>SparshRastogi</dc:creator>
      <pubDate>Thu, 13 Apr 2023 17:48:38 +0000</pubDate>
      <link>https://dev.to/mlsc_tiet/the-effects-of-generative-ai-on-job-markets-3267</link>
      <guid>https://dev.to/mlsc_tiet/the-effects-of-generative-ai-on-job-markets-3267</guid>
      <description>&lt;p&gt;The recession has recently hit the economy hard, and every primary industry is experiencing a wave of layoffs. There is a lot of panic among people about job prospects.Simultaneously, the recent developments in AI and the improvement in Large Language Models(LLMs) like ChatGPT, Dall-E, etc., have exaggerated this panic and fear. The old stories of AI replacing humans again make it to the headlines.In this blog, I will discuss the significant impacts of AI technologies on the job market.&lt;br&gt;
The impact of these technologies will not be uniform. It will prove more competitive for some roles than others. Broadly, we can classify them into two major categories: low-level and high-level jobs.&lt;/p&gt;

&lt;p&gt;Talking about low-level jobs are jobs that focus mainly on the execution of a single, well-defined task. It consists of a fixed cycle of repetitive tasks that, with the help of technological advances, can be automated, thus threatening the employment of those engaged in such jobs. For example, in web development, low-level tasks such as designing a simple website with a bare front end and no primary back end had a lot of scope for freelancing. With the advent of AI, clients can accomplish this independently.&lt;/p&gt;

&lt;p&gt;Now let's talk about high-level jobs. These tasks require more sophisticated skills, mainly focused on innovation and critical thinking. Though the latest AI projects have some creativity, it is far away to mimic humans in such domains. Since low-level tasks can now be automated, organizations focus more on hiring individuals to help them innovate, build better products, and provide an edge over their competitors.&lt;/p&gt;

&lt;p&gt;LLMs can make a basic front-end by revising the web development scenario discussed earlier. Still, they need help to make a fully customized, functional, and integrated website using advanced tools. So, AI will not be able to replace developers with specialization and expertise in some of the advanced technologies. AI could be even more productive for advanced developers since they can accomplish several low-level tasks in less time, devoting more time and effort to innovative and high-output studies.&lt;/p&gt;

&lt;p&gt;Another aspect of this story is whether this technology will be a curse or boon for us ultimately depends on our mindset. Crisis brings along its opportunities. We met with similar skepticism when the Digital and Industrial Revolutions kicked off. In the initial stages, the most novel concepts, like mechanization, mass production, and digitization, were believed to lead to unemployment. Still, instead, they spurred exponential growth, employing a large chunk of the population. They also created a room for innovation that produced life-changing inventions like the World Wide Web, smartphones, search engines, social media platforms, etc., ultimately making our lives easier and better. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---OPOPlPU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iu9hh0xopn3wzu33rfvr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---OPOPlPU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iu9hh0xopn3wzu33rfvr.jpg" alt="Image description" width="800" height="435"&gt;&lt;/a&gt;&lt;br&gt;
Likewise, this revolution of Industry 4.0 also has immense potential. Whether it will be productive or disruptive depends on our mindset and adaptability to change. Change is the only constant in life.&lt;/p&gt;

&lt;p&gt;"Man cannot discover new oceans unless he dares to lose sight of the shore."Similarly, one can only grow if one dares to move out of their comfort zones and adapt to change. A crisis presents both a threat as well an opportunity. Some of today's most successful businesses, like Apple, Disney, Ford, etc., were born during points of change like the Digital Revolution, the Great Depression, and the Second World War. The current times also offer similar possibilities, &lt;/p&gt;

&lt;p&gt;As JFK rightly said, "&lt;em&gt;Do not pray for easy lives. Pray to be stronger men.&lt;/em&gt;" &lt;/p&gt;

&lt;p&gt;So, AI also depends on the mindset and ability to exploit it to our advantage, determining whether it is detrimental or beneficial for us. For some of us, it could help achieve more productivity and better results by automating low-level and time-consuming tasks, whereas, for others who won't learn to adapt to this change, it will take up their jobs.&lt;/p&gt;

&lt;p&gt;Another lesson we can learn from this experience is that the tech industry is growing exponentially, and the technologies are coming up and also getting outdated in a short time. So we need to upskill ourselves constantly. It emphasizes the need for lifelong learning and upskilling compared to the previous scenario, where the understanding done during school or college used to work throughout the career. And this aspect is the one which is a significant contributor to such high growth of the industry. Promoting innovative competition provides more growth opportunities and thus leads to rapid advancements.&lt;br&gt;
It is up to us as individuals to use it best.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>chatgpt</category>
      <category>career</category>
    </item>
    <item>
      <title>DALL-E 2: Revolutionizing Image Creation with AI</title>
      <dc:creator>Anuvind Walia</dc:creator>
      <pubDate>Fri, 03 Mar 2023 13:53:13 +0000</pubDate>
      <link>https://dev.to/mlsc_tiet/dall-e-2-revolutionizing-image-creation-with-ai-46ch</link>
      <guid>https://dev.to/mlsc_tiet/dall-e-2-revolutionizing-image-creation-with-ai-46ch</guid>
      <description>&lt;p&gt;“Any sufficiently advanced technology is indistinguishable from magic.”  -Arthur C. Clarke.&lt;/p&gt;

&lt;p&gt;In this rapidly evolving world of technology, where software like ChatGPT is the current talk of the town, AI or Artificial Intelligence emerges as the most happening and prominent field. I was intrigued to learn about AI and its counterpart, Machine Learning after ChatGPT shook the tech world with its immense capabilities. Set on to explore more, I stumbled across an AI software called DALL-E, which I found pretty interesting. Here’s why - &lt;/p&gt;

&lt;p&gt;DALL-E 2 is an AI model from OpenAI that can take simple text descriptions like “a koala dunking a basketball” and turn them into photorealistic images and art that have never existed. In addition, DALL-E 2 can also edit and retouch photos. Based on a simple description, it can fill in or replace part of an image with AI-generated imagery that blends with the original, a process referred to as “in-painting.” It can also extend an image beyond its borders, keeping the theme, colors, and context in the picture commonly called “outpainting.” It can even start with an image as an input and create variations with different perspectives, styles, and mediums.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VVIsMPAT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fqe901l4pyfy7pzmb7l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VVIsMPAT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fqe901l4pyfy7pzmb7l.png" alt="DALL-E generated image" width="392" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In January 2021, OpenAI introduced this technology as DALL-E. Its successor, DALL-E 2, further increased its functionality with higher resolution, greater comprehension, and newer capabilities. The textual input is a “prompt” that cues the model to generate something. DALL-E was created by training a neural network on images and their text descriptions, by scraping millions of web pages, and using a version of GPT-3 modified specifically to create images. Through deep learning, it understands individual objects, like penguins and ice creams, and learns from relationships between objects. So, when you ask for a “realistic image of a penguin eating ice cream under the sun,” it knows how to create something with a connection to another object or action. This is what the DALL-E-generated images look like, depicting the same object in different styles while keeping the prompt in focus.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QN06__tn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9t8yrkxsk4wpeeyswvew.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QN06__tn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9t8yrkxsk4wpeeyswvew.png" alt="Image description" width="800" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To utilize this tool efficiently, one must learn to generate prompts that yield the desired output, a process called “prompt engineering”. For this, the prompts must be kept descriptive, with the context of the items adequately described. You can also mention styles like ‘pixel art,’ ‘digital art,’ etc., along with the styles of famous artists such as Van Gogh or Picasso, or the medium of the artwork, such as oil pastel or watercolor. For example, when I wanted a new wallpaper for my phone, I asked DALL-E for “a synth-wave style image of a motorcyclist riding on the highway towards the city, digital art.” And the results were exactly what I had pictured in my head.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M1Bvk-Z---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5nig74hs2hz8wl8mymr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M1Bvk-Z---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5nig74hs2hz8wl8mymr.png" alt="Image description" width="800" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pretty cool, huh?&lt;/p&gt;

&lt;p&gt;The research behind DALL-E’s technology has three primary outcomes:&lt;br&gt;
First, it can help people express themselves visually in ways they may not have been able to before. It eases the hassle of creating visual ideas, designs, and logos which is often time-consuming. Second, an AI-generated image can tell us much about whether the system understands us or repeats what it has been taught. It shows us if AI constantly learns and improves through prompts and feedback. Third, DALL-E helps humans understand how advanced AI systems see and understand our world. OpenAI aims to give language models a better grasp of the everyday concepts humans use to make sense of things. This is a critical part of developing AI that’s useful and safe. &lt;/p&gt;

&lt;p&gt;Though similar image-generating AI software is available, Midjourney is the best alternative available to DALL-E. The difference, however, is that Midjourney prefers creating more images in painted art rather than photorealistic. It also allows us to change the image's aspect ratio but does not allow features such as inpainting. Both are powerful AI that generate images from text, but having worked with both, I use DALL-E more often due to its added functionality.&lt;/p&gt;

&lt;p&gt;A primary ethical concern about DALL-E 2 and similar image generation models is that they could be used to generate and propagate deep fakes and similar misinformation. To mitigate this, the software rejects prompts involving public figures and uploads containing human faces. Prompts containing explicit content are blocked, and uploaded images are analyzed to detect offensive material, which however, is not entirely foolproof. Another concern is that such AI could cause technological unemployment for artists, photographers, and graphic designers due to their accuracy and popularity. However, I believe such tools only aid one’s creative endeavors. Art undoubtedly can never be replaced with AI-generated images. Still, the successful artist of the future would be the one who would incorporate such technology in his creations, as it would enable him to do more than what he was capable of before. It can help art companies and businesses increase profits while reducing costs. The rapid progress in AI technology shows no signs of slowing down. With significant companies investing millions in AI software, the future economy will be shaped by such systems and the people that employ them.&lt;/p&gt;

&lt;p&gt;Researchers and tech companies are already racing toward the next stage of generative AI art, which will soon hit the market. Meta, for example, has released examples of its text-to-video AI currently in development. Google, on the other hand, has unveiled Dream-Fusion, a text-to-3D AI. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l1K_fp_y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fojf0dx3w6twyofrg4l9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l1K_fp_y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fojf0dx3w6twyofrg4l9.png" alt="Image description" width="800" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DALL-E 2 may be powerful, but it does have certain limitations. If it’s taught with incorrectly labelled objects, like a truck labelled “car,” and a user tries to generate a car, DALL-E may create…a truck. It’s almost like talking to a person who learned the wrong word for something. Gaps in its training can also limit DALL-E. For example, it may understand what an ocean or a lake is but wrongly interpret a “water body” if it hasn’t learned what it is. Besides the image-generation-related limitations, DALL·E 2 also has inherent biases due to the skewed nature of data collected from the internet. It has gender-biased occupation representations and generates predominantly western features for many prompts.  But what's exciting about the approach used to train DALL-E is that it can remember what it learned from various other labelled images and then apply it to a new image. DALL-E exemplifies how imaginative humans and clever systems can work together to make new things – amplifying our creative potential.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>openai</category>
    </item>
    <item>
      <title>Building a Tool/Web-API in Rust to generate and serve audio files— Part I</title>
      <dc:creator>Akshat Jaimini</dc:creator>
      <pubDate>Fri, 03 Feb 2023 11:57:25 +0000</pubDate>
      <link>https://dev.to/mlsc_tiet/building-a-toolweb-api-in-rust-to-generate-and-serve-audio-files-part-i-51np</link>
      <guid>https://dev.to/mlsc_tiet/building-a-toolweb-api-in-rust-to-generate-and-serve-audio-files-part-i-51np</guid>
      <description>&lt;p&gt;Well, at some point, we all used YouTube to mp3 conversion websites like ytmp3, etc., but did you ever want to get even slightly close to making something like that? That is what I wanted to do. So, I started this simple project called rytaud. In part, I made a simple web server that utilizes the youtube-dl CLI tool to get the mp3 file and serve it to the user.&lt;/p&gt;

&lt;p&gt;Setting up the server&lt;br&gt;
To set up the web server, I used the actix-web framework in rust and set up the required endpoints with their function calls. I used actix because initially, I wanted to keep my project simple, and writing my server configuration would have deviated me from the actual aim. While developing anything on your own, you should try to follow the KISS principle as much as possible; you can always customize things later.&lt;/p&gt;

&lt;p&gt;Here is the code for my server:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;As you can see, I have set up three endpoints, out of which the delete_vid endpoint is not of concern. The endpoint POST ‘/download_audio’ triggers the youtube-dl utility interface that we will look into later. It returns a reference to the ‘/audio’ endpoint, which is an actix_files endpoint acting as a file hosting service in a way.&lt;/p&gt;

&lt;h2&gt;
  
  
  CLI interfacing
&lt;/h2&gt;

&lt;p&gt;To interface with the youtube-dl CLI, I used the std::Command library available in rust as follows:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
This function calls the youtube-dl CLI and generates the mp3 file according to the key provided by the user. This file is being stored in the root of the program as of now. The HTTP server returns the path as ‘/audio/file.mp3’, which the user can then access to use the audio file.

&lt;h2&gt;
  
  
  Containerization
&lt;/h2&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
I also decided to containerize the application and set up a GitHub workflow to automatically build and deploy the image as a package on GitHub for public use. The docker image multi-stage stage was constructed with the rust image to compile the project and a Debian bullseye image to run the compiled program.

&lt;h2&gt;
  
  
  Goals for the next stages
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;u&gt;Improved Storage&lt;/u&gt;
&lt;/h3&gt;

&lt;p&gt;Storing multiple audio files on a single system in a container is not a good practice. Still, since I was unable to get any other cloud storage services, I decided to go with it and instead implement a background service that deletes all the MP3 files in 24 hours, which can be seen in the code for the server, but remember the project is still in its initial stages. As of now, I need to find a storage service that abstracts all of this for me or design something like that on my own.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;u&gt;Writing the download tool&lt;/u&gt;
&lt;/h3&gt;

&lt;p&gt;youtube-dl is a fantastic tool, but the end goal of this project is to implement that utility in my way to give me more control and optimize the entire process because the speed at which youtube-dl downloads the file is pretty slow, and it affects the overall performance of the API. The tool should also allow users to get audio from other platforms as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;u&gt;Reduce the Image size&lt;/u&gt;
&lt;/h3&gt;

&lt;p&gt;The docker image for the project is huge as of now, around 912 MB. I need to find a way to reduce this size further. Also, I want to set up an orchestration service for deploying projects like Kubernetes, but before that, I need to fix the problems mentioned above to optimize my builds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;So that was it for Part I. The project needs more improvements. I hope you guys test out the project. Suggestions and feedback are always welcome. Please check out the &lt;a href="https://github.com/destrex271/rytaud" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt; if you wish to contribute to the project. A &lt;a href="https://github.com/destrex271/rytaud/pkgs/container/rytaud" rel="noopener noreferrer"&gt;docker image&lt;/a&gt; for the same is available on github packages, so if you want to look into that you are welcome to do so.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Is ChatGPT the dawn of a new Google?</title>
      <dc:creator>Once-kaur</dc:creator>
      <pubDate>Sat, 07 Jan 2023 10:24:55 +0000</pubDate>
      <link>https://dev.to/mlsc_tiet/is-chatgpt-the-dawn-of-a-new-googleonce-kaur-6fo</link>
      <guid>https://dev.to/mlsc_tiet/is-chatgpt-the-dawn-of-a-new-googleonce-kaur-6fo</guid>
      <description>&lt;p&gt;ChatGPT, launched by OpenAI on  30 November 2022, is a new buzz in the tech society, even becoming a worrying issue by the world's most powerful search engine, Google. So, is it worth looking at?&lt;/p&gt;

&lt;p&gt;In the beta version, it is a natural language processing tool driven by AI tech that generates human-like interactive conversations. Based on the data set it has been trained on, it can generate programs, articles, emails, and much more.&lt;/p&gt;

&lt;p&gt;While being compared with google, the problem arises at the very stage of accessing it. As a user, I had to google ChatGPT itself through &lt;em&gt;&lt;a href="https://dev.tourl"&gt;chat.openai.com&lt;/a&gt;&lt;/em&gt;.Once you sign in, you can quickly start chatting away with ChatGPT. This stands as the first flag. With such an upcoming technology competing head-on with the very search engine of the era, does it stand a chance? Leaving the competition aside, I went ahead to ask a few questions. This was a fundamental trial of the technology. &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%2Fuploads%2Farticles%2Fu7dqc0s0wgxzp95v28q5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu7dqc0s0wgxzp95v28q5.jpg" alt="ChatGpt answer to how to centre a div" width="800" height="442"&gt;&lt;/a&gt;&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%2Fuploads%2Farticles%2Fhaoqxnwxcfzy7m9gdyss.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhaoqxnwxcfzy7m9gdyss.jpg" alt="answer to write a 4 line poem on google" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While these answers were impressive and concise, I was not informed about the source of these answers. With no references, I could not know the content's plausibility. Moreover, as a learner, the knowledge was limited to the solutions provided. ChatGPT benefits corporate workers who want more efficiency but do not need bare references or users who wish to have a quick document ready in just a few clicks. It acts as a suitable medium for users who want to have a headstart idea for any piece of text that they wish to begin with. And just to humor them, it works brilliantly for people working at the last moment. A boon for procrastinators!&lt;/p&gt;

&lt;p&gt;But coins have sides. One of the problems with ChatGPT is that it does not provide any way to open up links such as YouTube or Spotify but simply redirects to Google, which isn't a very noble choice, with Google being the very competition. Furthermore, it doesn't provide references or related search options for the answers it can't answer directly.&lt;/p&gt;

&lt;p&gt;ChatGPTs answers can be manipulated easily as it’s an AI trained on a particular data set which certainly depends on the organizations providing the data. Moreover, specific solutions need specific questions. You can't put a single keyword and expect the AI to guess what you want. As an engineering student, I often use converters and online calculators that are unfortunately not a service provided by ChatGPT; instead, it gives you a long list of steps to calculate it on your own. If you want to get the latest news, weather conditions, etc., you can't because it needs to be updated frequently. Information subject to change often is one of ChatGPT’s Achilles heels. These shortcomings of this language model just add to a long list.&lt;/p&gt;

&lt;p&gt;In conclusion, it is not fair to compare Google to ChatGPT. ChatGPT is just a language model, while Google has an entirely different working model as it provides links to various info sources sorted according to most visited and relevant. It includes information regarding an academic question and the ability to access services like Amazon, local organizations' websites, calculators, regularly updated news websites, and even this blog. For an upcoming language model, ChatGPT provides unique answers to queries like poems on avid topics, screenplays, quick emails for cooperative works, and quick responses to simple questions. It proves to be a solid competition to Google in that particular domain.&lt;/p&gt;

&lt;p&gt;According to some sources, Open AI is also working on web-based AI; the combination of both ChatGPT and WebGPT can potentially replace already established search engines, including Google. Google might also introduce its own version of ChatGPT, which will not harm the current business model, by clicking advertisements on the websites hosted on google. In the end, whether it be Google or OpenAI, the revolution in the tech industry dominated by AI is inevitable and unarguably now the near future.&lt;/p&gt;

</description>
      <category>oop</category>
      <category>dotnet</category>
      <category>discuss</category>
    </item>
    <item>
      <title>So I tried Carbon...</title>
      <dc:creator>Aryan Garg</dc:creator>
      <pubDate>Fri, 09 Sep 2022 05:22:03 +0000</pubDate>
      <link>https://dev.to/mlsc_tiet/so-i-tried-carbon-3k7g</link>
      <guid>https://dev.to/mlsc_tiet/so-i-tried-carbon-3k7g</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Carbon &lt;em&gt;(/ˈkɑːb(ə)n/)&lt;/em&gt; &lt;em&gt;noun.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The chemical element of atomic number 6, a non-metal with two main forms (diamond and graphite), occurs in impure form in charcoal, soot, and coal.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Carbon isn't just atomic number 6, haunting us in General Organic Chemistry, but now is a programming language developed by google to eventually be used over the Legendary (and age-old) language C++ *Dramatic music intensifies*. &lt;br&gt;
With the help of a few straightforward programs written in this article, we will try to understand and learn the language. We would also try to understand why Google (did I forget to mention Google made the language) even needed to create Carbon and why it might be time for our old friend C++ to bid farewell.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Carbon?
&lt;/h2&gt;

&lt;p&gt;C++ is a monster of a programming language. First built in 1985, the creator of C++ (Bjarne Stroustrup) has stated, "Within C++, there is a much smaller and cleaner language struggling to get out." The problem with changing or evolving C++ today is that it is an essential part of most code bases that it doesn't make sense to dramatically change how the language functions for the sake of changing technology. C++ focuses more on standardization rather than design functionality because of this reason. Carbon was designed not as a substitute for C++. Rather than an attempt to incrementally evolve C++, it is designed around interoperability with C++ and large-scale adoption and migration for existing C++ codebases and developers. &lt;/p&gt;

&lt;p&gt;As part of the documentation of Carbon, it states that this new, more dynamic language would need to have certain features, which include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Performance matching C++&lt;/strong&gt;an essential property for our developers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seamless, bidirectional interoperability with C++&lt;/strong&gt;, such that a library anywhere in an existing C++ stack can adopt Carbon without porting the rest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A gentle learning curve&lt;/strong&gt; with reasonable familiarity for C++ developers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comparable expressivity&lt;/strong&gt; and support for existing software's design and architecture.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalable migration&lt;/strong&gt;, with some level of source-to-source translation for idiomatic C++ code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can also observe how specific newer languages like Kotlin and Typescript have been a medium for change for their older counterparts (Java and JavaScript, respectively). Google wants to do that with C++ by Introducing Carbon.&lt;/p&gt;

&lt;p&gt;Carbon is still an experimental language and by no means ready to be used in real-world applications, and it won't be for a reasonably long time, but it doesn't hurt to try to use it and add another language you know how to "Hello World" in.&lt;/p&gt;
&lt;h2&gt;
  
  
  Installing Carbon and its Compiler
&lt;/h2&gt;

&lt;p&gt;Since Carbon is in such early stages of development, it isn't easy to use it on your local machine. For Windows, it's an even longer procedure since we have to install brew through WSL (Windows Subsystem for Linux). Assuming you have WSL installed with Ubuntu as your primary Linux Operating System, we can now move forward with installing brew and then ultimately installing Carbon. &lt;/p&gt;
&lt;h3&gt;
  
  
  Installing Homebrew
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;here&lt;/a&gt; and copy the installation command on the webpage. Open your Ubuntu environment in WSL and paste the command there. [Takes 5-10 mins]&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You might be required to enter your password during the previous step. I had to run this command twice as I got multiple fatal errors during this step.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;After the command runs successfully, scroll until you see a section called "Next Steps." Copy and paste the commands in the order they are given into the terminal. They will look like the image below:&lt;/li&gt;
&lt;/ol&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%2Fras3lzxeyxwyn9rbjcpm.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%2Fras3lzxeyxwyn9rbjcpm.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Next in line is to install the build-essentials of homebrew, which can be done with &lt;code&gt;sudo apt-get install build-essentials&lt;/code&gt; [Takes 3-5 mins]&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now, we will install gcc. Install it using the &lt;code&gt;brew install gcc&lt;/code&gt; command [Takes 5-10 mins]&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I ran into another error where my homebrew-core was "not tapped correctly," which I figured out by running &lt;code&gt;brew doctor&lt;/code&gt;. It gave me the necessary commands to fix the error, after which &lt;code&gt;gcc&lt;/code&gt; installation was easy as pie.&lt;/p&gt;
&lt;h2&gt;
  
  
  Install the Carbon Compiler
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Install the Bazelisk Launcher using &lt;code&gt;brew install bazelisk&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install LLVM (Low Level Virtual Machine) using &lt;code&gt;brew install llvm&lt;/code&gt; [Takes 5-15 mins]&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add this to your path variable using &lt;code&gt;export PATH="$(brew --prefix llvm)/bin:${PATH}"&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Since we are doing this installation on Ubuntu, we will also need &lt;code&gt;zlib1g dev&lt;/code&gt;, which we can install using &lt;code&gt;sudo apt install zlib1g-dev&lt;/code&gt; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We now have all the dependencies installed for the compiler. Time to clone the Github Repository using &lt;code&gt;git clone https://github.com/carbon-language/carbon-lang&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Coding Carbon in Windows using VSCode
&lt;/h2&gt;

&lt;p&gt;And there we have it, we've successfully installed Carbon on your Linux Machine. Time to port it over to windows, so we don't have to code in the terminal again.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open VS Code and install the Remote Development Extention&lt;/li&gt;
&lt;/ol&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%2Fbmrn0m5k5yksfdc3zrgg.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%2Fbmrn0m5k5yksfdc3zrgg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Remote Explorer on the left-hand pane and click on the drop-down at the top of the screen. Select "WSL Targets" from the list. Then click on the button beside Ubuntu, as shown in the image.&lt;/li&gt;
&lt;/ol&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%2Fyhp0921dgoqx5nq58hjc.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%2Fyhp0921dgoqx5nq58hjc.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Wait for the Home Screen to Install all required dependencies and then go to &lt;code&gt;File &amp;lt; Open Folder &amp;lt; /home/{user}/carbon-lang/&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;explorer/testdata/print/format_only.carbon&lt;/code&gt; in the VS Code Window. A Hello World Program is displayed! &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To see its output run &lt;code&gt;bazel run //explorer --  ./explorer/testdata/print/format_only.carbon&lt;/code&gt; and wait a couple minutes. Since Carbon isn't ready to be adopted by the masses, its compilation time is painfully slow, and it took me almost 2 minutes to compile.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fjcz2y784nl8zgp897jrw.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%2Fjcz2y784nl8zgp897jrw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Writing Fizz Buzz in Carbon
&lt;/h2&gt;

&lt;p&gt;Everyone has heard of Fizz Buzz. If the number is divisible by 2, print "Fizz"; If it's divisible by 3, print "Buzz". If it's divisible by both, print "FizzBuzz"; else, print the number. Here is the implementation in Carbon:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;package&lt;/span&gt; &lt;span class="n"&gt;ExplorerTest&lt;/span&gt; &lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;fn&lt;/span&gt; &lt;span class="n"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;i32&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;var&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
            &lt;span class="n"&gt;Print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{0} FizzBuzz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nf"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
            &lt;span class="n"&gt;Print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{0} Fizz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nf"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
            &lt;span class="n"&gt;Print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{0} Buzz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{0}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let us discuss what every line in this program does: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;package ExplorerTest api;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Base package and acts like &lt;code&gt;#include &amp;lt;iostream&amp;gt;&lt;/code&gt; in C++&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;fn Main() -&amp;gt; i32&lt;/code&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our main function which has a return type of Integer 32bit&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;var i: auto = 0&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Creates a variable &lt;code&gt;i' with value&lt;/code&gt;0`&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;while(i &amp;lt;= 100)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While Loop to be executed while &lt;code&gt;i &amp;lt; 100&lt;/code&gt;. I had originally tried to create a for loop like in C++ [&lt;code&gt;for (int i =0; i &amp;lt;= 10; i++)&lt;/code&gt;] but got a syntax error &lt;/p&gt;

&lt;p&gt;[COMPILATION ERROR: foo_bar_baz.carbon:4: syntax error, unexpected identifier, expecting COLON]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;if&lt;/code&gt; statements&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They execute their block only if the condition in parenthesis is True. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Print&lt;/code&gt; statements&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Print the value inside the parenthesis. If variables need to be printed, we can use &lt;code&gt;{num}&lt;/code&gt; where &lt;code&gt;num&lt;/code&gt; is a number starting from 0. &lt;br&gt;
Eg: &lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
var a: auto = 1;&lt;br&gt;
var b: auto = 5;&lt;br&gt;
var c: auto = 2;&lt;br&gt;
var d: auto = 6;&lt;br&gt;
Print("These are Numbers: {0}, {1}, {2}, {3}", a,b,c,d);&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Will give the output: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
These are Numbers: 1, 5, 2, 6&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Carbon is a fantastic Language, it's still in its early stages of development, and it'll hopefully get better over time. One obvious flaw is the lack of documentation. I want to remind you that Carbon is still under development, and Google does not recommend using it for any scaled-up applications. I hope you have as much fun as I did trying to learn Carbon!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>cpp</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Deploying your applications on AWS EC2 with Caddy reverse proxy</title>
      <dc:creator>Utkarsh Tripathi</dc:creator>
      <pubDate>Wed, 17 Aug 2022 18:11:26 +0000</pubDate>
      <link>https://dev.to/mlsc_tiet/deploying-your-applications-on-aws-ec2-with-caddy-reverse-proxy-mke</link>
      <guid>https://dev.to/mlsc_tiet/deploying-your-applications-on-aws-ec2-with-caddy-reverse-proxy-mke</guid>
      <description>&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%2F93jyij2629z63lw61o0p.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%2Fuploads%2Farticles%2F93jyij2629z63lw61o0p.jpg" alt="Header Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Serving your applications through HTTPS reverse proxy
&lt;/h4&gt;

&lt;p&gt;In this tutorial, I am going to discuss how to deploy your containerized applications on an AWS EC2 (Elastic Compute Cloud) instance with a reverse proxy, so you can use your domain to access multiple apps running in the same instance.&lt;/p&gt;

&lt;p&gt;Let’s begin with setting up our infrastructure on AWS. Login to your AWS console and navigate to the EC2 page.&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AO6ZAUYhT2YEA-sDVFCHYkA.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AO6ZAUYhT2YEA-sDVFCHYkA.png" alt="search ec2 on aws dashboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, click on the Launch Instance button and follow the steps to set up a server.&lt;/p&gt;

&lt;p&gt;Remember to select the “Ubuntu” image for OS and instance type as “t2.micro” which is eligible for the always free tier.&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ALgAy8HL0WYCvyEMeFXHnyA.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ALgAy8HL0WYCvyEMeFXHnyA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a key pair for SSHing into your server later on. Use the .ppk format for your keys as shown below. Download and safely store this key file to access your server in the future. Leaving other settings to default, click on “Launch Instance”.&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%2Fcdn-images-1.medium.com%2Fmax%2F802%2F1%2AkVVSSJYIshIABEYroa1jGw.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%2Fcdn-images-1.medium.com%2Fmax%2F802%2F1%2AkVVSSJYIshIABEYroa1jGw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since you will be using a domain name for your server, you need to get the IP address of the server. Still, every time you stop/start your server, it gets a new IP address, so for this problem, AWS has a feature for an Elastic IP that remains constant, you can link this IP to any of your EC2 instances. In the side panel, under “Network &amp;amp; Security” open the Elastic IP page and click on “Allocate Elastic IP address” and a new permanent IP address will be added to your dashboard.&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A7kaCI90VFI0CY-eDM7xsag.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A7kaCI90VFI0CY-eDM7xsag.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now click on the new IP address and click on “Associate Elastic IP address” and then in the instance dropdown, select your instance name and allocate this permanent address.&lt;/p&gt;

&lt;p&gt;Now, let’s set up our environment to login into our server. I prefer using &lt;a href="https://termius.com/" rel="noopener noreferrer"&gt;Termius&lt;/a&gt; for logging into my servers. If you are a student, you can get this for free using the &lt;a href="https://termius.com/education?utm_source=github+termius" rel="noopener noreferrer"&gt;github student pack&lt;/a&gt;. You can also use PuTTy or just the ssh command in your terminal for logging in, there are various tutorials for that. I going with Termius for this one. Once you downloaded and installed the client, let’s add our server to the client.&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ARvpvoIokOj51kO8UAs6qlw.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ARvpvoIokOj51kO8UAs6qlw.png" alt="Termius client"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Add &amp;gt; New Host, then in the side panel, add the label, the Elastic IP address which we created, then in the ssh panel, click the keys, and add in your .ppk key which you created and saved earlier. In the username, add “ubuntu”, you can also customize the terminal theme by scrolling down, and that's it, you created a profile for SSHing into your server. Now just double-click on your host and you will be connected to your server. Easyy!&lt;/p&gt;

&lt;p&gt;Now that you have your infra set-up, let’s prepare our machine by installing some tools like Docker and Caddy to prepare it for hosting.&lt;/p&gt;

&lt;p&gt;Enter the commands in order to install the Docker engine on your instance&lt;/p&gt;

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

sudo apt-get update

sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release

sudo mkdir -p /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin


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

&lt;/div&gt;

&lt;p&gt;This should install docker in your instance, to verify, enter docker version . If there exists any problem refer to &lt;a href="https://docs.docker.com/engine/install/ubuntu/" rel="noopener noreferrer"&gt;original docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Next, let us install the Caddy server :&lt;/p&gt;

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

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https 

curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg 

curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list 

sudo apt update 

sudo apt install caddy


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

&lt;/div&gt;

&lt;p&gt;Run caddy to verify. With this, you will have the necessary software to deploy your application.&lt;/p&gt;

&lt;p&gt;Next, let’s clone our project from GitHub in our server using git clone and also create a configuration file for Caddy. To create the configuration file or Caddyfile , run touch Caddyfile , it will create the file in your pwd (present working directory)&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%2Fcdn-images-1.medium.com%2Fmax%2F375%2F1%2AzRUeZk3xPz13CbyYBiy-bQ.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%2Fcdn-images-1.medium.com%2Fmax%2F375%2F1%2AzRUeZk3xPz13CbyYBiy-bQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, to run your application with docker, you must either have a Dockerfile in your project directory or a docker image in the docker hub. Here, I am building my own image from a Dockerfile , you can pull it from docker hub too using docker pull command.&lt;/p&gt;

&lt;p&gt;To build from the Dockerfile , cd into your project folder, for me it is cd portfolio , and run the command :&lt;/p&gt;

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

docker build . -t &amp;lt;your app name&amp;gt;:latest


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

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want to learn more about containers and using docker, you can check out my other blog &lt;a href="https://medium.com/developer-student-clubs-tiet/containerization-and-using-docker-e75b9e67d3fd" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you don't have a Dockerfile in your project, you can search for configurations specific to your project. I have created a sample for a react-app.&lt;/p&gt;

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

FROM node:18-alpine3.14
WORKDIR /app
COPY package.json .
COPY package-lock.json .
RUN npm ci
COPY . .
CMD ["npm","run","start"]


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

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Put this into the root of your folder, and also create a .dockerignore to ignore any file you don't want to copy into the container like node_modules as it will create its own node modules. Commit these files and push it to github, and pull the changes to the server.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now run the docker build command given above, then run docker images , it will show the images available to docker.&lt;/p&gt;

&lt;p&gt;Now to run the container for your app, run the following command to start a running service for your image&lt;/p&gt;

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

docker run -p 3000:3000 -d &amp;lt;image id&amp;gt;


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

&lt;/div&gt;

&lt;p&gt;The -p flag is to bind a port from the host to the container (3000:3000 means 3000 port of our host to 3000 in the container since the react app works on this port by default) and -d is to run the container in the background in the detached mode.&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%2Fcdn-images-1.medium.com%2Fmax%2F921%2F1%2A6FYxts5JFzNL2K27sgQSjA.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%2Fcdn-images-1.medium.com%2Fmax%2F921%2F1%2A6FYxts5JFzNL2K27sgQSjA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This should start and expose your app on your public Elastic IP address. To view the app using your IP address, you will first need to create a security rule to allow incoming traffic on port 3000. In your AWS console, on the EC2 dashboard, go to the security groups and click on the id, to open and edit it.&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AAaQHvOP8EDYymRW4v5or6w.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AAaQHvOP8EDYymRW4v5or6w.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the security rules, add an inbound rule of type “Custom TCP” with a port range of 3000 and source as anywhere, save the rules and you are ready to go. Now enter the URL http://{Elastic IP address}:3000 and you should be able to see the react app.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Notice that you are currently using HTTP protocol and your connection is not secure, we will be using the Caddy server for reverse proxy which automatically provisions a TLS/SSL certificate and renews it giving your domain HTTPS capabilities.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, for the last part, let’s set up the reverse proxy with the Caddy server. You should have a domain name with you, if not, you can get one for free on name.com, Namecheap or a .tech domain using the Github Student pack. Now go to your domain name provider, and edit the DNS records for your domain to point at the server.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Add two (one for @ and other for www) A records in the DNS setting with the value of Elastic IP. An A record id used to point to an IP address.&lt;/p&gt;
&lt;/blockquote&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A8nVhcS5XTsg6wZLqmSIaiw.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A8nVhcS5XTsg6wZLqmSIaiw.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Adding record on Cloudflare&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;@ root stands for the base domain like example.com, abcd.tech etc., similarly for using your domain like &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt;, replace @ with www, pointing to the same IP. In this way, you can add multiple subdomains in the name field pointing to various servers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Remember to turn off any proxy from the DNS provider as we will create our own proxy server.&lt;/p&gt;

&lt;p&gt;Reverse proxy is a service which sits in front of our applications and listens on port 80 (HTTP) and port 443 (HTTPS) ports and directs our request to specific ports hosting various services. Using this, we can host multiple applications in a single server with our reverse proxy redirecting according to specified subdomains or paths. You can read more about it &lt;a href="https://www.cloudflare.com/learning/cdn/glossary/reverse-proxy/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now let's create our reverse proxy, and edit the Caddyfile which we previously created using vim by executing the following command to open the vim editor (vim Caddyfile) .&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To edit the file, press i, then press escape key when you are done with changes. To save and exit, type :wq&lt;/p&gt;
&lt;/blockquote&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AshO9YXuLTSW54u0CSi2Q5w.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AshO9YXuLTSW54u0CSi2Q5w.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Caddyfile serves as the configuration file for the caddy server. It has a highly human readable and straight-forward syntax. To create a reverse proxy server, we just have to write the following code, and it will spin up a highly robust and production grade reverse proxy server.&lt;/p&gt;

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

yourdomain.com {
   reverse_proxy localhost:&amp;lt;port number of your service&amp;gt;
} 

# you can repeat this setup for multiple domains since we are using the www subdomain to, lets add it (the spaces are important in syntax)

http://www.yourdomain.com {
   reverse_proxy localhost:3000
}


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

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;You can read more about Caddy and its syntax in the documentation &lt;a href="https://caddyserver.com/docs/getting-started" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now you are all set, just run caddy run to start the servers and see the logs or caddy start to start the server in the background. This will spin up the server and it will provision the TLS/SSL certificates for your domain which will take some time, after which you can see your application running on your domain.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here, the server is listening on port 443 for HTTPS and forwarding the requests to internal ports as specified in Caddyfile, 3000 in our case.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In a similar fashion, you can create images of your application, run them on different ports, add subdomain in your DNS records pointing to your Elastic IP and lastly add block for your subdomain in Caddyfile and run caddy reload and voila, you can run multiple services in a single server with various subdomains served through a HTTPS reverse proxy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In this way, you can containerize multiple applications and deploy them on AWS EC2 instance and provide subdomains for access. If you have any doubts or errors on any do comment or ping me on discord at utkarsh#9378. Do share and give a like if this article helped you.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;See you again reader !! 😊👋&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;-Utkarsh Tripathi&lt;br&gt;
Microsoft Learn Student Chapter, Thapar University, Patiala&lt;/p&gt;

</description>
      <category>aws</category>
      <category>webdev</category>
      <category>cloud</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
