<?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"><channel><title><![CDATA[A Man's Approach to Secure Cloud]]></title><description><![CDATA[I write codes for infra and manage the releases with style]]></description><link>https://amansamalmagar.com.np</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 09:46:10 GMT</lastBuildDate><atom:link href="https://amansamalmagar.com.np/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[React App on Cloudflare Pages]]></title><description><![CDATA[You have a React app already pushed to a GitHub repository but have no idea where to deploy it. Then you can use Cloudflare pages as your deployment choice for frontend applications built with react, next-js, preact and so on. I am using this demo re...]]></description><link>https://amansamalmagar.com.np/react-app-on-cloudflare-pages</link><guid isPermaLink="true">https://amansamalmagar.com.np/react-app-on-cloudflare-pages</guid><category><![CDATA[cloudflare]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[free]]></category><category><![CDATA[React]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Aman Samal Magar]]></dc:creator><pubDate>Wed, 02 Aug 2023 04:15:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/wX2L8L-fGeA/upload/fb66f91fcc24fad6e1fc25467473225c.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You have a React app already pushed to a GitHub repository but have no idea where to deploy it. Then you can use Cloudflare pages as your deployment choice for frontend applications built with react, next-js, preact and so on. I am using this demo repository with React for this tutorial.</p>
<p><a target="_blank" href="https://github.com/amanmagar/vite-cf-pages">https://github.com/amanmagar/vite-cf-pages</a>  </p>
<p>This tutorial will be focused on the Cloudflare platform and how we can simply deploy and create a CI/CD pipeline along with it on this simple tutorial.</p>
<ol>
<li><p>Firstly you need a Cloudflare account and once you have created an account, you are greeted with a home page.</p>
</li>
<li><p>You need to navigate to the Workers &amp; Pages tab on the left of the screen. You can directly upload the static files or connect it to GitHub which I will be doing here.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690905022086/bd49d2f8-c805-4121-b8b1-05e17337dd99.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Then you will be redirected to Github where you can authenticate to your Github Profile so that Cloudflare can import the repositories from GitHub to their platform. You can choose which repositories to provide access to. Once everything is done, you will be redirected to the Cloudflare Pages again.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690905142090/ce284926-d3dd-46be-ac96-44fac8da34ca.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Now the process on the Cloudflare Platform starts. You need to start from here.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690905283303/c22b33e6-7bf0-4c32-ae77-1b822bdd972e.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>After this, the application needs to be configured for its deployment. You need to check your application requirements and configure it accordingly.<br /> The main settings to look at here are:</p>
<ul>
<li><p>Project name: name of the cf pages project. You can leave it at default</p>
</li>
<li><p>Production branch: The branch where the production code stays</p>
</li>
<li><p>Framework preset: Cf pages provide default configuration for different frameworks available if not we can manually define our build command and build output directory</p>
</li>
<li><p>build command: define the project build command to generate the static assets for deployment. In my case, it is <strong>"yarn build"</strong></p>
</li>
<li><p>build output directory: the directory where the static assets reside after the build command has been completed. Here it is <strong>"dist/"</strong></p>
</li>
<li><p>environment variables: This will contain all the environment variables that are defined in the application during the build. I don't have any so I am not using it.</p>
<p>  <strong><em>NOTE: always define NODE_VERSION and YARN_VERSION/NPM_VERSION as what you are using for the application requirements as a dev environment else it has given you issues during building the application.</em></strong></p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690907066527/65588896-3c37-4b03-8569-cc3d537ba326.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
</li>
<li><p>If everything goes right, you will get this screen. A good thing about Cloudflare pages is that it will provide a sub-domain where you can see your deployments.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690907204190/f3b2337c-0562-4263-b31b-d659cb0babb5.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Now the deployment is automatic which will trigger on the push to the production branch on Git Hub.</p>
</li>
<li><p>You want to run this project on your domain like I can with amansamalmagar.com.np. Then we can do so if we have other DNS already being run on Cloudflare.</p>
<ul>
<li><p>Go to the custom domain settings on Cloudflare Pages and provide the sub-domain that you want the project to run on.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690907469574/c2ed1ef3-a451-46b6-a454-efc71b61146c.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Press on <strong>Activate Domain</strong> on the right</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690907501754/8269bce4-cc31-4463-ba8d-7c7115d62181.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Once it's done and activated, This is shown on the screen. Now you can access the application on <a target="_blank" href="http://vite.amansamalmagar.com.np"><strong>vite.amansamalmagar.com.np</strong></a></p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690907561841/a380dc2e-9fe2-48d4-a4fb-eead63dfa039.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
</li>
</ol>
<p>I hope that this small tutorial will help you to configure a basic hosting platform for your frontend requirements in Cloudflare Pages with its inbuilt CI/CD and different functionalities that you can use through their free plan.</p>
<p>Feel free to contact me on my LinkedIn or create an issue on the Github.</p>
<p>Thank You and Stay Safe.</p>
]]></content:encoded></item><item><title><![CDATA[CloudFlare Pages]]></title><description><![CDATA[If you're part of the startup industry, chances are you've already heard about Cloudflare - the renowned free DNS provider and a globally loved content delivery network (CDN). Cloudflare's free plan is nothing short of powerful, offering a plethora o...]]></description><link>https://amansamalmagar.com.np/cloudflare-pages</link><guid isPermaLink="true">https://amansamalmagar.com.np/cloudflare-pages</guid><category><![CDATA[cloudflare]]></category><category><![CDATA[github-actions]]></category><category><![CDATA[CI/CD]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Frontend Development]]></category><dc:creator><![CDATA[Aman Samal Magar]]></dc:creator><pubDate>Wed, 19 Jul 2023 16:23:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1689783123887/ba865c77-8798-4d7e-b649-304e2a06a122.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you're part of the startup industry, chances are you've already heard about Cloudflare - the renowned free DNS provider and a globally loved content delivery network (CDN). Cloudflare's free plan is nothing short of powerful, offering a plethora of features ranging from networking and security to developer tools and beyond.</p>
<p>Today, we're going to dive into Cloudflare Pages - their platform for hosting frontend applications on their impressive network. The best part? You can get started on this platform for free, without the hassle of providing any credit card details.</p>
<p>Cloudflare Pages is an excellent choice for front-end developers as it supports various frameworks like React, Angular, and more. You can find a comprehensive list of supported frameworks on their website.</p>
<p>One of the standout features of Cloudflare Pages is its built-in Continuous Integration and Continuous Deployment (CICD) capabilities. The platform offers descriptive logs, giving you a clear view of what's happening within Cloudflare's build server. As you become familiar with its API and capabilities, you'll realize just how powerful this platform can be.</p>
<p>Though I have a slight preference for external CICD workflows, there's no denying that Cloudflare Pages' native features are top-notch. And guess what? The platform caters to everyone's convenience - whether you prefer deploying through a user-friendly UI or the flexibility of a CLI, where the wrangler-cli comes in handy.</p>
<p>One particular feature that has proved invaluable for me is DIRECT-UPLOAD. Combining this with GitHub actions allows me to create an almost cost-free solution for hosting frontends. This can be extended to multiple branches, enabling triggers on different branches and hosting them on distinct sub-domains. With a little tweaking, the possibilities are vast.</p>
<p>In this blog series, I'll be exploring Cloudflare Pages in-depth. I'll walk you through the process of deploying your sites onto Cloudflare Pages for free and creating a comprehensive CI/CD workflow for your front-end projects using GitHub Actions.</p>
]]></content:encoded></item><item><title><![CDATA[Ansible-playbook to create new users in the remote servers]]></title><description><![CDATA[In this article, I will writing to configure an ansible-playbook for creating a new users in the remote users using the user module provided by the Ansible
Ansible is a feasible configuration management tool which works on the configuration push prot...]]></description><link>https://amansamalmagar.com.np/ansible-playbook-to-create-new-users-in-the-remote-servers-a5c31ee55e82</link><guid isPermaLink="true">https://amansamalmagar.com.np/ansible-playbook-to-create-new-users-in-the-remote-servers-a5c31ee55e82</guid><dc:creator><![CDATA[Aman Samal Magar]]></dc:creator><pubDate>Mon, 26 Sep 2022 06:49:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1667040198765/O3_pvtpPi.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article, I will writing to configure an ansible-playbook for creating a new users in the remote users using the user module provided by the Ansible</p>
<p>Ansible is a feasible configuration management tool which works on the configuration push protocol so it pushes its configurations setup in the playbook through the ssh-key setup during the initial configuration.</p>
<p>Here is the working ansible-playbook for user creation which you can include in your ansible playbook collections for managing your servers.</p>
<p>---</p>
<p>- name: Create User with sudo priviledge on your server</p>
<p>hosts: all</p>
<p>become: yes</p>
<p>vars_prompt:</p>
<p>- name: username</p>
<p>private: false</p>
<p>prompt: "Please provide a username. This user will be provided with sudoers access"</p>
<p>vars:</p>
<p>password: "{{ lookup('password', '/dev/null length=15 chars=ascii_letters') }}"</p>
<p>tasks:</p>
<p>- set_fact:</p>
<p>password_fact: "{{password}}"</p>
<p>- name: Create a login user</p>
<p>user:</p>
<p>name: "{{ username }}"</p>
<p>password: "{{ password_fact | password_hash('sha512') }}"</p>
<p>create_home : yes</p>
<p>home: /home/{{ username }}</p>
<p>groups:</p>
<p>- ''</p>
<p>- sudo</p>
<p>shell: /bin/bash</p>
<p>state: present</p>
<p>- debug:</p>
<p>msg: " The credentials are Username: {{username}} Password: {{password_fact}} "</p>
<p>The ansible playbooks are written in .yml format so the indentation is compulsory so make sure to look after that.</p>
<p>- name: Create User with sudo priviledge on your server</p>
<p>hosts: all</p>
<p>become: yes</p>
<p>vars_prompt:</p>
<p>- name: username</p>
<p>private: false</p>
<p>prompt: "Please provide a username. This user will be provided with sudoers access"</p>
<p>vars:</p>
<p>password: "{{ lookup('password', '/dev/null length=15 chars=ascii_letters') }}"</p>
<blockquote>
<p>name: Name of the ansible-playbook</p>
<p>hosts: Hosts to be target. All hosts are targeted from this playbook</p>
<p>vars_prompt: Asks for input using and store inwhose value will be used in the tasks to be done in the playbook</p>
<p>vars: The variables to be used. <strong><em>Password</em></strong> is randomly generated of 15 lengths</p>
</blockquote>
<p>The tasks are where the magic happens in the ansible-playbook. You can configure tasks to be run in the server through ansible-built-in module or using community modules</p>
<p>tasks:</p>
<p>- set_fact:</p>
<p>password_fact: "{{password}}"</p>
<p>- name: Create a login user</p>
<p>user:</p>
<p>name: "{{ username }}"</p>
<p>password: "{{ password_fact | password_hash('sha512') }}"</p>
<p>create_home : yes</p>
<p>home: /home/{{ username }}</p>
<p>groups:</p>
<p>- ''</p>
<p>- sudo</p>
<p>shell: /bin/bash</p>
<p>state: present</p>
<p>- debug:</p>
<p>msg: " The credentials are Username: {{username}} Password: {{password_fact}} "</p>
<p>This uses the ansible built-in user module which is used to manage user settings in the remote servers. Here, it creates a user in the remote user with the name specified in the <em>vars_prompt</em> above. Password is provided through <em>vars</em> provided.</p>
<blockquote>
<p><strong><em>NOTE: Always hash your password, the ansible causes conflict and might not take the password provided without any hashing provided.</em></strong></p>
</blockquote>
<p>This playbook creates:</p>
<ul>
<li>new user with username provided through <em>vars_prompt</em></li>
<li>password provided through <em>vars: password</em></li>
<li>creates home directory with <em>create_home:</em> and specify home directory with <em>home:</em></li>
<li>adds to group: primary group and sudoers group for sudo access</li>
<li>The credentials are displayed through the <em>msg</em></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[E-learning during the Lockdown 2.0 : Nepal]]></title><description><![CDATA[Nepal starts its lockdown with the rapid growth in the spread in the new mutant COVID-infections. The India has been suffering a lot through the second wave of COVID-19 in the country with around 300k daily new cases and 3.5M active cases in the coun...]]></description><link>https://amansamalmagar.com.np/e-learning-during-the-lockdown-2-0-nepal-49dda8d75233</link><guid isPermaLink="true">https://amansamalmagar.com.np/e-learning-during-the-lockdown-2-0-nepal-49dda8d75233</guid><dc:creator><![CDATA[Aman Samal Magar]]></dc:creator><pubDate>Sun, 09 May 2021 07:06:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1667040232462/yqfKZOBLqd.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Nepal starts its lockdown with the rapid growth in the spread in the new mutant COVID-infections. The India has been suffering a lot through the second wave of COVID-19 in the country with around <a target="_blank" href="https://www.nytimes.com/interactive/2020/world/asia/india-coronavirus-cases.html#cases">300k</a> daily new cases and <a target="_blank" href="https://www.worldometers.info/coronavirus/country/india/">3.5M</a> active cases in the country. As Nepal shares an open border with the country, the chances of Nepal falling in the same situation is high with the daily <a target="_blank" href="https://www.worldometers.info/coronavirus/country/nepal/">7.5k</a> new cases and around <a target="_blank" href="https://www.worldometers.info/coronavirus/country/nepal/">60k</a> active cases. So Nepal government has taken measures for lockdown staring from 6 AM on April 29 to May 13 as per the decision from the cabinet.</p>
<p>Empty ring road of Kathmandu Valley</p>
<p>This lockdown came with preparations. As the country faced 5 long months nationwide lockdown from 24 Mar to 21 Jul. Many institutions and organizations continued their affairs as smoothly as possible through work from home and online learning. Unlike the previous lockdown, the students did not have to miss out and delay their syllabus as the e-learning started along with the lockdown with lectures being provided actively as the physical classes.</p>
<p>The educational institutions have increased the classes period as compared to the previous lockdown but we have to agree that the lockdown has provided the students with more spare time. This might lead to the students being less focused on studies and less productive. I myself being an undergrad student try to keep myself busy during the quarantine learning new things and try being productive. As a IT student , I have researched and put together some of the best websites I have used to learn for my fellow brothers and sisters to keep learning.</p>
<p><strong>Genese Cloud Academy</strong></p>
<p><a target="_blank" href="https://www.genesecloud.academy/"><strong>This</strong></a> learning platform is under Genese Cloud Solutions which provides physical lectures but also has big library for online lectures for free in Nepali on different topics like cloud computing, machine learning and other trending topics in the IT industry.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667040219317/c7mXWfoNJk.png" alt="GCA dashboard" /></p>
<p>GCA dashboard</p>
<h4 id="heading-udemy"><strong>Udemy</strong></h4>
<p><a target="_blank" href="https://www.udemy.com/"><strong>This</strong></a> is one of the leading online global learning platforms which provides courses on various topics ranging from development, marketing and so on. It provides many good courses for free but also provide very good paid courses on various topics. You can also get total discount coupons on various paid courses through various websites like <a target="_blank" href="https://docs.google.com/document/d/1abAtg3tFaUX3ISgk8LngxhhrUI1nX8CYqZcjSyR2QAA/edit?usp=sharing"><strong>here</strong></a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667040220951/XsDygVOca2.png" alt="Udemy home page" /></p>
<p>Udemy Home Page</p>
<p><strong>AWS educate</strong></p>
<p><a target="_blank" href="https://www.awseducate.com/signin/SiteLogin?ec=302&amp;startURL=%2Fstudent%2Fs%2F"><strong>It</strong></a> is the e-learning platform managed by Amazon which provides free courses on cloud computing mainly on its product: Amazon Web Services (AWS). You can also find various pathways and study about the major concepts like OS, networking, programming along the way. I personally advise you to go through the <em>Cloud Computing 101</em> course first to gain basic knowledges on Cloud computing.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667040222718/oDx_vatTnc.png" alt="AWS educate Dashboard" /></p>
<p>AWSeducate dashboard</p>
<p><strong>YouTube</strong></p>
<p>We can’t deny the fact that <a target="_blank" href="https://www.youtube.com/"><strong>YouTube</strong></a> is one of the best platforms for learning various topics. I as a IT student have learnt a lot through it. I have some of my personal favorite channels which teaches different topics from OS, data science, programming, web dev in <a target="_blank" href="https://docs.google.com/document/d/1abAtg3tFaUX3ISgk8LngxhhrUI1nX8CYqZcjSyR2QAA/edit"><strong>here</strong></a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667040224574/f9-gVFRrJ.png" alt="YouTube playing Network Chuck" /></p>
<p>Network Chuck running in YouTube</p>
<p><strong>Coursera</strong></p>
<p><a target="_blank" href="https://www.coursera.org/browse"><strong>This</strong></a> is one of the biggest e-learning platforms with courses partnered with more than 200 leading universities of the world. It has a huge database of courses in different areas of study like computer science, business, art and design. It also provides many professional certificate courses totally online recognized by the top employers and has also been providing online undergraduate and graduate degrees in lower cost. You can also apply for financial aid if you really like the course structure and want to enroll in it</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667040226669/ODOppdYxq.png" alt="Coursera Courses Catalog" /></p>
<p>Coursera Courses Catalog</p>
<p><strong>Udacity</strong></p>
<p><a target="_blank" href="https://www.udacity.com/?cjevent=4e84c5b67e8f11ea83f3010c0a18050d"><strong>This</strong></a> is also one of the most popular platforms used for the learning various tech skills required. It main get go is the specialized nanodegree formulated by the company in different topics like cyber security, cloud computing, AI etc. Along with that, with some research, you can find some good free beginner courses on the platform.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667040228189/S4zNjbX9r.png" alt /></p>
<p><strong>CISCO Networking Academy</strong></p>
<p>CISCO being the leader in the networking industry has been providing many free online self paced courses in different topics like cyber security, networking, system. The Cisco certifications are one of the most valued certifications for the employers around the world n the systems, networking and operations field. They have also starting giving programming courses through the platform. You can register to the website through <a target="_blank" href="https://id.cisco.com/signin/register"><strong>here</strong></a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667040229668/RQqEsE1BX.png" alt="The courses catalog of NETACAD" /></p>
<p>NETACAD courses catalog</p>
<p><strong>GitHub Student Developer Pack</strong></p>
<p><a target="_blank" href="https://education.github.com/pack/offers?sort=popularity&amp;tag=All"><strong>This student developer pack</strong></a> is managed and provided by the GitHub after providing them with your college email address . The pack includes various paid plans and products for free after the verification of you as a student enrolled in some kind of diploma or degree. You must have an GitHub account to get this student pack. The products ranges from marketing, developer and design tools for free. Some of the best products provided are the domain names provided to you for free, cloud services like <a target="_blank" href="https://www.digitalocean.com/github-students/?utm_medium=partnerships&amp;utm_source=github&amp;utm_campaign=studentdevpack"><strong>Digital Ocean</strong></a>, <a target="_blank" href="https://azure.microsoft.com/en-us/free/students/"><strong>Microsoft Azure</strong></a> , design tools like <a target="_blank" href="https://www.canva.com/education/github/"><strong>Canva</strong></a>, learning platforms like <a target="_blank" href="https://www.datacamp.com/github-students"><strong>DataCamp</strong></a>, <a target="_blank" href="https://www.educative.io/github-students?utm_source=github-student-pack"><strong>educative.io</strong></a> and so on.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667040231072/A7WNSbmN4_.png" alt="The courses catalog of the Github Student Developer Pack" /></p>
<p>GitHub Student Developer Pack</p>
<p>All the above websites are some of the websites that I used myself during the lockdown to learn some new skills. I may have missed out many good websites that you people use. Please mention the missing websites in the comments or you can directly message me so that I can update or upload the next list of the websites for you to check out.</p>
<h4 id="heading-i-hope-the-list-helps-you-in-your-learning-journey">I hope the list helps you in your learning journey.</h4>
<blockquote>
<p>Keep learning . Let’s be productive during the lockdown and gather additional skills in your skillsets.</p>
<p>Stay Safe. Happy learning.</p>
</blockquote>
<h4 id="heading-lets-connect-through-my-socials-please-feel-free-to-reach-out-to-me-through">Let’s connect through my socials. Please feel free to reach out to me through</h4>
<h4 id="heading-aman-samal-magar-or-linkedinhttpswwwlinkedincominasm0011"><a target="_blank" href="https://www.linkedin.com/in/asm0011/">Aman Samal Magar | LinkedIn</a></h4>
]]></content:encoded></item></channel></rss>