<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Atominac on Medium]]></title>
        <description><![CDATA[Stories by Atominac on Medium]]></description>
        <link>https://medium.com/@atominac?source=rss-79d4e3319d70------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*gKRGTXVCxfV9JxVG_pM7Ww.jpeg</url>
            <title>Stories by Atominac on Medium</title>
            <link>https://medium.com/@atominac?source=rss-79d4e3319d70------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 10:26:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@atominac/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Asynchronous task execution using Cloud task]]></title>
            <link>https://atominac.medium.com/asynchronous-task-execution-using-cloud-task-f8b2219bde66?source=rss-79d4e3319d70------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8b2219bde66</guid>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[asynchronous-task]]></category>
            <category><![CDATA[cloud-tasks]]></category>
            <dc:creator><![CDATA[Atominac]]></dc:creator>
            <pubDate>Sat, 27 Jun 2020 08:25:52 GMT</pubDate>
            <atom:updated>2020-06-28T05:49:04.357Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*Xe5a65DNnoD90lFEx8wwPw.png" /><figcaption>Source: Google Cloud</figcaption></figure><p>I am an engineer at <a href="https://justcall.io/">JustCall.io</a>. As our usage started to scale to millions of activities like live calls, security monitoring, SMS, transcription etc, we started facing some scaling issues with our existing architecture.</p><h3>Problem…</h3><p>Many times we come across situations where we need to perform a task that need not be performed inside the same scope. For example when we need to send an email on user sign up, here email need not be sent in the same scope of signup. It can be performed asynchronously outside the scope of main process.</p><h3>Solution…</h3><p>Cloud task is a service provided by Google Cloud for asynchronous execution of a task. Cloud task helps us to execute the task outside the scope of main process. Using Cloud Tasks, you can perform work asynchronously outside of a user or service-to-service request.</p><h3>Benefits…</h3><ul><li>It helps to reduce request latency and make application more responsive.</li><li>It also allows preserving your requests in flight.</li><li>Pausing, retrying, or redirecting to a new version can give you room to handle a bug or stage a deployment without dropping requests.</li><li>The task can be scheduled for future.</li></ul><h3>How this works…</h3><p>Cloud Tasks lets you separate out pieces of work that can be performed independently, outside of your main application flow, and send them off to be processed, asynchronously, using <strong><em>handlers</em></strong> that you create. These independent pieces of work are called <strong><em>tasks</em></strong>.</p><p>The task is added to a queue, which remains in the queue until it is successfully executed. Once a task is added, the queue dispatches them and make sure it is processed.</p><p>The tasks are made up of unique name, configuration information and data called the payload, which is used to process the request. Payload is used in HTTP request body.</p><h4>Cloud Tasks queues with HTTP targets</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*L1OIjmfaq-2EuCi4EqSXUg.png" /><figcaption>Source: Google Cloud</figcaption></figure><p>In HTTP Targets, the Cloud Tasks forwards the task request to the worker, located at any HTTP endpoint, It guarantees task execution if it sends HTTP response code between 200–299 to the Cloud Tasks service before a 10-minute deadline. If a different response is sent, or no response, the task is retried.</p><h4>Cloud Tasks queues with App Engine targets</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*PxPdXlfsYCIA2KMY96TSeQ.png" /><figcaption>Source: Google Cloud</figcaption></figure><p>In App Engine targets, the Cloud Tasks service forwards the task request to the worker, located at located within App Engine, It guarantees task execution if it sends HTTP response code between 200–299 to the Cloud Tasks service before 10 minutes for automatic scaling or up to 24 hours for manual scaling deadline. If a different response is sent, or no response, the task is retried.</p><h3>Implementation</h3><p><strong>REQUIREMENTS</strong></p><ol><li>App engine with installed node.js.</li><li><a href="https://cloud.google.com/sdk/install">Cloud SDK</a> installed on your local system.</li></ol><p><strong>Creating a Cloud Tasks queue</strong></p><p>Run these commands on your terminal to create a queue</p><pre>gcloud tasks queues create [QUEUE_ID]</pre><p>[QUEUE_ID] is the unique identifier for your queue</p><pre>gcloud tasks queues describe [QUEUE_ID]</pre><p>this will display the details of your created queue</p><p><strong>Creating an Http target(Node.js)</strong></p><p>#post API to create a task</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1a8d1dfb1b7abb0d193baa1054b3b50/href">https://medium.com/media/e1a8d1dfb1b7abb0d193baa1054b3b50/href</a></iframe><p>index.js of node project</p><p>Put details of your project and task queue in these variables.</p><pre>var google_cloud_project=”your google cloud project&quot;;</pre><pre>var queue_name=”your queue name”;</pre><pre>var queue_location=”queue location&quot;;</pre><pre>var service_account_email=”your service account email”;</pre><p><strong>createtask.js</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f2f281d8bd0cfb35eff81c9e323a3375/href">https://medium.com/media/f2f281d8bd0cfb35eff81c9e323a3375/href</a></iframe><p>This file includes the function <strong>createHttpTaskWithToken()</strong> that will create a task and will be called from index.js</p><p>don’t forget to include <strong>createTask.js</strong> in <strong>index.js</strong></p><p>after writing these two files in your node project deploy it in the app engine.</p><p>now you can make a post request to your API with the required params and can create a task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*x98vhBfJpt2CxWoKgeo7Bg.png" /><figcaption>sample post request</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d06e21ea768ceb39b77f135aa188644/href">https://medium.com/media/3d06e21ea768ceb39b77f135aa188644/href</a></iframe><p>You can find a complete project at this <a href="https://github.com/Atominac/cloud-task">link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8b2219bde66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache web server(ubuntu) EC2 AWS]]></title>
            <link>https://atominac.medium.com/apache-web-server-ubuntu-ec2-aws-f31bfe3f60fd?source=rss-79d4e3319d70------2</link>
            <guid isPermaLink="false">https://medium.com/p/f31bfe3f60fd</guid>
            <category><![CDATA[lamp]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[web-server]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <dc:creator><![CDATA[Atominac]]></dc:creator>
            <pubDate>Mon, 30 Dec 2019 19:38:02 GMT</pubDate>
            <atom:updated>2020-12-24T08:32:25.186Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w0mgawasiyr-ageo3RNcVg.png" /></figure><p>I was trying to host a website on AWS EC2 instance but couldn’t find one concise location where a proper step by step method could be found. I tried to look on many tutorials none was complete and were outdated now as AWS has change a lot recently.</p><p>So I am sharing a complete procedure to host a website on AWS EC2 instance.</p><p>It’s a long and lengthy ride so just hold tight.</p><p>The procedure will include</p><ol><li>Configuring EC2 instance.</li><li>Remote connection with instance using putty.</li><li>Installing apache2+php+Mysql+PhpMyAdmin.</li><li>Uploading files using FTP Client FileZilla.</li></ol><h3>Lets begin</h3><h3>#Configuring EC2 instance.</h3><ol><li>Open EC2 instance dashboard.</li><li>Click on launch instance.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4EikabPxqrsDxhlXOT0Lcg.png" /></figure><p>3.Find the <strong>Ubuntu Server 18.04 LTS (HVM), SSD Volume Type</strong>&gt; Click select.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*juD1QnyOPh4gsoUcUtC0CQ.png" /></figure><p>4. Choose an <strong>Instance Type</strong> &gt; click on <strong>Configure instance details</strong>, you can select according to your requirement. I will be going with t2.micro.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vjz2_oPK8o9y2KVyTqtdUA.png" /></figure><p>5. Now configure the instance settings. change <strong>Auto-assign Public IP </strong>to <strong>enable, </strong>leave <strong>Network </strong>and <strong>subnet </strong>as its is &gt; Click on <strong>Add storage</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UFigRX-BDatBgaFloIw_kQ.png" /></figure><p>6. New select the <strong>storage </strong>&gt; Click on <strong>Add Tags.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8FEIfc1nWq8UedXMbLoGUQ.png" /></figure><p>7. Now <strong>Add tags </strong>(Optional) &gt; Click on <strong>Configure Security Groups.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XIL2dlb5eNWw5yHYWDRhww.png" /></figure><p>8. Now add security group, click on add tag/ add another tag.</p><ul><li>SSH</li><li>HTTP</li><li>HTTPS</li><li>Custom TCP rule &gt; enter <strong>port range 8080</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QVCzdbN2ODATAGi4S18Chw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nLPWeUQKoP7CBeN8Ajqx7g.png" /></figure><p>9. click <strong>review and launch</strong> &gt; go through details and click <strong>launch.</strong></p><p>10. Now select <strong>create a new key pair </strong>&gt;<strong> enter key pair name </strong>&gt;Click <strong>Download key pair,</strong> if you already have a key pair you can use it also. &gt; Click <strong>Launch instance.</strong></p><p><strong>keep this file safe, you will be able to access the instance with this file only.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U0NQpCZQPdiC2aF5MfmPNg.png" /></figure><p>10. Wait for instance to get started and perform status checks.</p><p>Now your instance is up and running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cv53ZnQ5lHe4hbKe1avZYA.png" /></figure><h3>#Remote connection with instance using putty.</h3><p>11. Download <strong>putty.exe</strong> and <strong>puttygen.exe </strong>from the link.</p><p><a href="https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html">Download PuTTY: latest release (0.83)</a></p><p>Under <strong>Alternative binary files</strong> download<strong> putty.exe</strong> and <strong>puttygen.exe.</strong></p><p>12. Now open on the downloaded <strong>puttygen.exe</strong>.</p><p>-we will convert the downloaded .pem file to .ppk file.</p><p>13. Click <strong>load </strong>button &gt; change the filter to <strong>all files</strong> select the downloaded <strong>key pair file </strong>&gt; click on<strong> save private key</strong> button and save the new file with same name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*j7CbRomSkdl1V8ZjI9I1Iw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*5EkSW-A9JbphNGbboMD2cw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*vdirf79bKKIQgxoqS6M_Kw.png" /><figcaption><strong>load &gt; change filter and select file &gt; save private key</strong></figcaption></figure><p>13. Now open on the downloaded <strong>putty.exe</strong>.</p><ul><li>Select your <strong>instance </strong>and <strong>Click </strong>on Connect &gt; Copy the <strong>host name</strong> &gt;paste it in <strong>hostname section </strong>of <strong>putty</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Jio1gxAetT_pEwH7vQrSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*knW6s02JsvGMOe4GCGohzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*_DPaYHl8bHdKeoQ1cORjtw.png" /><figcaption><strong>Hostname instance &gt; paste it in hostname section putty</strong></figcaption></figure><p>now copy the <strong>username</strong> and paste it putty <strong>connections&gt;data</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*0-5tCdoCyuHJ4ZctP79x4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*vFaKeeTYKNX3rx_Iwkilwg.png" /><figcaption><strong>username &gt; Autologin username</strong></figcaption></figure><p>14. go the the <strong>connection&gt;ssh&gt;auth</strong> click on browse and <strong>select the .ppk</strong> converted before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*SON3rV5b80qY8ajMLRhRbQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*piCAfLN4QqmBOJPuTwwoJQ.png" /></figure><p>15. now click on open. a popup will open click on yes.</p><p>now we are connected to the instance</p><h3><strong>#Installing apache2+php+Mysql+PhpMyAdmin.</strong></h3><p>16. to<strong> install apache</strong> run the following commands on the putty command line.</p><pre>//upgrade apt tools<br>$ sudo apt update</pre><pre>//install apache2<br>$ sudo apt install apache2</pre><pre>//it will ask &quot;Do you want to continue?&quot; press Y and click enter</pre><p>now apache server is up and running</p><p>17. to <strong>install php</strong> run the following commands on the putty command line.</p><pre>$ sudo apt-get install php libapache2-mod-php</pre><pre>//it will ask &quot;Do you want to continue?&quot; press Y and click enter.</pre><pre>//add user to access data and files<br>$ sudo adduser ubuntu www-data</pre><pre>//grant the user access permissions to the directory view and edit.<br>$ sudo chown -R www-data:www-data /var/www<br>$ sudo chmod -R g+rw /var/www<br>$ sudo chmod -R 777 /var/www</pre><pre>//restarting server<br>$ sudo service apache2 restart</pre><p>now now php is installed and running.</p><p>18. installing <strong>Mysql</strong>.</p><pre>$ sudo apt-get install mysql-server</pre><p>Mysql is now installed</p><p>19. installing <strong>phpmyadmin</strong>.</p><pre>$ sudo apt-get install -y phpmyadmin</pre><p>popups will open during the installation</p><p>select <strong>apache in the server</strong> &gt; <strong>select yes</strong> &gt; <strong>enter password </strong>&gt;<strong>confirm password</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*_xUzDCU8eb_2-G0jQb7upw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*3pa0vQLGnbmTjDIdG0G3XQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*zAAwEkPaSdIERAINmJnF6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*SaGQceFzrRMY-q2UG-719g.png" /><figcaption><strong>select apache in the server &gt; select yes &gt; enter password &gt;confirm password</strong></figcaption></figure><h3>#Uploading files using FTP Client FileZilla.</h3><p>20. download and install filezilla from this link</p><p><a href="https://filezilla-project.org/download.php?platform=win64">Download FileZilla Client for Windows (64bit x86)</a></p><p>21. click on <strong>edit </strong>on the menu &gt; then click on <strong>settings.</strong></p><p>22. Now click on <strong>SFTP </strong>present on the left section &gt; now click on <strong>Add key file</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*309Qb4lpCsrUWWyrztdkOg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*mlw6b7Mc5itwSduTvqin5A.png" /><figcaption><strong>click edit &gt;click settings &gt;Click SFTP&gt;click ADD key file</strong></figcaption></figure><p>select the<strong> .ppk file</strong> that we converted earlier.</p><p>now click on ok</p><p>23. now again copy the<strong> public DNS</strong> of your instance and paste it in the Host section on the top of <strong>filezilla.</strong></p><p>enter <strong>username </strong>as “<strong>ubuntu</strong>”</p><p>enter <strong>port </strong>“<strong>22</strong>” in the port section</p><p>click on <strong>quick connect</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CKbAYbm5ADng9iWT6EbjUQ.png" /></figure><p>24. <strong>Left section</strong> of filezilla represents <strong>your machine</strong> and<strong> right section </strong>represents the <strong>EC2 instance machine</strong>.</p><p>25. now move two directories up</p><p>find the directory named “var”</p><p>move to location /var/www/html</p><p>this in your website directory</p><p>26. In this directory upload the website files by simple drag and drop method from your local machine.</p><p>27. Copy the public ip from the instance and run it on the browser you will be able to access the website.</p><h3>hurrah!! Web Server is up and website is deployed</h3><p>If any issues feel free to contact</p><p><a href="https://medium.com/u/79d4e3319d70">Atominac</a></p><ul><li><a href="https://github.com/Atominac">Atominac - Overview</a></li><li><a href="https://www.linkedin.com/in/alok-yadav-33b005153/">Alok Yadav - AJAY KUMAR GARG ENGINEERING COLLEGE, GHAZIABAD - Ghaziabad, Uttar Pradesh, India | LinkedIn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f31bfe3f60fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>