<?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[blog.cloudterms.net - Medium]]></title>
        <description><![CDATA[Real-world cloud engineering insights - Medium]]></description>
        <link>https://medium.com/kubehub?source=rss----11310267cd58---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>blog.cloudterms.net - Medium</title>
            <link>https://medium.com/kubehub?source=rss----11310267cd58---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 18:49:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/kubehub" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AWS Security Series: AWS Access Key is Compromised. Now What? An Incident Response Playbook.]]></title>
            <link>https://medium.com/kubehub/aws-security-series-aws-access-key-is-compromised-now-what-an-incident-response-playbook-c568327fc7f6?source=rss----11310267cd58---4</link>
            <guid isPermaLink="false">https://medium.com/p/c568327fc7f6</guid>
            <category><![CDATA[access-control]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[aws-iam]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-security]]></category>
            <dc:creator><![CDATA[Md Shamim]]></dc:creator>
            <pubDate>Mon, 19 Jan 2026 17:24:41 GMT</pubDate>
            <atom:updated>2026-01-19T17:24:40.781Z</atom:updated>
            <content:encoded><![CDATA[<h4>A real-world playbook for responding to exposed AWS access keys without breaking production</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*WfuZiYRbKUTQuSjn.png" /></figure><p>In the world of AWS, it’s always best practice to <strong>use IAM roles whenever possible.</strong> IAM roles provide temporary, automatically rotated credentials that are the gold standard for security. But reality is not the same. What happens when we need to integrate with a third-party service that only supports static, long-term credentials? This is where the IAM user with an access key becomes a necessary…</p><p>So, the critical moment arrives: <strong>an access key is exposed. What to do?</strong></p><h4>Phase 1: Assess the situation</h4><p>Our first instinct might be to hit the delete button-and fast. But hold on. A rash deletion could instantly break our production environment. A smarter, safer first move is to <strong>deactivate</strong> the key. Think of it as putting the key on ‘pause.’ It immediately stops working, giving you a crucial window to assess the impact on the applications.</p><p>Often, AWS detects this kind of exposure. It might send a notification and even proactively attach the <a href="https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSCompromisedKeyQuarantineV3.html">AWSCompromisedKeyQuarantineV3</a> policy to the user to help limit the damage.</p><h4>Phase 2: The Hidden Threat</h4><p>We’ve deactivated the key, created a new set, and updated our applications. But then, when we check CloudTrail, and shocked!!! Unauthorized API calls are still happening.</p><p><strong>How is this possible?<br></strong>The attacker was one step ahead. Before we deactivated the main key, they used it to generate <strong>temporary session tokens</strong> using a command like this:</p><pre>aws sts get-session-token --duration-seconds 129600 # (36 hours)</pre><p>These tokens are independent of the original key. They can remain valid for up to 36 hours, allowing the attacker to maintain a persistent backdoor even after the original key is compromised.</p><h4>Phase 3: Add Deny Policy to restrict Temporary Credentials</h4><p>We can create a “time-based fence” with an IAM policy to block <em>new</em> temporary tokens; Therefore, we can use a policy like the following:</p><pre>{ &quot;Version&quot;: &quot;2012-10-17&quot;, &quot;Statement&quot;: [ { &quot;Sid&quot;: &quot;DenyAccessWithTemporaryCredentialsIssuedAfterCompromise&quot;, &quot;Effect&quot;: &quot;Deny&quot;, &quot;Action&quot;: &quot;*&quot;, &quot;Resource&quot;: &quot;*&quot;, &quot;Condition&quot;: { &quot;DateLessThan&quot;: { &quot;aws:TokenIssueTime&quot;: &quot;2025-12-08T16:00:00Z&quot; } } } ] }</pre><p>Deny all temporary credentials that were created before the exposure of access keys.</p><h4>Phase 4: The Recovery — Restoring Access Safely</h4><p>It’s time to rebuild. The goal is to restore access without re-introducing the same risk.</p><ol><li><strong>Create New Credentials:</strong> The cleanest approach is to create brand new access keys. And review the policy and apply the <strong>principle of least privilege</strong>, granting only the permissions necessary for its job.</li><li><strong>Update All Systems:</strong> Update every application, script, configuration file, and secret store (like AWS Secrets Manager) with the new credentials.</li></ol><h4>Phase 5: The Post-Mortem — Hardening Our Defenses</h4><p>The incident is over, but the work isn’t. Now it’s time to learn from the attack and strengthen our defenses.</p><ol><li><strong>Forensic Analysis with CloudTrail:</strong> Dive into CloudTrail logs. Filter events by the compromised user’s name to see every API call they made. What data did they access? Did they try to create new users, roles, or backdoors? This log is our forensic evidence of the attack’s scope.</li><li><strong>Threat Detection with GuardDuty:</strong> We can use Amazon GuardDuty is an intelligent threat detection service that was likely monitoring our account during the attack. Review its findings for indicators of compromise, such as unusual API behavior or attempts to escalate privileges. GuardDuty can help us uncover other malicious activity we might have missed.</li></ol><p><em>Originally published at </em><a href="https://dev.to/shamimice03/aws-security-series-aws-access-key-is-compromised-now-what-an-incident-response-playbook-448b"><em>https://dev.to</em></a><em> on December 8, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c568327fc7f6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kubehub/aws-security-series-aws-access-key-is-compromised-now-what-an-incident-response-playbook-c568327fc7f6">AWS Security Series: AWS Access Key is Compromised. Now What? An Incident Response Playbook.</a> was originally published in <a href="https://medium.com/kubehub">blog.cloudterms.net</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is TypeScript, and why should we use it?]]></title>
            <link>https://medium.com/kubehub/what-is-typescript-and-why-should-we-use-it-7b9261a14c44?source=rss----11310267cd58---4</link>
            <guid isPermaLink="false">https://medium.com/p/7b9261a14c44</guid>
            <category><![CDATA[type]]></category>
            <category><![CDATA[dynamic-typing]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Mehedi Hasan]]></dc:creator>
            <pubDate>Wed, 11 Oct 2023 04:34:42 GMT</pubDate>
            <atom:updated>2023-10-11T04:34:42.547Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*E-xxM2o9O0cYlhq4YrE_Pw.jpeg" /><figcaption>Image source: <a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fstrapi.io%2Fblog%2Ftypescript-vs-javascript-which-one-should-you-use-with-strapi&amp;psig=AOvVaw06ux8MD-9Q8apsvC8qCeSY&amp;ust=1697011325277000&amp;source=images&amp;cd=vfe&amp;opi=89978449&amp;ved=0CBEQjRxqFwoTCICQ_vuB64EDFQAAAAAdAAAAABBG">link</a></figcaption></figure><h3><strong>What is TypeScript?</strong></h3><p>TypeScript is a JavaScript subset, which means it builds upon javaScript, has all its features, and adds features like a type system.</p><p>A misconception about typeScript is that it is a brand new programming language but it is not. It just adds new Features and Advantages to JavaScript.Its purpose is to make JavaScript code easier and more powerful.</p><blockquote><strong>Type System</strong>: If you want to use data Types (e.g., numbers, strings, objects) in your programming language to manipulate your data so you can prevent certain types of errors, such as type mismatches and invalid operations you have to do it by following rules and constraints set by the type system.</blockquote><h3>TypeScript vs JavaScript:</h3><p>There are fundamental differences between TypeScript and JavaScript</p><h4><strong>1. Compile Step or Tooling:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*LkSxCxH-SCKt3Bmsd2-81A.png" /><figcaption>Image Source: <a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fwww.typescripttutorial.net%2Ftypescript-tutorial%2Fwhat-is-typescript%2F&amp;psig=AOvVaw06ux8MD-9Q8apsvC8qCeSY&amp;ust=1697011325277000&amp;source=images&amp;cd=vfe&amp;opi=89978449&amp;ved=0CBEQjRxqFwoTCIjV68KV64EDFQAAAAAdAAAAABAJ">link</a></figcaption></figure><p><strong>In TypeScript:</strong></p><ul><li>Browser can not execute TypeScript so do Node.js. So to use it you need to compile it.</li><li>TypeScript is a programming language and a compiler.</li><li>TypeScript Compiler compiles TypeScript code to JavaScript also its additional feature.</li></ul><p><strong>In JavaScript:</strong></p><ul><li>JavaScript does not need to be complied</li><li>JavaScript directly runs on the browser</li></ul><h4>2.<strong> Type System and Error Checking:</strong></h4><p><strong>In TypeScript:</strong></p><ul><li>TypeScript is statically typed.</li><li>It can declare types for variables, function parameters, and return values.</li><li>It checks for Type-related errors at compile time so that can we discover type errors before the execution of code.</li><li>Example:</li></ul><pre>//myScript.ts<br>let myString: string = &quot;Hello&quot;;<br>myString = 42; // TypeScript error: Type &#39;number&#39; is not assignable to type &#39;string&#39;</pre><blockquote>NOTE: compile myScript.ts file using ‘tsc’ typescript compilertsc <em>myScript.ts </em>to plain myScript.js code before running it in the web browser or Node.js server</blockquote><p><strong>In JavaScript:</strong></p><ul><li>JavaScript is dynamically typed.</li><li>It doesn&#39;t have any type of declaration.</li><li>it checks types in runtime. So type-related errors only be found after code execution.</li><li>Example</li></ul><pre>//myScript.js<br>let myString = &quot;Hello&quot;;<br>myString = 42; // This is allowed in JavaScript</pre><p><strong>3. Code Readability and Maintainability:</strong></p><ul><li><em>In JavaScript</em>: Because of type system is dynamic it became harder to read and maintain in large-scale projects and codebase.</li><li><em>In TypeScript: </em>Because the type system is static became easier to read and maintain in large-scale projects and codebase.</li></ul><p><strong>4. File Extension:</strong></p><ul><li>myScript.js (javascript)</li><li>myScript.ts (typescript)</li></ul><h3>References:</h3><p><a href="https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html">Documentation - TypeScript for JavaScript Programmers</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b9261a14c44" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kubehub/what-is-typescript-and-why-should-we-use-it-7b9261a14c44">What is TypeScript, and why should we use it?</a> was originally published in <a href="https://medium.com/kubehub">blog.cloudterms.net</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Restrict SSH within EC2 Instance Connect and Your Region]]></title>
            <link>https://medium.com/kubehub/restrict-ssh-within-ec2-instance-connect-and-your-region-ccd5d241c4e3?source=rss----11310267cd58---4</link>
            <guid isPermaLink="false">https://medium.com/p/ccd5d241c4e3</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[ec2-instance-connect]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Md Shamim]]></dc:creator>
            <pubDate>Wed, 27 Sep 2023 10:56:40 GMT</pubDate>
            <atom:updated>2023-09-27T10:55:34.462Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to restrict SSH connection within EC2 Instance Connect</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LA7EGN34FTqPh6kDumqV-g.png" /></figure><p>We can restrict SSH connection within our <strong>region </strong>and <strong>EC2 instance connect</strong> using the IP Ranges of the EC2 instance connect.</p><p>Search for the IP range of your region and service from the following link:</p><ul><li><a href="https://ip-ranges.amazonaws.com/ip-ranges.json">https://ip-ranges.amazonaws.com/ip-ranges.json</a></li></ul><p>In my case, my region code is ap-northeast-1 and service is EC2_INSTANCE_CONNECT :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*-K3vvtELI9tQcwJnavA90Q.png" /></figure><p>Now, configure the security group accordingly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i-hNPTR2Ke7yYS3KfFZUcg.png" /></figure><p>And then, attach the security group with the target instances.</p><blockquote><em>If you found this article useful, please click on the </em><strong><em>Follow </em></strong><em>👉 and </em><strong><em>Clap </em></strong><em>👏 buttons to support me in writing more articles like this.<br>Thank you ❤</em></blockquote><h4>🔔 Follow me on <a href="https://www.linkedin.com/in/shamimice03/">LinkedIn </a>| <a href="http://github.com/shamimice03">GitHub </a>| <a href="https://twitter.com/shamimice03">Twitter</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccd5d241c4e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kubehub/restrict-ssh-within-ec2-instance-connect-and-your-region-ccd5d241c4e3">Restrict SSH within EC2 Instance Connect and Your Region</a> was originally published in <a href="https://medium.com/kubehub">blog.cloudterms.net</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Use Mongoose]]></title>
            <link>https://medium.com/kubehub/how-to-use-mongoose-9ee160d601b7?source=rss----11310267cd58---4</link>
            <guid isPermaLink="false">https://medium.com/p/9ee160d601b7</guid>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[mongoose]]></category>
            <category><![CDATA[expressjs]]></category>
            <dc:creator><![CDATA[Mehedi Hasan]]></dc:creator>
            <pubDate>Sun, 03 Sep 2023 15:52:19 GMT</pubDate>
            <atom:updated>2023-09-03T15:52:19.221Z</atom:updated>
            <content:encoded><![CDATA[<h4>A basic guideline to get started with Mongoose</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*N6dm2U1RRmlWFqv9yTVqcw.png" /><figcaption>Image source: <a href="https://miro.medium.com/v2/resize:fit:648/1*iDvsmUwzZQxJSKdL0xzwIA.png">link</a></figcaption></figure><p>In this article, we will work with <strong>Mongoose </strong>and use it in our <strong>Node.js</strong> and <strong>MongoDB</strong> projects.</p><h4>What is Mongoose?</h4><p>Mongoose is an <strong>O</strong>bject-<strong>D</strong>ocument <strong>M</strong>apping Library (<strong>ODM</strong>). It’s a Document Database, not a Relational Database like <strong>Sequelize</strong> which we use in <strong>MySql</strong>.</p><h4>How it works?</h4><p>Let’s say we have a JavaScript Object and want to save it to a collection. We want to map our JavaScript Object to a document in a collection. To work with MongoDB even more easily, we use Mongoose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*qfuXhY2f77s3XdnGfckKlQ.png" /></figure><p>When we work with MongoDB, we can insert a user into a MongoDB collection using a raw MongoDB query:</p><pre>db.collection(&#39;users&#39;).insertOne({name: &#39;Max&#39;, age: 23, password: &#39;helolo20&#39;})</pre><p><strong>Now</strong>, let’s see how we can perform the same operation using <strong>Mongoose</strong>:</p><pre>const user = User.create({name: &#39;Max&#39;, age: 23, password: &#39;helolo20&#39;})</pre><p>We’re using <strong>Mongoose </strong>to create a <strong>user </strong>instance and save it to the database. But it’s not enough to understand the benefits Mongoose brings to work with <strong>MongoDB</strong>. Later, we will see a more concise use of it.</p><p>So, <strong>Mongoose </strong>helps us define models and work with models, and in models where all queries work behind the scenes also we can influence and change things.</p><h4>Core Concepts of Mongoose:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*XpWf7BkZGLWJ01ZNzL_wAg.png" /></figure><p>Here, Schemas and Models → Define how our data should look like,</p><p>Instances → We instantiate our models by creating real JavaScript Objects and work on that model blueprints,</p><p>Queries → We use built-in queries provided by <strong>Mongoose</strong> to work with our models and instances.</p><h4>Our GitHub link to the Project:</h4><p>G<a href="https://github.com/mohamim360/NodeJs/tree/main/M13%20Working%20with%20Mongoose/211.%20Connecting%20to%20the%20MongoDB%20Server%20with%20Mongoose">itHub link</a></p><h4>NPM Install</h4><p>Let’s go to the project folder and initialize our project</p><pre>npm init</pre><p>Let’s install <strong>Mongoose</strong>:</p><pre>npm install mongoose</pre><h4>Connecting to the MongoDB Server with Mongoose:</h4><p><strong>previously</strong>, we connected to <strong>MongoDB </strong>without <strong>Mongoose</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/180/1*ku1fhuB3XEjdCRmCgG5mfw.png" /></figure><pre>const mongodb = require(&quot;mongodb&quot;);<br><br>const MongoClient = mongodb.MongoClient;<br><br>let _db;<br>const mongoConnect = (callback) =&gt; {<br>  MongoClient.connect(<br>    &quot;mongodb+srv://mohamim360:M51lUp9tDsG545SF@cluster0.k4fqzxy.mongodb.net/shop?retryWrites=true&amp;w=majority&quot;<br>  )<br>    .then((client) =&gt; {<br>      console.log(&quot;Connected&quot;);<br>      _db = client.db();<br>      callback();<br>    })<br>    .catch((err) =&gt; {<br>      console.log(err);<br>      throw err;<br>    });<br>};<br>const getDb = () =&gt; {<br>  if (_db) {<br>    return _db;<br>  }<br>  throw &quot;No database found!&quot;;<br>};<br><br>exports.mongoConnect = mongoConnect;<br>exports.getDb = getDb;</pre><p><strong>Now </strong>we want to use <strong>Mongoose</strong>:</p><p>We no longer need ./utilities/database.js file anymore because <strong>Mongoose </strong>can do management of connections for us behind the scenes. Here, we connect to the <strong>shop </strong>database</p><p>In ./app.js file :</p><pre>const mongoose = require(&quot;mongoose&quot;); // Import the Mongoose library to work with MongoDB.// Connect to the MongoDB database using the given connection string.<br><br>mongoose<br>  .connect(<br>    &quot;mongodb+srv://mohamim360:M51lUp9tDsG545SF@cluster0.k4fqzxy.mongodb.net/shop?retryWrites=true&amp;w=majority&quot;<br>  )<br>  .then((result) =&gt; {<br>    console.log(&#39;connected&#39;);  // If the connection is successful, log &quot;connected&quot; to the console.<br>    app.listen(3000);<br>  })<br>  .catch((err) =&gt; {<br>    console.log(err);<br>  });</pre><h4>Creating a Schema:</h4><p>Creating the <strong>Product </strong>Schema in ./models/product.js :</p><pre>const mongoose = require(&#39;mongoose&#39;);<br><br>//import Schema from mongoose object<br><br>const Schema = mongoose.Schema; // This will be Schema Constructor<br><br>//constructor allows me to create new schema and i will create new Schema(product schema)<br>//i create a new schema by instantiating a schema object by calling new schema using that constructor<br>//I pass a javascript object and in that object you now define how your product should look like<br><br>const productSchema = new Schema({ <br>   //define data schema<br>   title: {<br>    type: String,<br>    required: true<br>   },<br>   price: {<br>    type: Number,<br>    required: true<br>   },<br>   description: {<br>    type: String,<br>    required: true<br>   },<br>   imageUrl: {<br>    type: String,<br>    required: true<br>   }<br>})<br><br>module.exports = mongoose.model(&#39;Product&#39;,productSchema);</pre><blockquote>NOTE 1: <strong>MongoDB </strong>is schemaless. <strong>Mongoose </strong>give us schemas to give structure to data. we can also not use it if it not necessary.</blockquote><blockquote>NOTE 2: we did not define ‘<strong>_id</strong>’ field because MongoDB adds it automatically for us</blockquote><p><strong>Next step</strong>, we will create a model based on Schema.</p><h4>Saving Data Through Mongoose:</h4><p><strong><em>Creating a Mongoose Model:</em></strong></p><p>After defining a <strong>Mongoose </strong>Schema (<strong>productSchema</strong>), we need to connect our schema with the name <strong>Product</strong>, so we use mongoose.model() the function for it and after that, we need to export it so that we can use and connect to our schema. In ./models/product.js :</p><pre>module.exports = mongoose.model(&#39;Product&#39;,productSchema);</pre><p><strong><em>Refactoring the Controller:</em></strong></p><p><strong>Previously </strong>when we only used MongoDB, we did things like this in ./controllers/admin.js :</p><pre>const Product = require(&quot;../models/product&quot;);<br><br>exports.postAddProducts = (req, res) =&gt; {<br>  const title = req.body.title;<br>  const imageUrl = req.body.imageUrl;<br>  const price = req.body.price;<br>  const description = req.body.description;<br><br>  const product = new Product(title, price, description, imageUrl, null , req.user._id);<br>  product<br>    .save()<br>    .then((result) =&gt; {<br>      //console.log(result);<br>      console.log(&quot;data&quot;);<br>      res.redirect(&quot;/admin/products&quot;);<br>    })<br>    .catch((err) =&gt; console.log(err));<br>};</pre><p>And we provided save() method in ./models/product.js :</p><pre>//save<br>  save() {<br>    const db = getDb();<br>    let dbOp;<br>    if (this._id) {<br>      dbOp = db<br>        .collection(&quot;products&quot;)<br>        .updateOne({ _id: this._id }, { $set: this });<br>    } else {<br>      dbOp = db.collection(&quot;products&quot;).insertOne(this);<br>    }<br>    return dbOp<br>      .then((result) =&gt; {<br>        console.log(result);<br>      })<br>      .catch((err) =&gt; {<br>        console.log(err);<br>      });<br>  }</pre><p><strong>Now </strong>we woke on the <strong>Mongoose </strong>model herein ./controllers/admin.js :</p><ol><li>To Product constructor, Instead of passing multiple arguments, we pass one argument as a JavaScript object where we map incoming data (e.g., title, price, etc.) to our Schema</li><li><strong><em>Saving Data</em></strong>: Mongoose automatically provides a save() method for our model. we use this save() method to save new products to MongoDB.</li></ol><p>In ./controllers/admin.js :</p><pre>const Product = require(&quot;../models/product&quot;);<br><br>exports.postAddProducts = (req, res) =&gt; {<br><br>  const title = req.body.title;<br>  const imageUrl = req.body.imageUrl;<br>  const price = req.body.price;<br>  const description = req.body.description;<br><br>  const product = new Product({<br><br>//left-side-&gt;keys you defined in your schema<br>//right-side-&gt;data you receive<br><br>    title: title, <br>    price: price,<br>    description: description,<br>    imageUrl: imageUrl,<br>  }); //order does not matter because it is JavaScript Object<br>  product<br>    .save()    //method given by mongoose to save data<br>    .then((result) =&gt; {<br>      //console.log(result);<br>      console.log(&quot;data&quot;);<br>      res.redirect(&quot;/admin/products&quot;);<br>    })<br>    .catch((err) =&gt; console.log(err));<br>};</pre><p>Now let’s see our <strong>MongoDB </strong>database how it looks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SxBid-ulwUqtzni4-48KHQ.png" /></figure><p>we connected to the <strong>shop </strong>database and we have a collection of ‘products’, but from where is the <strong>products </strong>collection coming? Without <strong>Mongoose </strong>we defined collection like this :</p><pre>db.collection(&quot;products&quot;)</pre><p>But Now in <strong>Mongoose</strong>, we do not need to define the collection, Mongoose does it for us by deriving the name of the model <strong>Product</strong>, then turning it into a lowercase <strong>product </strong>and taking the plural form of that like <strong>products.</strong></p><h4>Fetching all data and a single data from the collection:</h4><p><em>We are going to fetch all products and a single product from the</em><strong><em> products</em></strong><em> collection using </em><em>find() and </em><em>findById() the method provided by </em><strong><em>Mongoose</em></strong><em>.</em></p><p><strong>Previously</strong> we built our own method like fetchAll() and findById() in models, you can see them here- (<a href="https://github.com/mohamim360/NodeJs/blob/main/M12%20NoSQL%20and%20mongoDB/180.%20Installing%20the%20MongoDB%20Driver/models/product.js">Github link</a>).</p><p><strong>Now </strong>we going to use the build-in method provided by Mongoose</p><p><strong>find()</strong> method helps you query the MongoDB database. It allows you to retrieve one or more documents from a collection based on specified conditions. Here in ./controllers/shop.js :</p><pre>const Product = require(&quot;../models/product&quot;);<br><br>exports.getProducts = (req, res, next) =&gt; {<br>  Product.find()<br>    .then((products) =&gt; {<br>      res.render(&quot;shop/product-list&quot;, {<br>        prods: products,<br>        pageTitle: &quot;shop&quot;,<br>        path: &quot;/products&quot;,<br>      });<br>    })<br>    .catch((err) =&gt; console.log(err));<br>};</pre><blockquote><strong>NOTE</strong>: In MongoDB , <em>find()</em>method give us a <em>cursor()</em> but not in Mongoose, you can use it like this <em>find().cursor()</em> (A <strong>cursor</strong> is a pointer and iterator to the result set of query that allows you to traverse and retrieve documents from database one at a time) and then <em>cursor().eachAsync()</em> which allow you loop through documents or <em>cursor().next()</em>to get next element.</blockquote><p><strong>findById()</strong> help you retrieve a document from a database by its unique identifier(_id). We also can pass a string to findById() and Mongoose automatically converts this to an object ID.</p><p>In ./controllers/admin.js :</p><pre>const Product = require(&quot;../models/product&quot;);<br><br>exports.getProduct = (req, res, next) =&gt; {<br>  const prodID = req.params.productId;<br>  Product.findById(prodID)<br>    .then((product) =&gt; {<br>      res.render(&quot;shop/product-detail&quot;, {<br>        product: product,<br>        pageTitle: product.title,<br>        path: &quot;/products&quot;,<br>      });<br>    })<br>    .catch((err) =&gt; console.log(err));<br>};</pre><h4>Update Database using Mongoose:</h4><p>In ./controllers/admin.js</p><pre>const Product = require(&quot;../models/product&quot;);<br><br>exports.postEditProducts = (req, res, next) =&gt; {<br>  const prodId = req.body.productId;<br>  const updatedTitle = req.body.title;<br>  const updatedImageUrl = req.body.imageUrl;<br>  const updatedDescription = req.body.description;<br>  const updatedPrice = req.body.price;<br><br>Product.findById(prodId)<br>    .then((product) =&gt; {<br>      product.title = updatedTitle;<br>      product.price = updatedPrice;<br>      product.description = updatedDescription;<br>      product.imageUrl = updatedImageUrl;<br>      return product // fetched product will not be a js object with data but a full Mongoose object<br>        .save(); //so, we can call mongoose method here<br>    })<br>    .then((result) =&gt; {<br>      console.log(&quot;UPDATE PRODUCT&quot;);<br>      res.redirect(&quot;/admin/products&quot;);<br>    })<br>    .catch((err) =&gt; console.log(err));<br>};</pre><p>Here, product.save() saves the updates to the database</p><h4>Delete Database using Mongoose:</h4><p>In ./controllers/admin.js</p><pre>const Product = require(&quot;../models/product&quot;);<br><br>exports.postDeleteProduct = (req, res) =&gt; {<br>  const prodId = req.body.productId;<br>  Product.findByIdAndRemove(prodId)<br>    .then(() =&gt; {<br>      console.log(&quot;DESTROYED PRODUCT&quot;);<br>      res.redirect(&quot;/admin/products&quot;);<br>    })<br>    .catch((err) =&gt; console.log(err));<br>};</pre><p>findByIdAndRemove() is a method to find the document and delete it.</p><p>You can also use findByIdAndDelete() for the same task but it will execute any middleware</p><pre>const Product = require(&quot;../models/product&quot;);<br><br>exports.postDeleteProduct = (req, res) =&gt; {<br>  const prodId = req.body.productId;<br>  Product.findByIdAnddDelete(prodId)<br>    .then(() =&gt; {<br>      // Middleware and hooks are not executed<br>    })<br>  <br>};</pre><h4>Adding and Using User Model:</h4><p><strong>User</strong> Model in ./models/user.js :</p><pre>const mongoose = require(&quot;mongoose&quot;);<br><br>const Schema = mongoose.Schema;<br><br>const userSchema = new Schema({<br>  name: {<br>    type: String,<br>    required: true,<br>  },<br>  email: {<br>    type: String,<br>    required: true,<br>  },<br>  cart: {<br>    items: [<br>      {<br>        productId: {<br>          type: Schema.Types.ObjectId,  //store values that are MongoDB ObjectIds<br>          required: true,<br>        },<br>        quantity: { type: Number, required: true },<br>      },<br>    ],<br>  },<br>});<br><br>module.exports = mongoose.model(&quot;User&quot;, userSchema);</pre><p>We are going to save the<strong> User </strong>model after we connect to Mongoose in ./app.js :</p><pre>const User = require(&quot;./models/user&quot;);<br><br>app.use((req, res, next) =&gt; {<br>  User.findById(&quot;64f4582b1d1e8ce9b35451e4&quot;)<br>    .then((user) =&gt; {<br>      req.user = user;   //store user data in request<br>      next();<br>    })<br>    .catch((err) =&gt; console.log(err));<br>});<br><br>mongoose<br>  .connect(<br>    &quot;mongodb+srv://mohamim360:M51lUp9tDsG545SF@cluster0.k4fqzxy.mongodb.net/shop?retryWrites=true&amp;w=majority&quot;<br>  )<br>  .then((result) =&gt; {<br>    User.findOne() //first element that matches the condition<br>  .then(user =&gt;{<br>      if(!user){<br>        const user = new User({<br>          name: &#39;Hamim&#39;,<br>          email: &#39;Hamim@gmail.com&#39;,<br>          cart: {<br>            items: []<br>          }<br>        })<br>        user.save();<br>      }<br>    })<br>    console.log(&#39;connected&#39;);<br>    app.listen(3000);<br>  })<br>  .catch((err) =&gt; {<br>    console.log(err);<br>  });</pre><h4>Using Relations in Mongoose :</h4><p>Here, we are going to create relations between the <strong>Product </strong>and <strong>User</strong> models like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*VKgAscmHyA0aeLHJV-jWMg.png" /></figure><p><strong><em>establish relations between ‘products’ and ‘user’ database collection:</em></strong></p><p>we going to add userId in <strong>products</strong> collection:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FgXinPtZ4XTZjKBkoOPG3Q.png" /></figure><p>The reason why userId show _id only from the <strong>user</strong> collection because the model blueprint of Product and relational reference of User Model.</p><p><strong><em>Fetching Relations:</em></strong></p><p>using populate() and select():</p><pre>exports.getProducts = (req, res) =&gt; {<br><br>  Product.find()<br><br>  .select(&#39;title price -_id&#39;)<br>    .populate(&quot;userId&quot;,&#39;name&#39;)<br>    .then((products) =&gt; {<br>      console.log(products);<br>      res.render(&quot;admin/products&quot;, {<br>        prods: products,<br>        pageTitle: &quot;Admin Products&quot;,<br>        path: &quot;/admin/products&quot;,<br>      });<br>    })<br>    .catch((err) =&gt; console.log(err));<br>};</pre><p>select(‘title price -_id’) method to specify which fields you want to include and exclude from query results.</p><p>populate(“userId”,’name’) method to populate the ‘userId’ field with all data or only ‘name’ from the referenced collection.</p><p>Fetched product before use select() and populate() method:</p><pre>[<br> {<br>    _id: new ObjectId(&quot;64f471cfaae7ae4a926f9c6f&quot;),<br>    title: &#39;Book&#39;,<br>    price: 22,<br>    description: &#39;good book&#39;,<br>    imageUrl: &#39;https://static.vecteezy.com/system/resources/previews/009/399/398/original/old-vintage-book-clipart-design-illustration-free-png.png&#39;,<br>    userId: new ObjectId(&quot;64f4582b1d1e8ce9b35451e4&quot;),<br>    __v: 0<br>  }<br>]</pre><p>after using select() and populate() method:</p><pre>[<br>  {<br>    title: &#39;Book&#39;,  <br>    price: 22,<br>    userId: { <br>       _id: new ObjectId(&quot;64f4582b1d1e8ce9b35451e4&quot;),<br>       name: &#39;Hamim&#39; }<br>  },<br>  { title: &#39;Book&#39;, price: 22 }<br>]</pre><h4>Adding your own custom Methods:</h4><p>In ./models/user.js :</p><pre>userSchema.methods.addToCart = function (product) {<br>  const cartProductIndex = this.cart.items.findIndex((cp) =&gt; {<br>    return cp.productId.toString() === product._id.toString();<br>  });<br>  const updateCartItems = [...this.cart.items];<br>  let newQuantity = 1;<br>  if (cartProductIndex &gt;= 0) {<br>    newQuantity = this.cart.items[cartProductIndex].quantity + 1;<br>    updateCartItems[cartProductIndex].quantity = newQuantity;<br>  } else {<br>    updateCartItems.push({<br>      productId: product._id,<br>      quantity: newQuantity,<br>    });<br>  }<br>  const updateCart = {<br>    items: updateCartItems,<br>  };<br>  this.cart = updateCart;<br>  return this.save(); //object save itself using save() method to update the cart<br>};<br><br>module.exports = mongoose.model(&quot;User&quot;, userSchema);</pre><p>userSchema.methods.addToCart() Here, addToCart() a custom-made method (instances of the User model) for adding products to the <strong>cart</strong>. Here is our cart in the <strong>user </strong>collection:</p><pre>{<br>  &quot;_id&quot;: {<br>    &quot;$oid&quot;: &quot;64f4582b1d1e8ce9b35451e4&quot;<br>  },<br>  &quot;name&quot;: &quot;Hamim&quot;,<br>  &quot;email&quot;: &quot;Hamim@gmail.com&quot;,<br>  &quot;cart&quot;: { //cart<br>    &quot;items&quot;: [<br>      {<br>        &quot;productId&quot;: {<br>          &quot;$oid&quot;: &quot;64f471cfaae7ae4a926f9c6f&quot;<br>        },<br>        &quot;quantity&quot;: 2,<br>        &quot;_id&quot;: {<br>          &quot;$oid&quot;: &quot;64f48461fe590d3e096185fb&quot;<br>        }<br>      }<br>    ]<br>  },<br>  &quot;__v&quot;: 1<br>}</pre><h4>References:</h4><ul><li><a href="https://www.udemy.com/course/nodejs-the-complete-guide/">https://www.udemy.com/course/nodejs-the-complete-guide/</a></li><li><a href="https://mongoosejs.com/docs/">https://mongoosejs.com/docs/</a></li></ul><h4>Next Articles:</h4><p>We will update our next articles on Working with Mongoose here.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ee160d601b7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kubehub/how-to-use-mongoose-9ee160d601b7">How To Use Mongoose</a> was originally published in <a href="https://medium.com/kubehub">blog.cloudterms.net</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connect to Github using the SSH key pair]]></title>
            <link>https://medium.com/kubehub/connect-to-github-using-the-ssh-key-pair-f17b2eed5503?source=rss----11310267cd58---4</link>
            <guid isPermaLink="false">https://medium.com/p/f17b2eed5503</guid>
            <category><![CDATA[git-clone]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[ssh-keys]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Md Shamim]]></dc:creator>
            <pubDate>Thu, 02 Feb 2023 04:48:47 GMT</pubDate>
            <atom:updated>2023-02-02T04:48:47.515Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use SSH key pair to access github from your local machine</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*11EmRo1EiUEGbs1g" /><figcaption>Photo by <a href="https://unsplash.com/@rubaitulazad?utm_source=medium&amp;utm_medium=referral">Rubaitul Azad</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Step 1:</h4><p>Create an SSH key-pair using the following command:</p><pre>&gt;&gt; ssh-keygen -t rsa    #Press enter for all values</pre><p>It will generate a public and private key pair.</p><pre>&gt;&gt; ls ~/.ssh/<br><br>demo-key      # private key<br>demo-key.pub  # public key</pre><h4>Step 2:</h4><p>If you own the github repository then you should have administrative access.</p><ol><li>Go to <a href="https://github.com/settings/ssh"><strong>Settings</strong></a><strong> </strong>from your github account and then on the left side of your window you will see <strong>SSH and GPG keys </strong>option.</li><li>Copy the SSH public key<strong> (demo-key.pub)</strong> from your machine. And add that on the github SSH keys option as an “<strong>Authentication Keys</strong>”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BOKbFQhRcOnQv2BGd2XtNw.png" /></figure><h4>Step 3:</h4><p>Now run the following commands to add the private key to the SSH authentication agent <strong>(</strong><strong>ssh-agent). </strong><strong>ssh-agent</strong> will take care of the authentication for us, and we don’t have to type in passwords at the terminal every time.</p><pre><br>&gt;&gt; eval `ssh-agent -s`<br>&gt;&gt; ssh-add ~/.ssh/demo-key</pre><h4>Step 4:</h4><p>We are almost done. Clone the github repository using the SSH Link of your repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rPrMBXQcydbWnIx3DVS8VQ.png" /></figure><p>That’s all. Hopefully, you are accessing your Github repository using an SSH key pair.</p><blockquote><em>If you found this article helpful, please hit the </em><strong><em>Follow </em></strong><em>👉</em><strong><em> </em></strong><em>and </em><strong><em>Clap </em></strong><em>👏</em><strong><em> </em></strong><em>buttons to help me write more articles like this.<br>Thank You 🖤</em></blockquote><h4>👉All Articles on Linux</h4><p><a href="https://medium.com/@shamimice03/list/1339e15e3304">All Articles on Linux</a></p><h4>👉All Articles on Kubernetes</h4><p><a href="https://medium.com/@shamimice03/list/7ae1a0f96f3b">All Articles on Kubernetes</a></p><h4>👉All Articles on Helm</h4><p><a href="https://medium.com/@shamimice03/list/6e2076d48ba8">HelmーSeries</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f17b2eed5503" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kubehub/connect-to-github-using-the-ssh-key-pair-f17b2eed5503">Connect to Github using the SSH key pair</a> was originally published in <a href="https://medium.com/kubehub">blog.cloudterms.net</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 Days of Linux | Day 3]]></title>
            <link>https://medium.com/kubehub/10-days-of-linux-day-3-47f3fc2c80ee?source=rss----11310267cd58---4</link>
            <guid isPermaLink="false">https://medium.com/p/47f3fc2c80ee</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[linux-kernel]]></category>
            <category><![CDATA[linuxworld]]></category>
            <category><![CDATA[linux-commands]]></category>
            <category><![CDATA[linux-tutorial]]></category>
            <dc:creator><![CDATA[Md Shamim]]></dc:creator>
            <pubDate>Thu, 12 Jan 2023 06:32:43 GMT</pubDate>
            <atom:updated>2023-01-25T10:27:55.653Z</atom:updated>
            <content:encoded><![CDATA[<h4>A series on Linux</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aYaptEVtExCteF50" /><figcaption>Photo by <a href="https://unsplash.com/@nicknight?utm_source=medium&amp;utm_medium=referral">Nick Night</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4><strong>Previous parts:</strong></h4><p><strong>day 1: </strong><a href="https://medium.com/kubehub/10-days-of-linux-day-1-d945a6fe0a62"><strong>10 Days of Linux | Day 1</strong></a><strong><br>day 2: </strong><a href="https://medium.com/kubehub/10-days-of-linux-day-2-eeba3035c110"><strong>10 Days of Linux | Day 2</strong></a></p><h4>Linux boot sequence</h4><p><strong>BIOS </strong>— The BIOS loads and executes the Master Boot Record (MBR) boot loader.</p><p><strong>MBR </strong>— MBR stands for Master Boot Record, and is responsible for loading and executing the GRUB boot loader.</p><p><strong>GRUB </strong>— It is the typical bootloader for most modern Linux systems. It has a simple menu where we can select desired kernel image.</p><p><strong>Kernel </strong>— The kernel is often referred to as the core of any operating system. It mounts the root file system that’s specified in the grub.conf file. Then it executes the /sbin/init program, which is always the first program to be executed.</p><p>If we inspect /sbin/init program. We may see that it is pointing to the systemd folder.</p><pre>&gt;&gt; ls -lr /sbin/init<br>   lrwxrwxrwx 1 root root 20 Aug 31 15:27 /sbin/init -&gt; /lib/systemd/systemd</pre><p><strong>Systemd </strong>— At this point, the system executes run-level programs. Modern Linux systems use systemd to choose a run-level.</p><p><strong>Runlevel programs </strong>— Depending on which Linux distribution we have installed, we may be able to see different services getting started.</p><p>More from <a href="https://www.freecodecamp.org/news/the-linux-booting-process-6-steps-described-in-detail/"><strong>here</strong></a>.</p><h4>Commands to Check Hardware Information on Linux:</h4><h4>udevadm —</h4><p><strong>udevadm </strong>monitors a device from the moment it’s plugged into the system until it’s plugged out from the system.</p><pre>&gt;&gt; udevadm  monitor   #&lt;---<br><br>monitor will print the received events for:<br>UDEV - the event which udev sends out after rule processing<br>KERNEL - the kernel uevent<br>..<br>..</pre><h4>lspci</h4><p><strong>lspci </strong>is a utility for displaying information about<strong> PCI buses </strong>in the system and devices connected to them.</p><pre>&gt;&gt; lspci   #&lt;---<br><br>00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller<br>00:01.0 VGA compatible controller: Device 1234:1111 (rev 02)<br>00:02.0 PCI bridge: Red Hat, Inc. QEMU PCIe Root port<br>00:02.1 PCI bridge: Red Hat, Inc. QEMU PCIe Root port<br>00:02.2 PCI bridge: Red Hat, Inc. QEMU PCIe Root port<br>00:02.3 PCI bridge: Red Hat, Inc. QEMU PCIe Root port<br>00:02.4 PCI bridge: Red Hat, Inc. QEMU PCIe Root port<br>00:02.5 PCI bridge: Red Hat, Inc. QEMU PCIe Root port<br>00:1f.0 ISA bridge: Intel Corporation 82801IB (ICH9) LPC Interface Controller (rev 02)<br>...</pre><h4>lsblk</h4><p>List out information of all<strong> block devices</strong>, which are the hard drive partitions and other storage devices like optical drives and flash drives.</p><pre>&gt;&gt; lsblk    #&lt;---<br><br>NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT<br>loop0     7:0    0 67.8M  1 loop /snap/lxd/22753<br>loop1     7:1    0   48M  1 loop /snap/snapd/17336<br>loop2     7:2    0 63.2M  1 loop /snap/core20/1634<br>vda     252:0    0   20G  0 disk <br>|-vda1  252:1    0 19.9G  0 part /<br>|-vda14 252:14   0    4M  0 part <br>`-vda15 252:15   0  106M  0 part /boot/efi</pre><h4>lscpu</h4><p>The <strong>lscpu </strong>command reports information about the CPU and processing units.</p><pre>&gt;&gt; lscpu<br><br>Architecture:                    x86_64<br>CPU op-mode(s):                  32-bit, 64-bit<br>Byte Order:                      Little Endian<br>Address sizes:                   46 bits physical, 48 bits virtual<br>CPU(s):                          1<br>On-line CPU(s) list:             0<br>Thread(s) per core:              1<br>Core(s) per socket:              1<br>Socket(s):                       1<br>NUMA node(s):                    1<br>Vendor ID:                       GenuineIntel<br>CPU family:                      6<br>Model:                           42<br>Model name:                      Intel Xeon E312xx (Sandy Bridge, IBRS update)<br>...<br>...</pre><h4>lsmem</h4><p>The <strong>lsmem</strong> command lists the ranges of available memory with their online status.</p><pre>&gt;&gt; lsmem --summary<br><br>Memory block size:       128M<br>Total online memory:       2G<br>Total offline memory:      0B</pre><h4>free</h4><p>Check the amount of <strong>used, free and total amount of RAM</strong> of a system with the <strong>free </strong>command.</p><pre>&gt;&gt; free -m   # megabyte<br><br>              total        used        free      shared  buff/cache   available<br>Mem:           1983         948          74           2         959         854<br>Swap:             0           0           0<br><br><br>&gt;&gt; free -k   # kilobyte<br>              total        used        free      shared  buff/cache   available<br>Mem:        2030940      971992       76016        2460      982932      874396<br>Swap:             0           0           0<br><br><br>&gt;&gt; free -g   # gigabyte<br>              total        used        free      shared  buff/cache   available<br>Mem:              1           0           0           0           0           0<br>Swap:             0           0           0</pre><h4>lshw</h4><p><strong>lshw</strong> is a small tool to extract detailed information about the machine&#39;s hardware configuration.</p><pre>&gt;&gt; lshw<br><br>hostname           <br>    description: Computer<br>    product: None (8.5.0)<br>    vendor: KubeVirt<br>    version: RHEL-8.5.0 PC (Q35 + ICH9, 2009)<br>    width: 64 bits<br>    capabilities: smbios-2.8 dmi-2.8 vsyscall32<br>    configuration: boot=normal family=KubeVirt sku=8.5.0 uuid=FE2612B8-671B-694A-B52D-AC0D91270C83<br>  *-core<br>       description: Motherboard<br>       product: RHEL-AV<br>       vendor: Red Hat<br>       physical id: 0<br>       version: RHEL-8.5.0 PC (Q35 + ICH9, 2009)<br>     *-firmware<br>          description: BIOS<br>          vendor: SeaBIOS<br>          physical id: 0<br>          version: 1.14.0-1.el8s<br>          date: 04/01/2014<br>          size: 96KiB<br>...<br>...</pre><h4>References</h4><p><a href="https://man7.org/linux/man-pages/man8/lspci.8.html">lspci(8) - Linux manual page</a></p><p><a href="https://www.binarytides.com/linux-commands-hardware-info/">https://www.binarytides.com/linux-commands-hardware-info/</a><br><a href="https://www.freecodecamp.org/news/the-linux-booting-process-6-steps-described-in-detail/">https://www.freecodecamp.org/news/the-linux-booting-process-6-steps-described-in-detail/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47f3fc2c80ee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kubehub/10-days-of-linux-day-3-47f3fc2c80ee">10 Days of Linux | Day 3</a> was originally published in <a href="https://medium.com/kubehub">blog.cloudterms.net</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 Days of Linux | Day 2]]></title>
            <link>https://medium.com/kubehub/10-days-of-linux-day-2-eeba3035c110?source=rss----11310267cd58---4</link>
            <guid isPermaLink="false">https://medium.com/p/eeba3035c110</guid>
            <category><![CDATA[systemd]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[linux-kernel]]></category>
            <category><![CDATA[linux-tutorial]]></category>
            <category><![CDATA[linuxworld]]></category>
            <dc:creator><![CDATA[Md Shamim]]></dc:creator>
            <pubDate>Fri, 16 Dec 2022 08:20:58 GMT</pubDate>
            <atom:updated>2022-12-16T08:20:58.514Z</atom:updated>
            <content:encoded><![CDATA[<h4>A series on Linux</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SoRvlTzozcRF9cua" /><figcaption>Photo by <a href="https://unsplash.com/@manucosen?utm_source=medium&amp;utm_medium=referral">Manuel Cosentino</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Previous day: </strong><a href="https://medium.com/kubehub/10-days-of-linux-day-1-d945a6fe0a62"><strong>10 Days of Linux | Day 1</strong></a></p><h4>Overview of <strong>Linux boot and startup process:</strong></h4><blockquote><em>1. The system powers up. The BIOS does minimal hardware initialization and hands over control to the boot loader.<br>2. The boot loader calls the kernel.<br>3. The kernel loads an initial RAM disk that loads the system drives and then looks for the root file system.<br>4. Once the kernel is set up, it starts the </em><strong><em>systemd </em></strong><em>initialization system.<br></em><strong><em>5. systemd </em></strong><em>takes over and continues to mount the host’s file systems and start services.</em></blockquote><h4>systemd</h4><p><strong>systemd </strong>is a system and service manager for Linux operating systems. When run as the first process on boot (as PID 1), it acts as an <strong>init system</strong> that brings up and maintains userspace services. Separate instances are started for logged-in users to start their services.</p><h4>systemd units</h4><p><strong>systemd</strong> introduces the concept of<strong> systemd units</strong> and there are several types, such as a <strong>service unit, mount unit, socket unit, slice unit and etc.</strong> Units are defined in unit configuration files, which include information about the unit type and its behavior.</p><p>The <strong>/etc/systemd/system/</strong> directory stores unit files based on different target levels that extend a service. This directory will take precedence over unit files located anywhere else in the system.</p><p>Now, if we install the <strong>apache </strong>server on our system. It will store systemd unit files under the<strong> /etc/systemd/system/&lt;TARGET-LEVEL&gt;.</strong></p><pre># Install apache server<br><br>&gt;&gt; sudo apt update<br>&gt;&gt; sudo apt install apache2<br><br># systemd unit file of apache server<br><br>&gt;&gt; cat /etc/systemd/system/multi-user.target.wants/apache2.service <br><br>-------------------------------------------------------<br><br>[Unit]<br>Description=The Apache HTTP Server<br>After=network.target remote-fs.target nss-lookup.target<br>Documentation=https://httpd.apache.org/docs/2.4/<br><br>[Service]<br>Type=forking<br>Environment=APACHE_STARTED_BY_SYSTEMD=true<br>ExecStart=/usr/sbin/apachectl start<br>ExecStop=/usr/sbin/apachectl stop<br>ExecReload=/usr/sbin/apachectl graceful<br>PrivateTmp=true<br>Restart=on-abort<br><br>[Install]<br>WantedBy=multi-user.target<br><br>-------------------------------------------------------</pre><p>We can also view and edit the apache server’s unit file using the following commands:</p><pre># To view the content&#39;s of unit file<br>&gt;&gt; systemctl show apache2.service --full<br><br># To edit the unit file<br>&gt;&gt; systemctl edit apache2.service --full</pre><h4>Creating Custom Unit File</h4><p>We may need to create a unit file for a custom daemon or another existing service instance. The creation of a unit file is executed via the root user in the<strong> /etc/systemd/system/</strong> directory.</p><pre># Create unit file and change permission <br><br>&gt;&gt; touch /etc/systemd/system/demoservice.service<br>&gt;&gt; chmod 644 /etc/systemd/system/demoservice.service</pre><p>Next, we will open the newly created unit file in a text editor (like vim or nano) and add the service configuration options. Below, we can see a basic example of the unit file.</p><pre># demoservice.service<br><br>[Unit]<br>Description=This is the manually created service<br>After=network.target    <br><br>[Service]<br>ExecStart=/path/to/executable<br><br>[Install]<br>WantedBy=multi-user.target</pre><p>After configuring a unit file we have to use the <strong>systemctl </strong>tool for reloading daemons and starting the service by leveraging the unit file:</p><pre># reload daemons<br>&gt;&gt; systetmctl daemon-reload<br><br># start a service<br>&gt;&gt; systemctl start demoservice.service<br><br># inspect the status of a service<br>&gt;&gt; systemctl status demoservice.service</pre><h4>Walkthrough</h4><p>Now, let’s create two unit files for two different services. And we will write unit files in a way that one service will be dependent on another:</p><p>Create two scripts and store them under the <strong>‘/usr/local/bin’ </strong>directory. These will be used by the service unit file that we are planning to configure.</p><pre><br>&gt;&gt; cd /usr/local/bin<br>&gt;&gt; vim first.sh<br><br>#!/bin/bash<br><br>while true<br>do <br>  echo &quot;Hello from first service&quot;<br>  sleep 1d<br>done<br><br><br># ------------------------------------------------------ #<br><br>&gt;&gt; vim second.sh<br><br>#!/bin/bash<br><br>while true<br>do<br>  echo &quot;Hello From Second Service&quot;<br>  sleep 1h<br>done<br><br># ------------------------------------------------------ #<br><br>&gt;&gt; chmod +x first.sh<br>&gt;&gt; chmod +x second.sh</pre><p>Then create two unit files and specify the script path :</p><pre># first.service<br><br>[Unit]<br>Description=first service <br><br>[Service]<br>ExecStart=/usr/local/bin/first.sh   # Script <br><br>[Install]<br>WantedBy=multi-user.target</pre><pre># second service<br><br>[Unit]<br>Description=second service <br>Documentation=http://doc.com<br>After=first.service            # Dependent on &quot;first.service&quot;<br><br>[Service]<br>ExecStart=/usr/local/bin/second.sh  # Script<br>Restart=on-failure             # Restart on failure<br>RestartSec=10          <br><br>[Install]<br>WantedBy=multi-user.target</pre><p>And then start the services and check the status:</p><pre>&gt;&gt; systemctl daemon-reload<br><br>&gt;&gt; systemctl start first.service<br>&gt;&gt; systemctl status first.service<br><br>&gt;&gt; systemctl start second.service<br>&gt;&gt; systemctl status second.service</pre><h4>systemd Tools</h4><p>● <strong>systemctl </strong>is a utility that is responsible for examining and controlling the systemd system and the service manager.</p><pre># Service management with systemd <br># Following commands used on &quot;docker&quot; service<br><br>&gt;&gt; systemctl start docker<br><br>&gt;&gt; systemctl stop docker<br><br>&gt;&gt; systemctl restart docker<br><br>&gt;&gt; systemctl reload docker<br><br>&gt;&gt; systemctl enable docker<br><br>&gt;&gt; systemctl disable docker<br><br>&gt;&gt; systemctl status docker<br><br>&gt;&gt; systemctl daemon-reload  # Reloads the system manager configuration<br><br>&gt;&gt; systemctl show demoservice.service  # To show unit configuration<br><br>&gt;&gt; systemctl edit demoservice.service --full  # To edit a unit configuration<br><br>&gt;&gt;  systemctl get-default     # Get current target level<br> <br>&gt;&gt; systemctl set-default multi-user.target # Change default target level<br><br>&gt;&gt; systemctl list-unit --all     # list all units<br><br>&gt;&gt; systemctl list-units --type=service  # list only &quot;service&quot; type unit<br><br>  UNIT                                           LOAD   ACTIVE SUB     DESCRIPTION                                                              &gt;<br>  accounts-daemon.service                        loaded active running Accounts Service                                                         &gt;<br>  apparmor.service                               loaded active exited  Load AppArmor profiles                                                   &gt;<br>  apport.service                                 loaded active exited  LSB: automatic crash report generation                                   &gt;<br>  atd.service                                    loaded active running Deferred execution scheduler                                             &gt;<br>  blk-availability.service                       loaded active exited  Availability of block devices                                            &gt;<br>  console-setup.service                          loaded active exited  Set console font and keymap                                              &gt;<br>  containerd.service                             loaded active running containerd container runtime                                             &gt;<br>  cron.service                                   loaded active running Regular background program processing daemon                             &gt;<br>  dbus.service                                   loaded active running D-Bus System Message Bus                                                 &gt;<br>  docker.service                                 loaded active running Docker Application Container Engine<br>  ....<br></pre><p>●<strong>journalctl</strong>is a utility for querying and displaying logs from the journals and systemd’s logging service.</p><pre>&gt;&gt; journalctl 　　# all logs <br><br>&gt;&gt; journalctl -b  # logs from current boot<br><br>&gt;&gt; journalctl -u nginx.service  # logs of nginx service<br><br>&gt;&gt; journalctl -fu ngnix.service # continuous logs of nginx service<br><br>-- Logs begin at Sun 2022-11-13 17:25:58 UTC. --<br>Dec 09 04:47:28 controlplane systemd[1]: Starting A high performance web server and a reverse proxy server...<br>Dec 09 04:47:28 controlplane systemd[1]: Started A high performance web server and a reverse proxy server.<br>...<br>...</pre><h4>References</h4><p><a href="https://www.liquidweb.com/kb/what-is-systemctl-an-in-depth-overview/">https://www.liquidweb.com/kb/what-is-systemctl-an-in-depth-overview/</a><br><a href="https://www.linode.com/docs/guides/what-is-systemd/">https://www.linode.com/docs/guides/what-is-systemd/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eeba3035c110" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kubehub/10-days-of-linux-day-2-eeba3035c110">10 Days of Linux | Day 2</a> was originally published in <a href="https://medium.com/kubehub">blog.cloudterms.net</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 Days of Linux | Day 1]]></title>
            <link>https://medium.com/kubehub/10-days-of-linux-day-1-d945a6fe0a62?source=rss----11310267cd58---4</link>
            <guid isPermaLink="false">https://medium.com/p/d945a6fe0a62</guid>
            <category><![CDATA[linux-tutorial]]></category>
            <category><![CDATA[linux-kernel]]></category>
            <category><![CDATA[linux-architecture]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[linux-file-system]]></category>
            <dc:creator><![CDATA[Md Shamim]]></dc:creator>
            <pubDate>Mon, 21 Nov 2022 04:29:11 GMT</pubDate>
            <atom:updated>2022-12-02T07:07:42.362Z</atom:updated>
            <content:encoded><![CDATA[<h4>A series on Linux</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sw-7X7uxKJWvRJLu" /><figcaption>Photo by <a href="https://unsplash.com/@parachutel_?utm_source=medium&amp;utm_medium=referral">Sheng L</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Linux Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*aZGO5tREdoGIG0po.jpg" /><figcaption>From: <a href="https://www.tutorialspoint.com/operating_system/os_linux.htm">https://www.tutorialspoint.com/operating_system/os_linux.htm</a></figcaption></figure><blockquote><strong><em>Hardware layer</em></strong><em> − Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc).<br></em><strong><em>Kernel</em></strong><em> − It is the core component of the Operating System, interacts directly with hardware, and provides low-level services to upper-layer components.<br></em><strong><em>Shell</em></strong><em> − An interface to the kernel, hiding the complexity of the kernel’s functions from users. The shell takes commands from the user and executes the kernel’s functions.<br></em><strong><em>Utilities</em></strong><em> − Utility programs that provide the user with most of the functionalities of an operating system.</em></blockquote><h4>User Space and Kernel Space</h4><p>Linux divides its memory into two distinct spaces:</p><blockquote><strong><em>User Space</em></strong><em> is the virtual memory space where all user applications or software will run.<br></em><strong><em>Kernal Space</em></strong><em> is the virtual memory space, where the core of the operating system (kernel) runs.</em></blockquote><p>Since the containers run in the user space. <strong>How do the containers communicate with Kernal space to mount volumes or read files from file systems?</strong></p><p>The answer is by using <strong>system calls.</strong></p><p>When applications/processes running on Linux want to use the resources managed by the Linux kernel such as — reading files, creating processes, etc. The application process makes system calls to the Linux kernel, Sequentially the Linux kernel performs the necessary operations, and then leaves control back to the calling program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*Q0n3uvlMbnUeli8FBPVe_w.png" /></figure><h4>Linux File Structure</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*wuK6MkdWHYHnk3-q.png" /><figcaption>From: <a href="https://linuxhandbook.com/linux-directory-structure/">https://linuxhandbook.com/linux-directory-structure/</a></figcaption></figure><h4>/ — The Root Directory</h4><p>Everything on your Linux system is located under the / directory, known as the root directory.</p><h4>/bin — Essential User Binaries</h4><p><strong>‘bin/’</strong> contains executable files that are part of the core operating system. Such as — cat, ls, mkdir, cd, etc.</p><h4>/dev — Device Files</h4><p>This directory only contains special files, including those relating to the devices. These are virtual files, not physically on the disk.</p><p>For a better understanding of the filesystem structure let’s install ‘<strong>apache</strong>’ web server on our system. Which will help us to understand which file resides where.</p><pre>&gt;&gt; sudo apt update<br>&gt;&gt; sudo apt install apache2</pre><h4>/var — Variable Data Files</h4><p>Stores runtime information like system logging, user tracking, caches, and other files that system programs create and manage.</p><p>The apache server we installed earlier will store logs under the <strong>‘/var/log/apache2’ </strong>directory. And under the <strong>‘/var/www/html’</strong> directory the initial document that will be served by the apache server is stored.</p><pre>#------------------------------------------------------------------<br># inside the &quot;/var&quot; directory<br><br>&gt;&gt; cd /var<br>&gt;&gt; ls -la <br><br>backups  cache  crash  lib  local  lock  log  mail  opt  run  snap  <br>spool  tmp  www<br><br>#------------------------------------------------------------------<br># apache server logs<br><br>&gt;&gt; cd /var/log/apache2/<br>&gt;&gt; ls<br><br>access.log  error.log  other_vhosts_access.log<br><br>#------------------------------------------------------------------<br># apache server&#39;s &quot;index.html&quot; file location<br><br>&gt;&gt; cd /var/www/html<br>&gt;&gt; ls<br><br>index.html</pre><h4>/etc — Configuration Files</h4><p>The<strong> /etc</strong> directory contains configuration files.</p><pre>#------------------------------------------------------------------<br># apache server config file<br><br>&gt;&gt; cd /etc/apache2/<br>&gt;&gt; ls <br><br>apache2.conf  conf-available  conf-enabled  envvars  magic  <br>mods-available  mods-enabled  ports.conf  sites-available  sites-enabled<br><br>#------------------------------------------------------------------<br># centos/redhat network config files<br><br>&gt;&gt; /etc/sysconfig/network-scripts/<br>&gt;&gt; ls<br><br>ifcfg-enp0s3 ifcfg-enp01</pre><h4>/run — Application State Files</h4><p>The /run directory gives applications a standard place to store transient files they require like sockets and process IDs. These files can’t be stored in /tmp because files in /tmp may be deleted.</p><pre>#------------------------------------------------------------------<br># Process Id of apache2 server stored under /run/apache2 directory<br><br>&gt;&gt; cd /run/apache2<br>&gt;&gt; ls<br>apache2.pid<br><br>&gt;&gt; cat apache2.pid <br>53114    # note the Process Id, we will use it later</pre><h4>/proc — Kernel &amp; Process Files</h4><p>The<strong> /proc </strong>directory is similar to the<strong> /dev</strong> directory because it doesn’t contain standard files. It contains special files that represent the system and process information.</p><pre>#------------------------------------------------------------------<br># Inside the &quot;proc&quot; directory<br><br>&gt;&gt; cd proc<br>&gt;&gt; ls<br><br> 1  17   207    23840  26046  31903  33892  476    544   621    8  <br> 95         dma          kpagecgroup   sched_debug    version<br> ....<br><br>&gt;&gt; cd /proc/53114   # apache server process id<br>&gt;&gt; ls<br><br>cgroup  ns .. ..    # info of a running process<br></pre><blockquote><em>We can check the Memory usage and CPU usage of the Linux system by looking at the content of ‘</em><strong><em>/proc/meminfo’ </em></strong><em>and ‘</em><strong><em>/proc/cpuinfo’ </em></strong><em>file.</em></blockquote><p>More about<strong> </strong><a href="https://www.linux.com/news/discover-possibilities-proc-directory/"><strong>/proc</strong></a></p><h4>/sbin — System binaries</h4><p>This is similar to the /bin directory. The only difference is that it contains binaries that can only be run by a root or a sudo user.</p><h4>/bin — Essential User Binaries</h4><p>The<strong> /bin</strong> directory contains the essential user binaries (programs) that must be present when the system is mounted in single-user mode. Applications such as Firefox are stored in<strong> /usr/bin</strong>, while important system programs and utilities such as the bash shell are located in <strong>/bin</strong>.</p><blockquote><strong><em>‘/usr/bin’ </em></strong><em>contains basic user commands<br></em><strong><em>‘/usr/sbin’ </em></strong><em>contains additional commands for the administrator<br></em><strong><em>‘/usr/lib’ </em></strong><em>contains the system libraries<br></em><strong><em>‘/usr/share’</em></strong><em> contains documentation or common to all libraries, for example <br></em><strong><em>‘/usr/share/man’</em></strong><em> contains the text of the manpage</em></blockquote><h4><strong>/tmp</strong> — temporary space</h4><p>Typically cleared on reboot.</p><h4>/boot — Static Boot Files</h4><p>The <strong>/boot </strong>directory contains the files needed to boot the system — for example, the <strong>GRUB </strong>boot loader’s files and the Linux kernels are stored here.</p><h4>/root — The home directory of the root</h4><p>There is <strong>/root </strong>directory as well and it works as the root user&#39;s home directory.</p><h4>/home — Home Folders</h4><p>The /home directory contains a home folder for each user. For example, if there is a user named ‘<strong>david</strong>’, then we will have a home folder located at <strong>‘/home/david’</strong>.</p><h4>Recap</h4><blockquote><strong><em>Home directories: </em></strong><em>/root, /home/username<br></em><strong><em>User Executables:</em></strong><em> /bin, /usr/bin, /usr/local/bin<br></em><strong><em>System Executables:</em></strong><em> /sbin, /usr/sbin, /usr/local/sbin<br></em><strong><em>Other mountpoints: </em></strong><em>/media, /mnt<br></em><strong><em>Configuration:</em></strong><em> /etc<br></em><strong><em>Temporary Files:</em></strong><em> /tmp<br></em><strong><em>Kernels and Bootloader:</em></strong><em> /boot<br></em><strong><em>Server Data:</em></strong><em> /var, /srv<br></em><strong><em>System Information:</em></strong><em> /proc, /sys<br></em><strong><em>Shared Libraries:</em></strong><em> /lib, /usr/lib, /usr/local/lib</em></blockquote><h4><strong>References</strong></h4><p>● <a href="https://www.tutorialspoint.com/operating_system/os_linux.htm">https://www.tutorialspoint.com/operating_system/os_linux.htm</a><br>● <a href="https://linuxhandbook.com/linux-directory-structure/">https://linuxhandbook.com/linux-directory-structure/</a><br>● <a href="https://www.howtogeek.com/117435/htg-explains-the-linux-directory-structure-explained/">https://www.howtogeek.com/117435/htg-explains-the-linux-directory-structure-explained/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d945a6fe0a62" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kubehub/10-days-of-linux-day-1-d945a6fe0a62">10 Days of Linux | Day 1</a> was originally published in <a href="https://medium.com/kubehub">blog.cloudterms.net</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Series on Bash Scripting]]></title>
            <link>https://medium.com/kubehub/a-series-on-bash-scripting-eecd0293fab5?source=rss----11310267cd58---4</link>
            <guid isPermaLink="false">https://medium.com/p/eecd0293fab5</guid>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[bash-script]]></category>
            <category><![CDATA[shell-script]]></category>
            <category><![CDATA[shellscripting]]></category>
            <category><![CDATA[shell]]></category>
            <dc:creator><![CDATA[Md Shamim]]></dc:creator>
            <pubDate>Fri, 04 Nov 2022 00:36:24 GMT</pubDate>
            <atom:updated>2022-11-04T00:36:23.948Z</atom:updated>
            <content:encoded><![CDATA[<h4>Start Your Scripting Journey Today</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yu0SN5YZf5ikNDz7" /><figcaption>Photo by <a href="https://unsplash.com/@florianklauer?utm_source=medium&amp;utm_medium=referral">Florian Klauer</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>What is Bash?</h4><p>Bash is a type of shell that allows running commands on Linux.</p><h4>What is Bash Script?</h4><p>A Bash script is a plain text file that contains a series of commands.</p><h4>Use Cases of Bash Scripting</h4><p>Bash scripts can be used for various purposes, such as executing a shell command, running multiple commands together, customizing administrative tasks, performing task automation, etc.</p><h4>How to learn?</h4><p>You can start your bash scripting journey today. Following are the lists of articles :</p><p><strong>●</strong><a href="https://levelup.gitconnected.com/start-your-scripting-journey-today-bash-script-part-1-46cbddf4e4e7"><strong> Start Your Scripting Journey Today | Bash Script — Part 1</strong></a></p><p><strong>● </strong><a href="https://medium.com/geekculture/start-your-scripting-journey-today-bash-script-part-2-4d93ecb59249"><strong>Start Your Scripting Journey Today | Bash Script — Part 2</strong></a></p><p><strong>● </strong><a href="https://medium.com/geekculture/start-your-scripting-journey-today-bash-script-part-3-9779ac0abea2"><strong>Start Your Scripting Journey Today | Bash Script — Part 3</strong></a></p><blockquote><em>If you found this article helpful, please </em><strong><em>don’t forget</em></strong><em> to hit the </em><strong><em>Follow</em></strong><em> and </em><strong><em>Clap </em></strong><em>buttons to help me write more articles like this.<br></em><strong><em>Thank You 🖤</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eecd0293fab5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kubehub/a-series-on-bash-scripting-eecd0293fab5">A Series on Bash Scripting</a> was originally published in <a href="https://medium.com/kubehub">blog.cloudterms.net</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes | Deep Dive Series]]></title>
            <link>https://medium.com/kubehub/kubernetes-deep-dive-series-1ee22f8da8ef?source=rss----11310267cd58---4</link>
            <guid isPermaLink="false">https://medium.com/p/1ee22f8da8ef</guid>
            <category><![CDATA[kubernetes-storage]]></category>
            <category><![CDATA[persistent-volume]]></category>
            <category><![CDATA[kubernetes-security]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-service]]></category>
            <dc:creator><![CDATA[Md Shamim]]></dc:creator>
            <pubDate>Mon, 26 Sep 2022 12:45:07 GMT</pubDate>
            <atom:updated>2022-10-19T04:03:05.634Z</atom:updated>
            <content:encoded><![CDATA[<h4>Articles on Kubernetes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wxhu08OvG2hMqauq3QaQlg.png" /></figure><p>This series covers <strong>Kubernetes </strong>topics in <strong>depth</strong>. It is done in a practical way where you get your “hands dirty” by trying things out.</p><h4>● ConfigMaps | Kubernetes</h4><p><a href="https://faun.pub/configmap-kubernetes-7c2725137530">ConfigMaps | Kubernetes</a></p><h4>● Secrets | Kubernetes</h4><p><a href="https://faun.pub/secrets-kubernetes-298ea8dd9911">Secrets | Kubernetes</a></p><h4><strong>● Assigning Pods to Nodes | Kubernetes</strong></h4><p><a href="https://medium.com/geekculture/assigning-pods-to-nodes-kubernetes-aa6d22af6165">Assigning Pods to Nodes | Kubernetes</a></p><h4>● Storage | Kubernetes</h4><p><a href="https://medium.com/geekculture/storage-kubernetes-92eb3d027282">Storage | Kubernetes</a></p><h4>● Give Users and Groups Access to Kubernetes Cluster Using RBAC</h4><p><a href="https://faun.pub/give-users-and-groups-access-to-kubernetes-cluster-using-rbac-b614b6c0b383">Give Users and Groups Access to Kubernetes Cluster Using RBAC</a></p><h4>● Service Account | Kubernetes</h4><p><a href="https://faun.pub/service-account-kubernetes-ec0f112c5bc5">Service Account | Kubernetes</a></p><h4>● <strong>Network Policy | Kubernetes</strong></h4><p><a href="https://faun.pub/a-deep-dive-into-kubernetes-network-policy-2c9cda156436">Network Policy | Kubernetes</a></p><h4>● <strong>Network Policy to Secure Workloads on Kubernetes Cluster</strong></h4><p><a href="https://medium.com/geekculture/network-policy-to-secure-workloads-on-kubernetes-cluster-99017698c748">Network Policy to Secure Workloads on Kubernetes Cluster</a></p><h3>Upcoming …</h3><h4>● Services | Kubernetes</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ee22f8da8ef" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kubehub/kubernetes-deep-dive-series-1ee22f8da8ef">Kubernetes | Deep Dive Series</a> was originally published in <a href="https://medium.com/kubehub">blog.cloudterms.net</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>