<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Kevin Sheeran</title>
    <description>The latest articles on Forem by Kevin Sheeran (@kevinsheeranxyj).</description>
    <link>https://forem.com/kevinsheeranxyj</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1070588%2Fadc21a41-6f46-4c1e-a0ec-1e0d3efb5749.jpg</url>
      <title>Forem: Kevin Sheeran</title>
      <link>https://forem.com/kevinsheeranxyj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kevinsheeranxyj"/>
    <language>en</language>
    <item>
      <title>Rust Series01 - Ownership is what you need to know</title>
      <dc:creator>Kevin Sheeran</dc:creator>
      <pubDate>Sat, 10 Jan 2026 05:37:35 +0000</pubDate>
      <link>https://forem.com/kevinsheeranxyj/rust-series01-ownership-is-what-you-need-to-know-2ikm</link>
      <guid>https://forem.com/kevinsheeranxyj/rust-series01-ownership-is-what-you-need-to-know-2ikm</guid>
      <description>&lt;p&gt;Hi fellows, since I've been using Rust for about 3 years now, I think it's time to share some experience to you guys, so I decide to post this Rust language learning series in next couple of weeks. Without further do, let's jump into it.&lt;/p&gt;

&lt;p&gt;Assume you know some OOP(Oriented-Object-Programming) languages, like Java, C#. you will understand that everything is based on Object, but today you need to shift your mind as Rust is not an OOP language, instead it is all about ownership which means Rust will ask you explicitly who owns memory.  &lt;/p&gt;

&lt;p&gt;So Ownership answers one question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Who is responsible for freeing this memory?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The core ownership rule (only one owner)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Every value in Rust has exactly ONE owner at any time
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let s = String::from("hello");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;•s owns the heap memory for "hello"&lt;br&gt;
•When s goes out of scope → memory is freed automatically&lt;/p&gt;

</description>
      <category>programming</category>
      <category>rust</category>
      <category>web3</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Kubernetes Series(1): How to install Kubernetes in Ubuntu</title>
      <dc:creator>Kevin Sheeran</dc:creator>
      <pubDate>Fri, 28 Apr 2023 04:00:40 +0000</pubDate>
      <link>https://forem.com/kevinsheeranxyj/kubernetes-series1-how-to-install-kubernetes-in-ubuntu-41gn</link>
      <guid>https://forem.com/kevinsheeranxyj/kubernetes-series1-how-to-install-kubernetes-in-ubuntu-41gn</guid>
      <description>&lt;p&gt;Hi all, I recently learned some Docker key features and once in a while I come up with Kubernetes which really makes me wondering what is it and how does it work and what's the difference between Docker, so today I will guide you through clear the whole doubts.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Kubernetes?
&lt;/h2&gt;

&lt;p&gt;Assuming you have learned Docker, if you don't know about Docker, it doesn't matter, I'll give you a example. Docker is like a container which put all of your stuff inside it, and in DevOps world, the stuff means your package applications and their dependencies, and you can run the container whatever you want in an isolated environment which make it easier to develop, test, and deploy applications across different environments. While Kubernetes is a platform for orchestrating and managing the containerized applications. It provides a higher-level abstraction that makes it easier to manage and scale containerized application in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it work?
&lt;/h2&gt;

