<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by NAVEEN M on Medium]]></title>
        <description><![CDATA[Stories by NAVEEN M on Medium]]></description>
        <link>https://medium.com/@maprna0?source=rss-97332a1c4e25------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*74BazB1ZjH738Dtv31kCZg.jpeg</url>
            <title>Stories by NAVEEN M on Medium</title>
            <link>https://medium.com/@maprna0?source=rss-97332a1c4e25------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 18:35:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@maprna0/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Mount Google Cloud Storage in GKE Pods]]></title>
            <link>https://maprna0.medium.com/how-to-mount-google-cloud-storage-in-gke-pods-6828bfa5668d?source=rss-97332a1c4e25------2</link>
            <guid isPermaLink="false">https://medium.com/p/6828bfa5668d</guid>
            <category><![CDATA[gke-workload-identity]]></category>
            <category><![CDATA[gcs-fuse-csi-driver]]></category>
            <category><![CDATA[mount-gcs-bucket-in-pod]]></category>
            <dc:creator><![CDATA[NAVEEN M]]></dc:creator>
            <pubDate>Thu, 11 Sep 2025 10:44:17 GMT</pubDate>
            <atom:updated>2025-09-11T10:44:17.793Z</atom:updated>
            <content:encoded><![CDATA[<p>Mounting a GCS bucket into a Kubernetes pod isn’t just a fancy trick — it solves <strong>real problems</strong>. Here are some common use cases:</p><h3>🖼️ 1. Storing and Serving Images</h3><p>Web apps often need to store and serve user-uploaded images (like profile pictures or product photos). Instead of filling up pod storage, you can save them in a GCS bucket and let the pod read/write directly.</p><h3>🎬 2. Hosting Videos and Audio Files</h3><p>Think of an e-learning platform 🎓 or a music streaming app 🎶. Media files can be huge, and pods don’t have enough local storage. GCS buckets act as the <strong>central media library</strong> that all pods can access.</p><h3>🤖 3. Machine Learning Models and Datasets</h3><p>ML workloads often need big datasets or pre-trained models. By mounting a GCS bucket, your training pod can <strong>load models or data directly</strong> without downloading them every time.</p><h3>📜 4. Configuration and Reference Files</h3><p>Sometimes you keep large config files, templates, or even static website assets in GCS. Mounting them means your pod can use these files as if they’re local.</p><h3>📦 5. Backups and Logs</h3><p>Instead of writing logs to local disk (which disappears if the pod restarts), you can push logs and backups into a GCS bucket. That way, they’re persistent and accessible from anywhere.</p><h3>✨ Benefits of Using the Cloud Storage FUSE CSI Driver</h3><p>Instead of writing them in a long technical format like docs, keep them short and beginner-friendly:</p><ul><li><strong>Easy Mounting</strong> → Just write some YAML, and your pod sees GCS like a normal folder.</li><li><strong>No Service Account Keys</strong> → Uses Workload Identity, so no risky JSON key files.</li><li><strong>Secure &amp; Scalable</strong> → Access control is done by IAM, and works across all your pods.</li><li><strong>Saves Time</strong> → No need to rewrite apps to use GCS APIs.</li><li><strong>Production Ready</strong> → Officially supported by GKE, with updates and reliability.</li></ul><p>👉 Think of it as <strong>Google Drive for your pods</strong> — plug it in and use it!</p><h3><strong>⚡ How to Set Up the Cloud Storage FUSE CSI Driver</strong></h3><h3>Step 1: Enable the Cloud Storage FUSE CSI Driver</h3><h3>💻 From the CLI</h3><p>Run this command to enable it:</p><pre>gcloud container clusters update &lt;CLUSTER_NAME&gt; \<br>  --update-addons=GcsFuseCsiDriver=ENABLED \<br>  --region &lt;REGION&gt;</pre><p>Replace:</p><ul><li>&lt;CLUSTER_NAME&gt; → your cluster name</li><li>&lt;REGION&gt; → the region where your cluster is running</li></ul><h3>Step 2: Enable Workload Identity and Create Service Accounts</h3><ol><li><strong>Create a Kubernetes Service Account (KSA)</strong> in your namespace:</li></ol><pre>kubectl create serviceaccount gke-workload-identity -n my-namespace</pre><p>2. <strong>Create a Google Service Account (GSA)</strong> in your project:</p><pre>gcloud iam service-accounts create gke-workload-identity \<br>    --project &lt;PROJECT_ID&gt;</pre><p>3. <strong>Grant the GSA access to the bucket</strong>:</p><pre>gcloud storage buckets add-iam-policy-binding gs://&lt;BUCKET_NAME&gt; \<br>    --member &quot;serviceAccount:gke-workload-identity@&lt;PROJECT_ID&gt;.iam.gserviceaccount.com&quot; \<br>    --role &quot;roles/storage.objectUser&quot;</pre><p>4. <strong>Bind KSA to GSA using Workload Identity</strong>:</p><pre>gcloud iam service-accounts add-iam-policy-binding \<br>    gke-workload-identity@&lt;PROJECT_ID&gt;.iam.gserviceaccount.com \<br>    --role roles/iam.workloadIdentityUser \<br>    --member &quot;serviceAccount:&lt;PROJECT_ID&gt;.svc.id.goog[my-namespace/gke-workload-identity]&quot;</pre><p>5. <strong>Annotate KSA to reference GSA</strong>:</p><pre>kubectl annotate serviceaccount -n my-namespace \<br>    gke-workload-identity \<br>    iam.gke.io/gcp-service-account=gke-workload-identity@&lt;PROJECT_ID&gt;.iam.gserviceaccount.com</pre><h3>Step 3: Create PersistentVolume and PersistentVolumeClaim</h3><p>These resources allow your pod to mount the GCS bucket using <strong>GCS FUSE CSI</strong>.</p><pre>apiVersion: v1<br>kind: PersistentVolume<br>metadata:<br>  name: gcs-fuse-pv<br>spec:<br>  capacity:<br>    storage: 30Gi<br>  accessModes:<br>    - ReadWriteMany<br>  csi:<br>    driver: gcsfuse.csi.storage.gke.io<br>    volumeHandle: &lt;BUCKET_NAME&gt;   # your GCS bucket<br>    readOnly: false<br>  mountOptions:<br>    - implicit-dirs<br>    - uid=1001<br>    - gid=3003<br>  storageClassName: &quot;&quot;  # empty for static binding<br>---<br>apiVersion: v1<br>kind: PersistentVolumeClaim<br>metadata:<br>  name: gcs-fuse-pvc<br>  namespace: my-namespace<br>spec:<br>  accessModes:<br>    - ReadWriteMany<br>  resources:<br>    requests:<br>      storage: 30Gi<br>  volumeName: gcs-fuse-pv<br>  storageClassName: &quot;&quot;  # must match PV</pre><h3>Step 4: Create Deployment to Mount GCS Bucket</h3><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: gcs-fuse-app<br>  namespace: my-namespace<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: gcs-fuse-app<br>  template:<br>    metadata:<br>      labels:<br>        app: gcs-fuse-app<br>      annotations:<br>        gke-gcsfuse/volumes: &quot;true&quot;   # required for GCS FUSE<br>    spec:<br>      serviceAccountName: gke-workload-identity  # KSA mapped to GSA<br>      containers:<br>      - name: app<br>        image: ubuntu:22.04<br>        command: [&quot;/bin/bash&quot;, &quot;-c&quot;, &quot;--&quot;]<br>        args: [&quot;while true; do sleep 30; done;&quot;]<br>        volumeMounts:<br>        - name: gcs-fuse-volume<br>          mountPath: /mnt/gcs<br>      volumes:<br>      - name: gcs-fuse-volume<br>        persistentVolumeClaim:<br>          claimName: gcs-fuse-pvc</pre><h3>Step 5: Deploy and Test</h3><ol><li>Apply the PV, PVC, and Deployment:</li></ol><pre>kubectl apply -f pv-pvc.yaml<br>kubectl apply -f deployment.yaml</pre><p>2. Check the PVC is <strong>Bound</strong>:</p><pre>kubectl get pvc -n my-namespace</pre><p>3. Get pod name:</p><pre>kubectl get pods -n my-namespace</pre><p>4. Exec into the pod:</p><pre>kubectl exec -it &lt;pod-name&gt; -n my-namespace -- /bin/bash</pre><p>5. Test file creation in the GCS-mounted directory:</p><pre>cd /mnt/gcs<br>echo &quot;Hello GCS FUSE&quot; &gt; test.txt</pre><p>6. Verify the file in GCS:</p><pre>gsutil ls gs://&lt;BUCKET_NAME&gt;</pre><p>Any files you create under /mnt/gcs in the pod will be <strong>reflected in your GCS bucket</strong>, and vice versa.</p><p>If you found this post helpful, please give it a clap! Your support inspires me to share more valuable insights. If you have any topics in mind or questions you’d like me to address, feel free to reach out. Connect with me on LinkedIn through the bio. Thank you for reading!</p><p>Happy Learning and Growing! 🙂📚</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6828bfa5668d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[️ Run Commands on Multiple GCP Compute Engine VMs Using a Single Bash Script]]></title>
            <link>https://maprna0.medium.com/%EF%B8%8F-run-commands-on-multiple-gcp-compute-engine-vms-using-a-single-bash-script-176ef2918014?source=rss-97332a1c4e25------2</link>
            <guid isPermaLink="false">https://medium.com/p/176ef2918014</guid>
            <category><![CDATA[bash-script]]></category>
            <category><![CDATA[cloud-automation]]></category>
            <category><![CDATA[system-administration]]></category>
            <category><![CDATA[google-compute-engine]]></category>
            <dc:creator><![CDATA[NAVEEN M]]></dc:creator>
            <pubDate>Wed, 23 Apr 2025 11:35:04 GMT</pubDate>
            <atom:updated>2025-04-23T11:35:04.924Z</atom:updated>
            <content:encoded><![CDATA[<p>Managing multiple VM instances on Google Cloud Platform (GCP) can get tedious when you need to install or configure the same packages repeatedly. Here’s a simple and effective Bash script that uses gcloud compute ssh to run commands across <strong>multiple GCP Compute Engine instances</strong>.</p><h3>✅ Use Case</h3><p>This script helps you:</p><ul><li>Connect to multiple GCP VMs</li><li>Run common setup tasks like installing packages or setting configurations</li><li>Save time and avoid repetitive manual SSH sessions</li></ul><h3>🧩 Script: multi-vm-setup.sh</h3><pre>#!/bin/bash<br><br># List of GCP Compute Engine VM instance names<br>VM_INSTANCES=(<br>  &quot;vm-1&quot;<br>  &quot;vm-2&quot;<br>  # Add more instances as needed<br>)<br><br># Loop through each VM and execute commands<br>for INSTANCE in &quot;${VM_INSTANCES[@]}&quot;; do<br>  echo &quot;Running setup on: $INSTANCE&quot;<br>  gcloud compute ssh &quot;$INSTANCE&quot; -- &#39;bash -s&#39; &lt;&lt;&#39;EOF&#39;<br>    # Ensure required binaries are available in the path<br>    export PATH=$PATH:/usr/sbin:/sbin<br>    <br>    # Set timezone<br>    sudo timedatectl set-timezone Asia/Kolkata<br>    <br>    # Install required shell<br>    sudo yum -y install ksh<br>    <br>    # 👉 You can add your own custom commands below<br>    # Example:<br>    # sudo yum -y install git<br>    # sudo systemctl restart nginx<br>EOF<br>done</pre><h3>📌 Notes</h3><p>You can customize this script by adding your own commands in the section marked:You can <strong>customize this script</strong> by adding your own commands in the section marked:</p><pre># 👉 You can add your own custom commands below</pre><ul><li>For example, you could install git, configure firewalls, or restart services.</li><li>Your gcloud is authenticated</li><li>The correct project and zone are configured using.</li><li>You must be authenticated with gcloud and have the right project/zone set via:</li></ul><pre>gcloud config set project &lt;your-project-id&gt;<br>gcloud config set compute/zone &lt;your-zone&gt;</pre><p>If you found this post helpful, please give it a clap! Your support inspires me to share more valuable insights. If you have any topics in mind or questions you’d like me to address, feel free to reach out. Connect with me on LinkedIn through the bio. Thank you for reading!</p><p>Happy Learning and Growing! 🙂📚</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=176ef2918014" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Mount GCP Filestore & Create Subdirectory on Linux (RHEL/CentOS)]]></title>
            <link>https://maprna0.medium.com/mount-gcp-filestore-create-subdirectory-on-linux-rhel-centos-99646d045530?source=rss-97332a1c4e25------2</link>
            <guid isPermaLink="false">https://medium.com/p/99646d045530</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[network-storage]]></category>
            <category><![CDATA[nfs-server]]></category>
            <category><![CDATA[linux-terminal]]></category>
            <category><![CDATA[gcp-filestore]]></category>
            <dc:creator><![CDATA[NAVEEN M]]></dc:creator>
            <pubDate>Wed, 23 Apr 2025 11:20:58 GMT</pubDate>
            <atom:updated>2025-04-23T11:20:58.084Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide explains how to mount a GCP Filestore NFS share on a Linux VM (RHEL/CentOS) and create subdirectories within it.</p><p>🔗 Official Reference</p><p>Refer to the official documentation for mounting NFS on RHEL/CentOS:<br> ➡️ <a href="https://cloud.google.com/filestore/docs/mounting-fileshares#rhelcentos">GCP Filestore Mounting Guide</a></p><h3>⚙️ Step 1: Install NFS Utilities</h3><pre>sudo yum update -y<br>sudo yum install -y nfs-utils</pre><h3>🗂️ Step 2: Prepare Mount Point</h3><pre># Create a directory to mount the Filestore share<br>sudo mkdir -p /test</pre><h3>🔌 Step 3: Mount the NFS Share</h3><pre># Replace the IP with your Filestore IP<br>sudo mount -o rw,intr 10.0.0.66:/test_shared /test</pre><h3>✅ Step 4: Verify and Set Permissions</h3><pre># Confirm mount success<br>df -h<br><br># Set full access for testing (adjust as needed)<br>sudo chmod 777 /test<br><br># Confirm NFS mount type<br>df -h --type=nfs</pre><h3>📁 Step 5: Create a Subdirectory and Mount It</h3><pre># Create a subdirectory on the mounted share<br>sudo mkdir -p /test/test<br><br># Remount the specific subdirectory (optional)<br>sudo umount /test<br>sudo mount 10.236.160.66:/test_shared/test /test<br><br># Confirm final mount<br>df -h</pre><h3>📝 Notes</h3><ul><li>Adjust IP and paths based on your environment.</li><li>Make sure firewall rules allow NFS (port 2049).</li><li>Ensure your Filestore is in the same VPC and region as your VM.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99646d045530" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Here’s a detailed guide on how to use AWS SES to receive emails from your Gmail account and store…]]></title>
            <link>https://maprna0.medium.com/heres-a-detailed-guide-on-how-to-use-aws-ses-to-receive-emails-from-your-gmail-account-and-store-7b39f66fc90d?source=rss-97332a1c4e25------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b39f66fc90d</guid>
            <category><![CDATA[s3-bucket]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[gmail]]></category>
            <category><![CDATA[dns-servers]]></category>
            <category><![CDATA[lambda]]></category>
            <dc:creator><![CDATA[NAVEEN M]]></dc:creator>
            <pubDate>Thu, 04 Jul 2024 14:54:42 GMT</pubDate>
            <atom:updated>2024-07-04T14:54:42.633Z</atom:updated>
            <content:encoded><![CDATA[<h3>Here’s a detailed guide on how to use AWS SES to receive emails from your Gmail account and store them in an S3 bucket or process them via a Lambda function using Python code. Follow these steps:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yT5Q5louM14QhAorjEWQSg.png" /></figure><h3>Step 1: Create an S3 Bucket and Add the Bucket Policy</h3><ol><li><strong>Create an S3 Bucket:</strong></li></ol><ul><li>Go to the S3 console in the AWS Management Console.</li><li>Click on “Create bucket.”</li><li>Provide a unique bucket name and select your preferred region.</li><li>Click “Create bucket.”</li></ul><p>2. <strong>Add Bucket Policy:</strong></p><ul><li>Go to your S3 bucket.</li><li>Click on the “Permissions” tab.</li><li>Select “Bucket Policy” and paste the following policy. Replace &lt;bucket name&gt; with your bucket name and &lt;account id&gt; with your AWS account ID:</li></ul><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;AllowSESPuts&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: {<br>                &quot;Service&quot;: &quot;ses.amazonaws.com&quot;<br>            },<br>            &quot;Action&quot;: &quot;s3:PutObject&quot;,<br>            &quot;Resource&quot;: &quot;arn:aws:s3:::&lt;bucket name&gt;/*&quot;,<br>            &quot;Condition&quot;: {<br>                &quot;StringEquals&quot;: {<br>                    &quot;aws:Referer&quot;: &quot;&lt;account id&gt;&quot;<br>                }<br>            }<br>        }<br>    ]<br>}</pre><ul><li>Save the changes.</li></ul><h3>Step 2: Create a Lambda Function</h3><ol><li><strong>Create an IAM Policy and Role:</strong></li></ol><ul><li>Go to the IAM console.</li><li>Create a new policy with the following JSON. Replace &lt;bucketName&gt;, &lt;region&gt;, and &lt;awsAccountId&gt; with your S3 bucket name, AWS region, and AWS account ID respectively:</li></ul><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;VisualEditor0&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;logs:CreateLogStream&quot;,<br>                &quot;logs:CreateLogGroup&quot;,<br>                &quot;logs:PutLogEvents&quot;<br>            ],<br>            &quot;Resource&quot;: &quot;*&quot;<br>        },<br>        {<br>            &quot;Sid&quot;: &quot;VisualEditor1&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;s3:GetObject&quot;,<br>                &quot;ses:SendRawEmail&quot;<br>            ],<br>            &quot;Resource&quot;: [<br>                &quot;arn:aws:s3:::&lt;bucketName&gt;/*&quot;,<br>                &quot;arn:aws:ses:&lt;region&gt;:&lt;awsAccountId&gt;:identity/*&quot;<br>            ]<br>        }<br>    ]<br>}</pre><ul><li>Create a role and attach the policy to the role.</li></ul><p>2. <strong>Create the Lambda Function:</strong></p><ul><li>Go to the Lambda console.</li><li>Click “Create function.”</li><li>Choose “Author from scratch.”</li><li>Provide a name for the function.</li><li>Choose Python 3.10 as the runtime.</li><li>Under “Permissions,” choose the role you created.</li><li>Click “Create function.”</li></ul><p>3. <strong>Add the Python Code to Lambda:</strong></p><p>In the function code section, replace the default code with the following Python code:</p><pre>import os<br>import boto3<br>import email<br>import re<br>from botocore.exceptions import ClientError<br>from email.mime.multipart import MIMEMultipart<br>from email.mime.text import MIMEText<br>from email.mime.application import MIMEApplication<br><br>region = os.environ[&#39;Region&#39;]<br><br>def get_message_from_s3(message_id):<br>    incoming_email_bucket = os.environ[&#39;MailS3Bucket&#39;]<br>    incoming_email_prefix = os.environ[&#39;MailS3Prefix&#39;]<br><br>    if incoming_email_prefix:<br>        object_path = (incoming_email_prefix + &quot;/&quot; + message_id)<br>    else:<br>        object_path = message_id<br><br>    object_http_path = (f&quot;http://s3.console.aws.amazon.com/s3/object/{incoming_email_bucket}/{object_path}?region={region}&quot;)<br><br>    client_s3 = boto3.client(&quot;s3&quot;)<br><br>    object_s3 = client_s3.get_object(Bucket=incoming_email_bucket, Key=object_path)<br>    file = object_s3[&#39;Body&#39;].read()<br><br>    file_dict = {<br>        &quot;file&quot;: file,<br>        &quot;path&quot;: object_http_path<br>    }<br><br>    return file_dict<br><br>def create_message(file_dict):<br>    sender = os.environ[&#39;MailSender&#39;]<br>    recipient = os.environ[&#39;MailRecipient&#39;]<br><br>    separator = &quot;;&quot;<br>    mailobject = email.message_from_string(file_dict[&#39;file&#39;].decode(&#39;utf-8&#39;))<br><br>    subject_original = mailobject[&#39;Subject&#39;]<br>    subject = &quot;FW: &quot; + subject_original<br><br>    body_text = (&quot;The attached message was received from &quot;<br>              + separator.join(mailobject.get_all(&#39;From&#39;))<br>              + &quot;. This message is archived at &quot; + file_dict[&#39;path&#39;])<br><br>    filename = re.sub(&#39;[^0-9a-zA-Z]+&#39;, &#39;_&#39;, subject_original) + &quot;.eml&quot;<br><br>    msg = MIMEMultipart()<br>    text_part = MIMEText(body_text, _subtype=&quot;html&quot;)<br>    msg.attach(text_part)<br><br>    msg[&#39;Subject&#39;] = subject<br>    msg[&#39;From&#39;] = sender<br>    msg[&#39;To&#39;] = recipient<br><br>    att = MIMEApplication(file_dict[&quot;file&quot;], filename)<br>    att.add_header(&quot;Content-Disposition&quot;, &#39;attachment&#39;, filename=filename)<br>    msg.attach(att)<br><br>    message = {<br>        &quot;Source&quot;: sender,<br>        &quot;Destinations&quot;: recipient,<br>        &quot;Data&quot;: msg.as_string()<br>    }<br><br>    return message<br><br>def send_email(message):<br>    aws_region = os.environ[&#39;Region&#39;]<br><br>    client_ses = boto3.client(&#39;ses&#39;, aws_region)<br><br>    try:<br>        response = client_ses.send_raw_email(<br>            Source=message[&#39;Source&#39;],<br>            Destinations=[<br>                message[&#39;Destinations&#39;]<br>            ],<br>            RawMessage={<br>                &#39;Data&#39;:message[&#39;Data&#39;]<br>            }<br>        )<br><br>    except ClientError as e:<br>        output = e.response[&#39;Error&#39;][&#39;Message&#39;]<br>    else:<br>        output = &quot;Email sent! Message ID: &quot; + response[&#39;MessageId&#39;]<br><br>    return output<br><br>def lambda_handler(event, context):<br>    message_id = event[&#39;Records&#39;][0][&#39;ses&#39;][&#39;mail&#39;][&#39;messageId&#39;]<br>    print(f&quot;Received message ID {message_id}&quot;)<br><br>    file_dict = get_message_from_s3(message_id)<br><br>    message = create_message(file_dict)<br><br>    result = send_email(message)<br>    print(result)</pre><p>4. <strong>Create Environment Variables for the Lambda Function:</strong></p><ul><li>Go to the “Configuration” tab of your Lambda function.</li><li>Select “Environment variables” and add the following variables:</li></ul><pre>Key              Value<br>MailS3Bucket     The name of the S3 bucket you created.<br>MailS3Prefix     The path of the folder in the S3 bucket where you will store incoming email.<br>MailSender       The email address that the forwarded message will be sent from (must be verified).<br>MailRecipient    The address that you want to forward the message to.<br>Region           The name of the AWS Region that you want to use to send the email.</pre><h3>Step 3: Create Identity on SES</h3><ol><li><strong>Create an SES Identity:</strong></li></ol><ul><li>Go to the SES console.</li><li>Click on “Verified identities” and then “Create identity.”</li><li>Choose “Domain” as the identity type and follow the prompts.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YdV9G3Tj0ZanHAVawY_Xg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*PVYvc6FLOfuAlrUBKvr9uQ.png" /></figure><p>2. <strong>Publish DNS Records:</strong></p><ul><li>SES will provide DNS records (CNAME, MX, TXT) that you need to add to your DNS provider (like Cloudflare or Hostinger).</li><li>Once the DNS records are added, the identity status will change to “Verified.”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e6q2v-HojdzbfVOj-Pywmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lOIszTnfeRv7CrT5aZsjZA.png" /></figure><h3>Step 4: Configure Email Receiving in SES</h3><ol><li><strong>Check Supported Regions:</strong></li></ol><ul><li>Email receiving is only available in certain regions. Check the regions here: <a href="https://docs.aws.amazon.com/ses/latest/dg/regions.html#region-receive-email">AWS SES Receiving Regions</a>.</li></ul><p>2. <strong>Create an MX Entry:</strong></p><ul><li>Add an MX entry in your domain provider for the region you are using.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7k7LxpHk7Kyo261l7-VEfQ.png" /></figure><p>3. <strong>Create Rule Set:</strong></p><ul><li>Go to the SES console.</li><li>Under “Email receiving,” create a rule set.</li><li>Add a rule with recipient conditions (the email addresses you want to receive emails for).</li><li>Add actions to store the emails in S3 and invoke the Lambda function.</li></ul><h3>Testing</h3><ol><li><strong>Send a Test Email:</strong></li></ol><ul><li>Use a service like <a href="https://sendtestemail.com/">SendTestEmail</a> to send a test email to the email address you configured.</li><li>Check the S3 bucket and the Lambda logs to verify the email is processed correctly.</li></ul><p>This guide provides a comprehensive overview of setting up AWS SES to receive emails and process them using S3 and Lambda. By following these steps, you can effectively manage incoming emails from your Gmail account using AWS services. The emails you receive will be stored in the S3 bucket you configured, and you can check the CloudWatch logs to see entries for the received emails.</p><p>If you found this post helpful, please give it a clap! Your support inspires me to share more valuable insights. If you have any topics in mind or questions you’d like me to address, feel free to reach out. Connect with me on LinkedIn through the bio. Thank you for reading!</p><p>Happy Learning and Growing! 🙂📚</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b39f66fc90d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Capturing Wireshark Logs on Linux VMs via CLI]]></title>
            <link>https://maprna0.medium.com/capturing-wireshark-logs-on-linux-vms-via-cli-62f9f066fac3?source=rss-97332a1c4e25------2</link>
            <guid isPermaLink="false">https://medium.com/p/62f9f066fac3</guid>
            <category><![CDATA[wireshark]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[network-capture]]></category>
            <dc:creator><![CDATA[NAVEEN M]]></dc:creator>
            <pubDate>Wed, 03 Jul 2024 17:14:20 GMT</pubDate>
            <atom:updated>2024-07-03T17:14:20.143Z</atom:updated>
            <content:encoded><![CDATA[<p>Capturing network packets is essential for diagnosing and troubleshooting network issues. Wireshark is a popular tool for this purpose, and its command-line counterpart, tshark, allows you to capture and analyze network traffic directly from the CLI. Here&#39;s a step-by-step guide on how to capture Wireshark logs on Linux VMs using tshark.</p><h3>Installing Tshark</h3><p>First, ensure tshark is installed on your system:</p><pre>sudo apt install tshark -y   # For Debian/Ubuntu<br>sudo yum install tshark -y.  # For CentOS/RHEL</pre><p>Verify the installation:</p><pre>tshark --version</pre><p>Check the installation path:</p><pre>which tshark</pre><h3>Basic Capture Command</h3><p>To start capturing packets on the eth0 interface and save them to a file named capture_output.pcap:</p><pre>sudo tshark -i eth0 -w capture_output.pcap</pre><h3>Manual Capture with Specific IPs</h3><p>To capture traffic between a specific source and destination IP:</p><pre>sudo tshark -i eth0 &#39;host &lt;src_ip&gt; and host &lt;dest_ip&gt;&#39; -w capture.pcap</pre><h3>Running Tshark in the Background</h3><p>To run the capture process in the background:</p><pre>nohup sudo tshark -i eth0 &#39;host &lt;src_ip&gt; and host &lt;dest_ip&gt;&#39; -w capture.pcap &gt; /dev/null 2&gt;&amp;1 &amp;</pre><h3>Analyzing Captured Data</h3><p>To see connection resets within a specific time frame:</p><pre>sudo tshark -r capture.pcap -Y &quot;tcp.flags.reset == 1 &amp;&amp; frame.time &gt;= &#39;Apr 17, 2024 16:40:00&#39; &amp;&amp; frame.time &lt;= &#39;Apr 17, 2024 16:41:00&#39;&quot;</pre><p>To filter with more details including timestamp, source, and destination IPs:</p><pre>sudo tshark -r capture.pcap -Y &quot;tcp.flags.reset == 1&quot; -T fields -e frame.time -e ip.src -e tcp.srcport -e ip.dst -e tcp.dstport</pre><p>Example output:</p><pre>&quot;Apr 17, 2024 16:40:53.092280175 IST&quot;   10.214.74.174   64518   10.210.146.78   22<br>&quot;Apr 17, 2024 17:02:52.021632076 IST&quot;   10.210.146.78   22      10.214.74.174   63921<br>&quot;Apr 17, 2024 17:04:30.641030054 IST&quot;   10.214.74.174   8000    10.210.146.78   54802<br>&quot;Apr 17, 2024 17:04:31.231211307 IST&quot;   10.214.74.174   8000    10.210.146.78   54838<br>&quot;Apr 17, 2024 17:04:31.715922159 IST&quot;   10.214.74.174   8000    10.210.146.78   54878</pre><h3>Checking and Killing the Process</h3><p>To check if tshark is running:</p><pre>ps aux | grep &quot;tshark&quot;</pre><p>To kill the background tshark process:</p><pre>kill -9 &lt;PID&gt;</pre><p>Alternatively, to find and kill all the process:</p><pre>sudo ps aux | grep &#39;tshark&#39; | grep -v grep | awk &#39;{print $2}&#39; | xargs sudo kill -9</pre><h3>Conclusion</h3><p>Using tshark to capture network packets on Linux VMs is a powerful way to troubleshoot and analyze network issues. With the steps provided, you can capture traffic, run the capture process in the background, and filter captured data for detailed analysis.</p><p>If you found this post helpful, please give it a clap! Your support inspires me to share more valuable insights. If you have any topics in mind or questions you’d like me to address, feel free to reach out. Connect with me on LinkedIn through the bio. Thank you for reading!</p><p>Happy Learning and Growing! 🙂📚</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62f9f066fac3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Troubleshooting DNS Resolution Issues in an EKS Cluster]]></title>
            <link>https://maprna0.medium.com/troubleshooting-dns-resolution-issues-in-an-eks-cluster-9824875a2d69?source=rss-97332a1c4e25------2</link>
            <guid isPermaLink="false">https://medium.com/p/9824875a2d69</guid>
            <category><![CDATA[nginx-ingress-controller]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[elastickubernetesservice]]></category>
            <category><![CDATA[dns]]></category>
            <dc:creator><![CDATA[NAVEEN M]]></dc:creator>
            <pubDate>Wed, 03 Jul 2024 16:47:09 GMT</pubDate>
            <atom:updated>2024-07-03T16:47:09.926Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I faced an issue while deploying my application on an EKS cluster. I had set up an internal NGINX Ingress controller and mapped the load balancer DNS to my on-premises Active Directory (AD). However, when accessing my application, I encountered issues with one service communicating with another within the EKS cluster via the domain mapped to the on-prem AD.</p><h3>Initial Setup</h3><p>After deploying my application on EKS, I used the following command to set up the internal NGINX load balancer:</p><pre>helm upgrade --install ingress-nginx ingress-nginx \<br>  --repo https://kubernetes.github.io/ingress-nginx \<br>  --namespace ingress-nginx \<br>  --set controller.service.annotations.&quot;service\.beta\.kubernetes\.io/aws-load-balancer-internal&quot;=&quot;true&quot; \<br>  --set-string controller.service.annotations.&quot;alb\.ingress\.kubernetes\.io/scheme&quot;=&quot;internal&quot; \<br>  --set-string controller.service.annotations.&quot;alb\.ingress\.kubernetes\.io/subnets&quot;=&#39;&quot;pvt-sub-01,pvt-sub-02&quot;&#39;</pre><h3>Mapping DNS</h3><p>After setting up the load balancer, we received a DNS name. We created CNAME entries on-premises using two subdomains:</p><ul><li>example.com for the application frontend and backend services</li><li>example-iam.com for the Kratos service used for SSO authentication with our Azure enterprise application</li></ul><h3>Issue Faced</h3><p>When accessing example.com, the response was successful. However, accessing example-iam.com resulted in a &quot;no such host&quot; error, pointing to the default EKS DNS service in the kube-system CoreDNS pod.</p><h3>Troubleshooting Steps</h3><ol><li><strong>Checking DNS Resolution on EC2 Instance</strong></li></ol><p>On an EC2 instance, we performed an nslookup for the domain and found it was not resolving. We then updated the /etc/systemd/resolved.conf file:</p><pre>sudo vi /etc/systemd/resolved.conf</pre><p>Uncomment and update the DNS and Domains lines:</p><pre>DNS=&lt;ec2-default-nameserver-ip&gt; &lt;custom-on-prem-dns-nameserver-ip&gt;<br>Domains=&lt;ec2-default-domain&gt; &lt;custom-domain&gt;</pre><p>Save and quit, then restart the systemd-resolved service:</p><pre>sudo systemctl restart systemd-resolved</pre><ul><li>After this, the nslookup command worked successfully, but the issue persisted in the browser.</li></ul><p><strong>2. Updating CoreDNS Configuration in EKS</strong></p><p>We modified the CoreDNS ConfigMap in the EKS cluster. Below is the original YAML:</p><pre>apiVersion: v1<br>data:<br>  Corefile: |<br>    .:53 {<br>      errors<br>      health {<br>        lameduck 5s<br>      }<br>      ready<br>      kubernetes cluster.local in-addr.arpa ip6.arpa {<br>        pods insecure<br>        fallthrough in-addr.arpa ip6.arpa<br>      }<br>      prometheus :9153<br>      forward . /etc/resolv.conf<br>      cache 30<br>      loop<br>      reload<br>      loadbalance<br>    }<br>kind: ConfigMap<br>metadata:<br>  creationTimestamp: &quot;2024-06-20T07:30:08Z&quot;<br>  labels:<br>    eks.amazonaws.com/component: coredns<br>    k8s-app: kube-dns<br>  name: coredns<br>  namespace: kube-system</pre><p>We created a new YAML file to include our custom domains:</p><pre>apiVersion: v1<br>data:<br>  Corefile: |<br>    .:53 {<br>      errors<br>      health {<br>        lameduck 5s<br>      }<br>      ready<br>      kubernetes cluster.local in-addr.arpa ip6.arpa {<br>        pods insecure<br>        fallthrough in-addr.arpa ip6.arpa<br>      }<br>      prometheus :9153<br>      forward . /etc/resolv.conf<br>      cache 30<br>      loop<br>      reload<br>      loadbalance<br>    }<br>    example.com:53 {<br>      errors<br>      cache 30<br>      forward . &lt;custom-dns-nameserver-ip&gt;<br>      reload<br>    }<br>    example-iam.com:53 {<br>      errors<br>      cache 30<br>      forward . &lt;custom-dns-nameserver-ip&gt;<br>      reload<br>    }<br>kind: ConfigMap<br>metadata:<br>  labels:<br>    eks.amazonaws.com/component: coredns<br>    k8s-app: kube-dns<br>  name: coredns<br>  namespace: kube-system</pre><p>After applying these changes, the DNS resolution issue was resolved, but a new issue arose with the x509 certificate showing “signed by unknown authority.”</p><h3>Resolution</h3><p>To resolve the certificate issue, we copied the certificate of our domain to the pod:</p><ol><li>Update the Dockerfile to include the certificate:</li></ol><pre>COPY example.crt /usr/local/share/ca-certificates/example.crt<br>RUN update-ca-certificates</pre><p>2. Redeploy the new image.</p><p>After these steps, the certificate issue was resolved, and I was able to access my application successfully.</p><p>If you found this post helpful, please give it a clap! Your support inspires me to share more valuable insights. If you have any topics in mind or questions you’d like me to address, feel free to reach out. Connect with me on LinkedIn through the bio. Thank you for reading!</p><p><strong>Happy Learning and Growing!</strong> 🙂📚</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9824875a2d69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mounting Google Cloud Storage (GCS) buckets on your Google Cloud Platform (GCP) Linux VMs can…]]></title>
            <link>https://maprna0.medium.com/mounting-google-cloud-storage-gcs-buckets-on-your-google-cloud-platform-gcp-linux-vms-can-1d3f54a65cb2?source=rss-97332a1c4e25------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d3f54a65cb2</guid>
            <category><![CDATA[google-cloud-storage]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[gcsfuse]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[NAVEEN M]]></dc:creator>
            <pubDate>Mon, 01 Jul 2024 04:49:06 GMT</pubDate>
            <atom:updated>2024-07-01T04:49:06.200Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>How to Mount Cloud Storage Buckets Using Cloud Storage FUSE on Linux VMs in GCP</strong></blockquote><p>Mounting Google Cloud Storage (GCS) buckets on your Google Cloud Platform (GCP) Linux VMs can greatly simplify access to your data. By using Cloud Storage FUSE, you can mount GCS buckets as file systems, making them accessible like any other directory on your VM. This guide covers the installation and setup process for different Linux distributions.</p><p>For detailed installation instructions based on your Linux distribution, please refer to the official <a href="https://cloud.google.com/storage/docs/gcsfuse-install">GCS FUSE installation guide.</a></p><h3>Mounting GCS Buckets</h3><p>Once you’ve installed Cloud Storage FUSE, follow these steps to mount your GCS bucket:</p><ul><li><strong>Ensure you have the necessary authentication and storage access.</strong></li><li><strong>Manually mount a GCS bucket to the VM:</strong></li></ul><pre>sudo mkdir -p /gcsfuse<br>cd /gcsfuse<br>mkdir test<br>sudo gcsfuse --only-dir test &lt;bucket-name&gt; /gcsfuse</pre><h3>Troubleshooting</h3><ul><li><strong>Check Mounted File Systems:</strong></li></ul><pre>mount</pre><p><strong>Check Logs for More Details:</strong></p><pre>journalctl | grep gcsfuse</pre><p><strong>Check FUSE Process:</strong></p><pre>ps aux | grep gcsfuse</pre><p><strong>Check Mount Information:</strong></p><pre>mount | grep gcsfuse</pre><h3>Setting Up Bucket Mount via System Service</h3><ol><li><strong>Create a directory to mount the bucket:</strong></li></ol><pre>sudo mkdir -p /bucket/&lt;local-directory&gt;</pre><p><strong>2. Create the mount script:</strong></p><pre>sudo vi /etc/mount-gcsfuse.sh</pre><p>Add the following content to the script:</p><pre>#!/bin/bash<br>gcsfuse -o allow_other --only-dir=&lt;bucket-folder-name&gt; --uid=&lt;uid&gt; --gid=&lt;gid&gt; &lt;bucket-name&gt; /bucket/&lt;local-directory&gt;</pre><p>3. <strong>Make the script executable:</strong></p><pre>sudo chmod +x /etc/mount-gcsfuse.sh</pre><p>4. <strong>Create the systemd service file:</strong></p><pre>sudo vi /etc/systemd/system/gcsfuse-mount.service</pre><p>Add the following content to the service file:</p><pre>[Unit]<br>Description=Mount GCS Buckets using gcsfuse<br>Wants=network-online.target<br>After=network-online.target<br><br>[Service]<br>Type=oneshot<br>ExecStart=/etc/mount-gcsfuse.sh<br>User=root<br>Group=root<br>RemainAfterExit=yes<br><br>[Install]<br>WantedBy=multi-user.target</pre><p>5. <strong>Reload systemd, enable and start the service:</strong></p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable gcsfuse-mount.service<br>sudo systemctl start gcsfuse-mount.service<br>sudo systemctl status gcsfuse-mount.service</pre><p><strong>Check the service logs:</strong></p><pre>sudo journalctl -u gcsfuse-mount.service -b</pre><p>By following these steps, you can efficiently mount GCS buckets on your GCP Linux VMs using Cloud Storage FUSE, allowing seamless integration and access to your cloud storage directly from your VM.</p><p>If you found this post helpful, please give it a clap! Your support inspires me to share more valuable insights. If you have any topics in mind or questions you’d like me to address, feel free to reach out. Connect with me on LinkedIn through the bio. Thank you for reading!</p><p><strong>Happy Learning and Growing!</strong> 🙂📚</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d3f54a65cb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Set Up a GUI on Red Hat VM in Cloud (GCP, AWS, Azure)]]></title>
            <link>https://maprna0.medium.com/how-to-set-up-a-gui-on-red-hat-vm-in-cloud-gcp-aws-azure-b03ccc9e27c7?source=rss-97332a1c4e25------2</link>
            <guid isPermaLink="false">https://medium.com/p/b03ccc9e27c7</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[redhat-linux]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[gui]]></category>
            <dc:creator><![CDATA[NAVEEN M]]></dc:creator>
            <pubDate>Sun, 30 Jun 2024 05:36:16 GMT</pubDate>
            <atom:updated>2024-06-30T05:36:16.505Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Running a graphical user interface (GUI) on your Red Hat virtual machines in the cloud can simplify many tasks. This guide provides step-by-step instructions for setting up a GUI on Red Hat VMs in cloud environments like GCP, AWS, and Azure.</p><h3>Prerequisites</h3><ul><li>Access to a Red Hat VM</li><li>Sudo privileges</li><li>Internet connection</li></ul><h3>Steps to Set Up the GUI</h3><ol><li><strong>Update All Packages</strong></li></ol><pre>sudo yum update -y</pre><p><strong>2. Install EPEL Release</strong></p><p>This provides additional packages for your system.</p><pre>sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm</pre><p><strong>3. Install Server with GUI</strong></p><pre>sudo yum -y groupinstall &quot;Server with GUI&quot;</pre><p><strong>4. Set Default System Target to Graphical</strong></p><pre>sudo systemctl set-default graphical.target</pre><p><strong>5. Install xrdp and TigerVNC</strong></p><pre>sudo yum install -y xrdp tigervnc-server</pre><p><strong>6. Create a New User ‘gui’</strong></p><pre>sudo adduser gui<br>echo &quot;gui:gui@987&quot; | sudo chpasswd</pre><p><strong>7. Grant Sudo Privileges to ‘gui’</strong></p><pre>echo &quot;gui ALL=(ALL:ALL) ALL&quot; | sudo tee -a /etc/sudoers</pre><p><strong>8. Start and Enable xrdp Service</strong></p><pre>sudo systemctl start xrdp<br>sudo systemctl enable xrdp</pre><p><strong>9. Modify </strong><strong>/etc/xrdp/startwm.sh</strong></p><p>Replace the content with:</p><pre>sudo tee /etc/xrdp/startwm.sh &gt; /dev/null &lt;&lt;EOL<br>#!/bin/bash<br>#<br># This script is an example. You might need to edit this script<br># depending on your distro if it doesn&#39;t work for you.<br>#<br># Uncomment the following line for debug:<br># exec xterm<br><br>pre_start() {<br>  if [ -r /etc/profile ]; then<br>    . /etc/profile<br>  fi<br>  if [ -r ~/.bash_profile ]; then<br>    . ~/.bash_profile<br>  else<br>    if [ -r ~/.bash_login ]; then<br>      . ~/.bash_login<br>    else<br>      if [ -r ~/.profile ]; then<br>        . ~/.profile<br>      fi<br>    fi<br>  fi<br>  return 0<br>}<br><br>post_start() {<br>  if [ -r ~/.bash_logout ]; then<br>    . ~/.bash_logout<br>  fi<br>  return 0<br>}<br><br>wm_start() {<br>  if [ -r /etc/default/locale ]; then<br>    . /etc/default/locale<br>    export LANG LANGUAGE<br>  fi<br><br>  # debian<br>  if [ -r /etc/X11/Xsession ]; then<br>    pre_start<br>    . /etc/X11/Xsession<br>    post_start<br>    exit 0<br>  fi<br><br>  # alpine<br>  if [ -f /etc/alpine-release ]; then<br>    if [ -f /etc/X11/xinit/xinitrc ]; then<br>      pre_start<br>      /etc/X11/xinit/xinitrc<br>      post_start<br>    else<br>      echo &quot;** xinit package isn&#39;t installed&quot; &gt;&amp;2<br>      exit 1<br>    fi<br>  fi<br><br>  # el<br>  if [ -r /etc/X11/xinit/Xsession ]; then<br>    pre_start<br>    . /etc/X11/xinit/Xsession<br>    post_start<br>    exit 0<br>  fi<br><br>  # suse<br>  if [ -r /etc/X11/xdm/Xsession ]; then<br>    . /etc/X11/xdm/Xsession<br>    exit 0<br>  elif [ -r /usr/etc/X11/xdm/Xsession ]; then<br>    . /usr/etc/X11/xdm/Xsession<br>    exit 0<br>  fi<br><br>  pre_start<br>  xterm<br>  post_start<br>}<br><br>wm_start<br><br>exit 1<br>EOL</pre><p>Make the script executable:</p><pre>sudo chmod +x /etc/xrdp/startwm.sh</pre><p><strong>10. Restart xrdp Services</strong></p><pre>sudo systemctl restart xrdp xrdp-sesman</pre><h3>Conclusion</h3><p>Following these steps, you should now have a fully functional GUI on your Red Hat VM in the cloud. This setup allows for easier management and use of graphical applications.</p><p>If you found this post helpful, please give it a clap! Your support inspires me to share more valuable insights. If you have any topics in mind or questions you’d like me to address, feel free to reach out. Connect with me on LinkedIn through the bio. Thank you for reading!</p><p><strong>Happy Learning and Growing!</strong> 🙂📚</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b03ccc9e27c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Resolving Network Unreachability in GCP Linux VM]]></title>
            <link>https://maprna0.medium.com/resolving-network-unreachability-in-gcp-linux-vm-97688bade392?source=rss-97332a1c4e25------2</link>
            <guid isPermaLink="false">https://medium.com/p/97688bade392</guid>
            <category><![CDATA[nic]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[compute-engine]]></category>
            <dc:creator><![CDATA[NAVEEN M]]></dc:creator>
            <pubDate>Sat, 29 Jun 2024 10:45:01 GMT</pubDate>
            <atom:updated>2024-06-29T10:45:01.856Z</atom:updated>
            <content:encoded><![CDATA[<h3>Issue</h3><p>While trying to connect to a GCP Linux VM, I encountered the following errors in the serial console logs:</p><pre>Jun 21 11:46:50 edem-poc gce_workload_cert_refresh[10232]: Exhausted 100 retry attempts to connect to MDS, failed with an error: error connecting to metadata server: Get &quot;http://169.254.169.254/computeMetadata/v1/instance/attributes/enable-workload-certificate&quot;: dial tcp 169.254.169.254:80: connect: network is unreachable<br>Jun 21 11:47:16 edem-poc google_guest_agent[12410]: ERROR instance_setup.go:158 Failed to reach MDS(all retries exhausted): context canceled<br>Jun 21 11:47:16 edem-poc systemd[1]: google-guest-agent.service: Failed with result &#39;timeout&#39;.</pre><p>The VM’s network interface card (NIC) wasn’t assigned an IP address, despite being configured in the GCP console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*RHfZ6c8kA6rhJC5dUsJ-6A.png" /></figure><h3>Resolution</h3><p>To resolve the issue, I manually assigned the NIC IP using the following commands:</p><pre>sudo nmcli d<br>sudo nmcli d connect eth0</pre><p>After executing these commands, the ifconfig output confirmed the IP assignment, and I could successfully SSH into the VM.</p><p>If you found this post helpful, please give it a clap! Your support inspires me to share more valuable insights. If you have any topics in mind or questions you’d like me to address, feel free to reach out. Connect with me on LinkedIn through the bio. Thank you for reading!</p><p><strong>Happy Learning and Growing!</strong> 🙂📚</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97688bade392" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Resolving the “mount.nfs:]]></title>
            <link>https://maprna0.medium.com/resolving-the-mount-nfs-6b28649b60fa?source=rss-97332a1c4e25------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b28649b60fa</guid>
            <category><![CDATA[nfs-server]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <dc:creator><![CDATA[NAVEEN M]]></dc:creator>
            <pubDate>Fri, 28 Jun 2024 16:53:08 GMT</pubDate>
            <atom:updated>2024-06-28T16:53:08.887Z</atom:updated>
            <content:encoded><![CDATA[<h3>Resolving the “mount.nfs: Protocol not supported” Error When Mounting GCP Filestore on an On-Prem VM</h3><p>While attempting to mount my Google Cloud Platform (GCP) Filestore to an on-premises virtual machine (VM), I encountered the error:</p><p><strong>mount.nfs: Protocol not supported</strong></p><p>This error can be frustrating, especially when you need seamless integration between your on-prem infrastructure and cloud resources. Here’s how I resolved the issue.</p><h3>Resolution</h3><p>To resolve this error, follow these steps:</p><ol><li><strong>Add On-Prem VM IP or Subnet Ranges to GCP Filestore Access Control:</strong></li></ol><p>You need to add the IP address or subnet ranges of your on-prem VM to the GCP Filestore’s access control list. This ensures that the Filestore recognizes and allows access from your on-prem network.</p><ul><li>Go to your GCP Console.</li><li>Navigate to the Filestore instance you are trying to mount.</li><li>Click on <strong>Edit</strong> under the <strong>Access Control</strong> section.</li><li>Add your on-prem VM’s IP address or the subnet range under the <strong>IP addresses</strong> or <strong>IP ranges</strong> field.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bxRs7Mz7HHIxoxpriQ0nFw.png" /></figure><p>2. <strong>Ensure NFS Protocol Support on Your On-Prem VM:</strong></p><p>Verify that the NFS protocol is supported and properly configured on your on-prem VM. You may need to install or enable the necessary NFS client packages.</p><ul><li>For most Linux distributions, you can install the NFS client using:sudo mount -t nfs [YOUR-FILESTORE-IP]:/[YOUR-FILESTORE-PATH] /mnt</li></ul><pre>sudo apt-get install nfs-common  # For Debian/Ubuntu<br>sudo yum install nfs-utils       # For CentOS/RHEL</pre><ul><li>Once installed, try mounting again using:</li></ul><pre>sudo mount -t nfs [YOUR-FILESTORE-IP]:/[YOUR-FILESTORE-PATH] /mnt</pre><p>Following these steps should resolve the “Protocol not supported” error and allow you to mount your GCP Filestore on your on-prem VM successfully.</p><p>If you found this post helpful, please give it a clap! Your support inspires me to share more valuable insights. If you have any topics in mind or questions you’d like me to address, feel free to reach out. Connect with me on LinkedIn through the bio. Thank you for reading!</p><p>Happy Learning and Growing! 🙂📚</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b28649b60fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>