&lt;p&gt;As I mentioned above, Kubernetes is a powerful tool that automates the deployment, scaling, and management of containerized applications. So here is how it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The developer creates a containerized application using Docker, which packages the application and its dependencies into a portable container.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The developer defines the application's requirements, such as the number of replicas, resource requirements, and networking requirements, in a Kubernetes manifest file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Kubernetes master node receives the manifest file and uses it to create and manage the application's resources, such as pods, services, and replicasets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pods are the smallest deployable units in Kubernetes, and they contain one or more containers that share the same network namespace and can communicate with each other directly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Services provide a stable IP address and DNS name for the pods, and they can load balance traffic to the pods based on labels.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replicasets ensure that a specified number of replicas of a pod are running at all times, and they automatically scale up or down based on the application's resource requirements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Kubernetes master node monitors the state of the application's resources and automatically makes changes to ensure that the desired state is maintained.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If a pod fails or is terminated, the Kubernetes master node automatically replaces it with a new pod to maintain the desired number of replicas.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the application's resource requirements change, such as increased traffic or resource-intensive tasks, Kubernetes can automatically scale up the number of replicas to meet the demand.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Kubernetes also provides advanced features such as rolling updates, which allow updates to be rolled out gradually to minimize downtime, and canary deployments, which allow new versions of the application to be tested on a small subset of users before being rolled out to everyone.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to install it in Ubuntu?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Update your Ubuntu system using the following commands:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
sudo apt-get upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install Docker on your Ubuntu system by running the following commands:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install docker.io
sudo systemctl start docker
sudo systemctl enable docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add the Kubernetes apt repository key by running the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add the Kubernetes apt repository to your system by running the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Update your system again using the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install Kubernetes and its dependencies using the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install kubeadm kubelet kubectl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will install Kubernetes, kubelet (the agent that runs on each node in the cluster), kubeadm (the tool used to bootstrap the cluster), and kubectl (the command-line tool used to interact with the cluster).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Initialize the Kubernetes cluster using &lt;code&gt;kubeadm&lt;/code&gt; by running the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo kubeadm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create the Kubernetes control plane on your master node.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Once the initialization is complete, kubeadm will output a kubeadm join command. Copy this command to your clipboard, as you will need to run it on your worker nodes to join them to the cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure your kubectl command-line tool to connect to the Kubernetes API server by running the following command:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a directory for your kubectl configuration and copy the configuration file from your master node to your local machine.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Deploy a pod network to the cluster using the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will deploy the Flannel pod network to the cluster, which will allow pods to communicate with each other across different nodes.&lt;/p&gt;

&lt;p&gt;That's it! You now have a Kubernetes cluster running on your Ubuntu system. You can add worker nodes to the cluster by running the kubeadm join command on each worker node, and you can deploy applications to the cluster using kubectl.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Docker Series: Run Grafana + Prometheus with Docker Compose in Ubuntu</title>
      <dc:creator>Kevin Sheeran</dc:creator>
      <pubDate>Thu, 27 Apr 2023 09:59:20 +0000</pubDate>
      <link>https://forem.com/kevinsheeranxyj/docker-series-run-grafana-prometheus-with-docker-compose-in-ubuntu-njh</link>
      <guid>https://forem.com/kevinsheeranxyj/docker-series-run-grafana-prometheus-with-docker-compose-in-ubuntu-njh</guid>
      <description>&lt;p&gt;Hi, there! Since docker has become more and more popular in CI/CD world, today I will be using a brief hands-on experience on how to run &lt;strong&gt;Grafana&lt;/strong&gt; and &lt;strong&gt;Prometheus&lt;/strong&gt; with &lt;strong&gt;Docker Compose&lt;/strong&gt; in Ubuntu system&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Install Docker on your Ubuntu machine. You can do this by following the official Docker installation guide for Ubuntu: &lt;a href="https://docs.docker.com/engine/install/ubuntu/" rel="noopener noreferrer"&gt;https://docs.docker.com/engine/install/ubuntu/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new directory for your Prometheus and Grafana configuration files:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir ~/monitoring
cd ~/monitoring
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a new Docker Compose file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano docker-compose.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Paste the following configuration into the file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version: '3'

services:
  prometheus:
    image: prom/prometheus
    container_name: prometheus
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    command:
      - --config.file=/etc/prometheus/prometheus.yml
    ports:
      - "9090:9090"
    networks:
      - monitoring

  grafana:
    image: grafana/grafana
    container_name: grafana
    volumes:
      - grafana_data:/var/lib/grafana
    ports:
      - "3000:3000"
    networks:
      - monitoring

volumes:
  grafana_data:

networks:
  monitoring:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Save and close the file&lt;/li&gt;
&lt;li&gt;Create a new Prometheus configuration file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano prometheus.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Paste the following configuration into the file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;global:
  scrape_interval: 15s

scrape_configs:
  - job_name: 'prometheus'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9090']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Save and close the faile.&lt;/li&gt;
&lt;li&gt;Start the Docker containers:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Wait for a few seconds for the containers to start up, then navigate to &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt; in your web browser to access Grafana.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Log in to Grafana using the default credentials (username: admin, password: admin), then add a new data source by clicking on the "Add data source" button and selecting "Prometheus" as the data source type.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure the Prometheus data source by specifying the URL as &lt;a href="http://prometheus:9090/" rel="noopener noreferrer"&gt;http://prometheus:9090/&lt;/a&gt; and clicking on the "Save &amp;amp; Test" button.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can now create dashboards in Grafana and start monitoring your applications with Prometheus.&lt;/p&gt;

&lt;p&gt;That's it! You now have a working setup of Grafana and Prometheus running with Docker on Ubuntu&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
