<?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 DevTroid on Medium]]></title>
        <description><![CDATA[Stories by DevTroid on Medium]]></description>
        <link>https://medium.com/@devtroid?source=rss-ba8629553a65------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*w2-4x1JwMvjKouCjwRB_HA.jpeg</url>
            <title>Stories by DevTroid on Medium</title>
            <link>https://medium.com/@devtroid?source=rss-ba8629553a65------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 21:49:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@devtroid/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[ELK Stack on Kubernetes Step-by-Step Guide]]></title>
            <link>https://devtroid.medium.com/elk-stack-on-kubernetes-step-by-step-guide-2f17fb7bc042?source=rss-ba8629553a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f17fb7bc042</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[elastic]]></category>
            <category><![CDATA[kibana]]></category>
            <category><![CDATA[logstash]]></category>
            <dc:creator><![CDATA[DevTroid]]></dc:creator>
            <pubDate>Sat, 24 May 2025 09:09:44 GMT</pubDate>
            <atom:updated>2025-05-25T17:58:31.409Z</atom:updated>
            <content:encoded><![CDATA[<h3>ELK Stack on Kubernetes | Step-by-Step Guide</h3><h3>Introduction</h3><p>The <strong>ELK stack</strong> (Elasticsearch, Logstash, Kibana), combined with <strong>Filebeat</strong>, helps aggregate and analyze logs efficiently. Deploying ELK on Kubernetes improves scalability and log observability in microservices environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LHie4Q-jnknoTiFTTVaI0Q.png" /></figure><h3>🔹 Prerequisites</h3><ul><li>A running Kubernetes cluster (Minikube, EKS, GKE, etc.)</li><li>kubectl configured</li><li>Lens (optional, for GUI)</li></ul><h3>Install Elastic Operator (ECK)</h3><pre>kubectl create -f https://download.elastic.co/downloads/eck/3.0.0/crds.yaml<br>kubectl apply -f https://download.elastic.co/downloads/eck/3.0.0/operator.yaml</pre><blockquote><em>⚠️ Ensure all ELK components (Elasticsearch, Kibana, Filebeat, Logstash) use the same version.</em></blockquote><h3>🔹 Setting Up Elasticsearch</h3><p><strong>elasticsearch.yaml:</strong></p><pre>apiVersion: elasticsearch.k8s.elastic.co/v1<br>kind: Elasticsearch<br>metadata:<br>  name: quickstart<br>spec:<br>  version: 8.13.4<br>  nodeSets:<br>    - name: default<br>      count: 1<br>      config:<br>        node.store.allow_mmap: false</pre><h3>Deploy:</h3><pre>kubectl apply -f elasticsearch.yaml<br>kubectl get elasticsearch</pre><h3>Access Elasticsearch:</h3><pre>kubectl get service quickstart-es-http</pre><h3>Get credentials:</h3><pre>PASSWORD=$(kubectl get secret quickstart-es-elastic-user -o go-template=&#39;{{.data.elastic | base64decode}}&#39;)</pre><h3>Port-forward for local access:</h3><pre>kubectl port-forward service/quickstart-es-http 9200<br>curl -u &quot;elastic:$PASSWORD&quot; -k &quot;https://localhost:9200&quot;</pre><h3>🔹 Setting Up Kibana</h3><p><strong>kibana.yaml:</strong></p><pre>apiVersion: kibana.k8s.elastic.co/v1<br>kind: Kibana<br>metadata:<br>  name: quickstart<br>spec:<br>  version: 8.13.4<br>  count: 1<br>  elasticsearchRef:<br>    name: quickstart</pre><h3>Deploy:</h3><pre>kubectl apply -f kibana.yaml<br>kubectl get kibana</pre><h3>Access Kibana:</h3><pre>kubectl port-forward service/quickstart-kb-http 5601</pre><p>Then open: <a href="https://localhost:5601/">https://localhost:5601</a></p><blockquote><em>🔑 Get password again using</em></blockquote><pre>kubectl get secret quickstart-es-elastic-user -o=jsonpath=&#39;{.data.elastic}&#39; | base64 --decode; echo</pre><h3>🔹 Deploying Filebeat</h3><p><strong>filebeat.yaml:</strong></p><pre>apiVersion: beat.k8s.elastic.co/v1beta1<br>kind: Beat<br>metadata:<br>  name: quickstart<br>spec:<br>  type: filebeat<br>  version: 8.13.4<br>  config:<br>    filebeat.inputs:<br>      - type: container<br>        paths: [&quot;/var/log/containers/*.log&quot;]<br>        processors:<br>          - add_kubernetes_metadata: { matchers: [{ logs_path: { logs_path: &quot;/var/log/containers/&quot; } }] }<br>          - drop_event.when.or:<br>              - equals: { kubernetes.namespace: &quot;kube-system&quot; }<br>              # more namespaces to exclude...<br>    output.logstash:<br>      hosts: [&quot;logstash.logging.svc:5044&quot;]<br>  daemonSet:<br>    podTemplate:<br>      spec:<br>        serviceAccountName: filebeat<br>        hostNetwork: true<br>        containers:<br>          - name: filebeat<br>            volumeMounts:<br>              - name: varlogcontainers<br>                mountPath: /var/log/containers<br>        volumes:<br>          - name: varlogcontainers<br>            hostPath:<br>              path: /var/log/containers<br>---<br>apiVersion: rbac.authorization.k8s.io/v1<br>kind: ClusterRoleBinding<br>metadata:<br>  name: filebeat<br>subjects:<br>- kind: ServiceAccount<br>  name: filebeat<br>  namespace: elk-test<br>roleRef:<br>  kind: ClusterRole<br>  name: filebeat<br>  apiGroup: rbac.authorization.k8s.io<br>---<br>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: filebeat</pre><h3>Deploy:</h3><pre>kubectl apply -f filebeat.yaml<br>kubectl get beat<br>kubectl logs -f &lt;filebeat-pod-name&gt;</pre><h3>🔹 Deploying Logstash</h3><p><strong>logstash.yaml:</strong> (sample snippet)</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: logstash<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app.kubernetes.io/name: elasticsearch-logstash<br>  template:<br>    metadata:<br>      labels:<br>        app.kubernetes.io/name: elasticsearch-logstash<br>    spec:<br>      containers:<br>        - name: logstash<br>          image: docker.elastic.co/logstash/logstash:8.13.4<br>          ports:<br>            - containerPort: 5044<br>          volumeMounts:<br>            - name: config-volume<br>              mountPath: /usr/share/logstash/pipeline<br>      volumes:<br>        - name: config-volume<br>          configMap:<br>            name: logstash-config</pre><blockquote><em>You’ll need to create a </em><em>ConfigMap named </em><em>logstash-config with your Logstash pipeline settings</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i8BYDsybBogBt2YP.jpeg" /></figure><h3>🏁 Final Notes</h3><ul><li>Access Kibana to visualize logs: localhost:5601 → <em>Discover tab</em></li><li>Logs should now flow from Kubernetes → Filebeat → Logstash → Elasticsearch → Kibana.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f17fb7bc042" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Multi-Region EKS Cluster Architecture with AWS Global Accelerator]]></title>
            <link>https://devtroid.medium.com/building-a-multi-region-eks-cluster-architecture-with-aws-global-accelerator-b88c16da8260?source=rss-ba8629553a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/b88c16da8260</guid>
            <category><![CDATA[global-accelerator]]></category>
            <category><![CDATA[ek]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[disaster-recovery]]></category>
            <dc:creator><![CDATA[DevTroid]]></dc:creator>
            <pubDate>Wed, 14 May 2025 19:24:13 GMT</pubDate>
            <atom:updated>2025-05-14T19:24:13.623Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0iRUDGrcDYRKdNX4QJKA7g.png" /><figcaption>AWS-MULTI-REGION-EKS-GLOBAL_ACCELERATOR</figcaption></figure><h3>Why Multi-Region Deployments?</h3><p>Natural disasters, technical failures, or human errors can disrupt services in a single region. By architecting applications across multiple regions, businesses can achieve:</p><ul><li><strong>High Availability</strong>: Ensuring services remain operational even if one region fails.</li><li><strong>Disaster Recovery</strong>: Quickly recovering from regional outages.</li><li><strong>Reduced Latency</strong>: Serving users from the nearest region.</li></ul><h3>Architecture Overview</h3><p>The architecture involves deploying two EKS clusters in separate AWS regions (e.g., us-east-1 and ap-south-1). Each cluster resides in its own Virtual Private Cloud (VPC). AWS Global Accelerator provides a pair of static anycast IP addresses that serve as the single entry point to the application, intelligently routing traffic to the optimal region based on health and proximity.</p><h3>Implementation Steps</h3><h3>Step 1. Provision EKS Clusters</h3><p>“The method for provisioning EKS clusters across different regions depends on the user’s preferences. Personally, I utilized Terraform, employing distinct .tfvars files and separate workspaces for each environment”</p><h3>Step 2. Install the AWS Load Balancer Controller</h3><p>Since we’re utilizing an Application Load Balancer (ALB) for Kubernetes ingress, it’s essential to install the AWS Load Balancer Controller on each EKS cluster. This controller manages the provisioning of ALBs in response to Kubernetes ingress resources. We’ll employ Helm for the installation process. If the AWS Load Balancer Controller is already installed in your cluster, you can skip this step.</p><p><em>Note: The AWS ALB Ingress Controller has been renamed to the AWS Load Balancer Controller.</em></p><p>ref. <a href="https://github.com/kubernetes-sigs/aws-load-balancer-controller">https://github.com/kubernetes-sigs/aws-load-balancer-controller</a></p><h3><strong>Step 3: Deploying Your Service with an Ingress Resource</strong></h3><p>After installing the AWS Load Balancer Controller on your EKS clusters, you can expose your Kubernetes services externally by creating an Ingress resource. This resource defines how external HTTP or HTTPS traffic is routed to services within your cluster.<a href="https://harsh05.medium.com/path-based-routing-with-aws-load-balancer-controller-an-ingress-journey-on-amazon-eks-733d3c6c5adf?utm_source=chatgpt.com">Medium+1AWS Documentation+1</a></p><p>Below is an example of an Ingress manifest that configures an internet-facing Application Load Balancer (ALB) to route HTTP traffic to your service:</p><pre>Version: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: my-app-ingress<br>  annotations:<br>    kubernetes.io/ingress.class: alb<br>    alb.ingress.kubernetes.io/scheme: internet-facing<br>    alb.ingress.kubernetes.io/target-type: ip<br>    alb.ingress.kubernetes.io/listen-ports: &#39;[{&quot;HTTP&quot;: 80}]&#39;<br>    alb.ingress.kubernetes.io/healthcheck-path: /healthz<br>spec:<br>  ingressClassName: alb<br>  rules:<br>    - http:<br>        paths:<br>          - path: /<br>            pathType: Prefix<br>            backend:<br>              service:<br>                name: my-app-service<br>                port:<br>                  number: 80</pre><h3>Step 4: Configure AWS Global Accelerator for Multi-Region Failover</h3><p>To ensure high availability and automatic failover between your primary (us-east-1) and secondary (ap-south-1) AWS regions, configure AWS Global Accelerator to route traffic efficiently.</p><h4>1. Create a Global Accelerator</h4><p>Initiate the creation of a Global Accelerator:</p><pre>ACCELERATOR_ARN=$(aws globalaccelerator create-accelerator \<br>  --name my-multi-region-app \<br>  --query &#39;Accelerator.AcceleratorArn&#39; \<br>  --region us-west-2 \<br>  --output text)</pre><p>Global Accelerator only works with us-west-2 region</p><h4>2. Add a Listener</h4><p>Configure a listener to process inbound connections on TCP port 80:</p><pre>LISTENER_ARN=$(aws globalaccelerator create-listener \<br>  --accelerator-arn $ACCELERATOR_ARN \<br>  --region us-west-2 \<br>  --protocol TCP \<br>  --port-ranges FromPort=80,ToPort=80 \<br>  --query &#39;Listener.ListenerArn&#39; \<br>  --output text)</pre><h4>3. Add Endpoint Groups</h4><p>Register your ALBs as endpoints in their respective regions.</p><p><strong>Primary Region (</strong><strong>us-east-1):</strong></p><pre>PRIMARY_ALB_ARN=$(aws elbv2 describe-load-balancers \<br>    --region us-east-1 \<br>    --query &quot;LoadBalancers[?contains(DNSName, &#39;$INGRESS_DNS&#39;)].LoadBalancerArn&quot; \<br>    --output text)</pre><pre>aws globalaccelerator create-endpoint-group \<br>  --region us-west-2 \<br>  --listener-arn $LISTENER_ARN \<br>  --endpoint-group-region us-east-1 \<br>  --query &quot;EndpointGroup.EndpointGroupArn&quot; \<br>  --output text \<br>  --endpoint-configurations EndpointId=$PRIMARY_ALB_ARN,Weight=128,ClientIPPreservationEnabled=True)</pre><p><strong>Secondary Region (</strong><strong>ap-south-1):</strong></p><pre>SECONDARY_ALB_ARN=$(aws elbv2 describe-load-balancers \<br>    --region ap-south-1 \<br>    --query &quot;LoadBalancers[?contains(DNSName, &#39;$INGRESS_DNS&#39;)].LoadBalancerArn&quot; \<br>    --output text)</pre><pre>aws globalaccelerator create-endpoint-group \<br>  --region us-west-2 \<br>  --listener-arn $LISTENER_ARN \<br>  --endpoint-group-region ap-south-1 \<br>  --query &quot;EndpointGroup.EndpointGroupArn&quot; \<br>  --output text \<br>  --traffic-dial-percentage 0 \<br>  --endpoint-configurations EndpointId=$SECONDARY_ALB_ARN,Weight=128,ClientIPPreservationEnabled=True)</pre><p>Setting --traffic-dial-percentage to 0 for the secondary region ensures that all traffic is directed to the primary region under normal conditions. If the primary region becomes unhealthy, Global Accelerator will automatically reroute traffic to the secondary region.</p><h4>4. Retrieve the Global Accelerator DNS Name</h4><p>Obtain the DNS name assigned to your Global Accelerator:</p><pre>GA_DNS=$(aws globalaccelerator describe-accelerator \<br>  --accelerator-arn $ACCELERATOR_ARN \<br>  --query &#39;Accelerator.DnsName&#39; \<br>  --output text)</pre><pre>echo &quot;Global Accelerator DNS: $GA_DNS&quot;<br>//abcdefgh.awsglobalaccelerator.com</pre><p>You can now direct your application’s traffic to this DNS name, ensuring seamless failover and improved performance for your users.</p><p>===============================================================</p><p>References:</p><ul><li><a href="https://awscli.amazonaws.com/v2/documentation/api/latest/reference/globalaccelerator/index.html">globalaccelerator - AWS CLI 2.27.14 Command Reference</a></li><li><a href="https://docs.aws.amazon.com/launchwizard/latest/userguide/launch-wizard-eks-deploying-cli.html">Deploy Amazon EKS to a new or existing VPC (AWS CLI)</a></li><li><a href="https://aws.amazon.com/global-accelerator/">Network Acceleration Service - AWS Global Accelerator - AWS</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b88c16da8260" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Python 3 (3.11.9) on Cent OS 9 | RHEL]]></title>
            <link>https://devtroid.medium.com/installing-python-3-0-11-on-cent-os-9-86c13ecd3a33?source=rss-ba8629553a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/86c13ecd3a33</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[centos]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[DevTroid]]></dc:creator>
            <pubDate>Tue, 09 Jul 2024 06:28:39 GMT</pubDate>
            <atom:updated>2024-07-09T06:31:54.119Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uTsMMXhi3CjtYUDFWLGx2Q.jpeg" /></figure><p>Python 3.11 introduces new features and optimizations. Follow these steps to install Python 3.11 from a tarball on your Linux system.</p><h3>Step 1: Download Python 3.11 Tarball</h3><p>First, download Python 3.11 tarball from the official Python website or your preferred source:</p><pre>$ wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz</pre><h3>Step 2: Extract Python 3.11 Tarball</h3><p>Once downloaded, extract the tarball:</p><pre>$ tar -xvzf Python-3.11.9.tgz -C /opt</pre><h3>Step 3: Navigate to Python Source Directory</h3><p>Navigate to the extracted Python source directory:</p><pre>$ cd /opt/Python-3.11.9</pre><h3>Step 4: Configure Python 3.11 Installation</h3><p>Configure Python with optimization flags and SQLite extensions support:</p><pre>$ ./configure --enable-loadable-sqlite-extensions --enable-optimizations</pre><h3>Step 5: Compile Python 3.11</h3><p>Compile Python from source using multiple cores for faster compilation:</p><pre>$ make -j$(nproc)</pre><h3>Step 6: Install Python 3.11</h3><p>Install Python 3.11 on your system:</p><pre>$ sudo make install</pre><h3>Step 7: Verify Python Installation</h3><p>Verify that Python 3.11 is installed correctly:</p><pre>$ python3.11 --version<br>Python 3.11.9</pre><h3>Conclusion</h3><p>Congratulations! You’ve successfully installed Python 3.11 from a tarball on your Linux system. Python 3.11 brings new features and optimizations that you can leverage in your development projects.</p><p>For more information and advanced configurations, refer to the <a href="https://docs.python.org/3.11/">Python Documentation</a>.</p><p>This guide provides a straightforward approach to installing Python 3.11 from a tarball on Linux. Enjoy coding with the latest Python features</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86c13ecd3a33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Java 22 (22.0.1) on Cent OS 9 | RHEL]]></title>
            <link>https://devtroid.medium.com/installing-java-22-22-0-1-on-cent-os-9-76a4d6cc5cd5?source=rss-ba8629553a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/76a4d6cc5cd5</guid>
            <category><![CDATA[java22]]></category>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[centos]]></category>
            <dc:creator><![CDATA[DevTroid]]></dc:creator>
            <pubDate>Tue, 09 Jul 2024 06:17:10 GMT</pubDate>
            <atom:updated>2024-07-09T06:31:07.946Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W_vx1cmetMALxHBsoPJIeA.jpeg" /></figure><h3>Install Java 22 (22.0.1) on CentOS 9</h3><p>Java 22 brings new features and enhancements. If you’re looking to install Java 22 on CentOS 9, follow these steps.</p><h3>Step 1: Download Java 22</h3><p>First, download Java 22 from the official Oracle website or your preferred source. Make sure to choose the appropriate package for your CentOS 9 architecture (likely x64).</p><p>linux/centos 64 bit java gz download link below</p><p><a href="https://download.java.net/java/GA/jdk22.0.1/c7ec1332f7bb44aeba2eb341ae18aca4/8/GPL/openjdk-22.0.1_linux-x64_bin.tar.gz">https://download.java.net/java/GA/jdk22.0.1/c7ec1332f7bb44aeba2eb341ae18aca4/8/GPL/openjdk-22.0.1_linux-x64_bin.tar.gz</a></p><h3>Step 2: Install Java Development Kit (JDK)</h3><p>Once downloaded, follow these steps to install Java:</p><p><strong>Extract the Package:</strong></p><p>Use tar to extract the downloaded package. Navigate to your download directory and run:</p><ul><li>sudo tar -xvf jdk-22.0.1_linux-x64_bin.tar.gz -C /opt</li><li>This command extracts the JDK into the /opt directory.</li></ul><p><strong>Set Java Environment Variables:</strong></p><ol><li>Next, set the environment variables by editing /etc/profile or creating a new configuration file in /etc/profile.d/ (e.g., java.sh):</li><li>Add the following lines to set JAVA_HOME and update PATH:</li></ol><ul><li>export JAVA_HOME=/opt/jdk-22.0.1 export PATH=$JAVA_HOME/bin:$PATH</li></ul><p><strong>Verify Installation:</strong></p><ol><li>Check if Java is correctly installed by running:</li></ol><pre>java -version</pre><p>You should see the version of Java 22 displayed.</p><h3>Step 3: Configure Java Alternatives (Optional)</h3><p>If you have multiple versions of Java installed, use update-alternatives to configure which version is used by default:</p><pre>sudo update-alternatives --install /usr/bin/java java /opt/jdk-22/bin/java 100<br>sudo update-alternatives --config java</pre><p>Select Java 22 from the list if prompted.</p><h3>Step 4: Test Java Installation</h3><p>To verify that Java is working correctly, run a simple Java program:</p><p>Create a file HelloWorld.java:</p><pre>public class HelloWorld { <br>    public static void main(String[] args) {     <br>    System.out.println(&quot;Hello, Java 22!&quot;);     <br>  } <br>}</pre><p>Compile and run the program:</p><ul><li>javac HelloWorld.java</li><li>java HelloWorld</li></ul><p>If you see Hello, Java 22! printed to the console, Java 22 is successfully installed and configured on your CentOS 9 system.</p><h3>Conclusion</h3><p>You’ve successfully installed Java 22 on CentOS 9! Now you can take advantage of the latest features and improvements in Java for your development projects.</p><p>For more detailed information and advanced configurations, refer to the <a href="https://docs.oracle.com/en/java/">Java Documentation</a>.</p><p>This guide provides a straightforward approach to installing Java 22 on CentOS 9. Enjoy using the latest Java features in your projects!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76a4d6cc5cd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Apache Superset on Centos 9]]></title>
            <link>https://devtroid.medium.com/installing-apache-superset-on-centos-9-82b7618d35d8?source=rss-ba8629553a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/82b7618d35d8</guid>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[superset]]></category>
            <category><![CDATA[apache]]></category>
            <dc:creator><![CDATA[DevTroid]]></dc:creator>
            <pubDate>Tue, 09 Jul 2024 06:02:07 GMT</pubDate>
            <atom:updated>2024-07-09T06:07:00.855Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4WjU09w3_TFFshv4r0ok7Q.jpeg" /></figure><h3>How to Install Apache Superset on CentOS 9</h3><p>Apache Superset is an open-source data exploration and visualization platform. This guide will walk you through installing Apache Superset on CentOS 9.</p><h3>Prerequisites</h3><p>Before you begin, make sure you have:</p><ul><li><strong>CentOS 9</strong> installed (64-bit)</li><li><strong>Python 3.11</strong> or higher</li></ul><h3>Step 1: Install Apache Superset and Dependencies</h3><p>First, let’s install Python development headers and necessary packages:</p><pre>sudo yum install python3-devel</pre><p>Next, upgrade pip and setuptools:</p><pre>pip install --upgrade pip setuptools</pre><p>Install Apache Superset and its dependencies:</p><pre>pip install teradatasqlalchemy sqlalchemy-trino apache-superset</pre><h3>Step 2: Create superset_config.py</h3><p>Now, create a configuration file named superset_config.py in your chosen directory. Here&#39;s a basic example configuration:</p><pre># Example superset_config.py</pre><pre># Superset home directory<br>SUPERSET_HOME = &#39;/&#39;</pre><pre># Maximum rows returned by queries<br>ROW_LIMIT = 5000</pre><pre># SQLAlchemy connection string to Superset metadata database<br>SQLALCHEMY_DATABASE_URI = &#39;postgresql+psycopg2://postgres:postgres@localhost:5432/postgres&#39;</pre><pre># Flask-WTF CSRF protection<br>WTF_CSRF_ENABLED = True<br>WTF_CSRF_EXEMPT_LIST = []</pre><pre># Secret key for Flask session cookies<br>SECRET_KEY = &#39;thisISaSECRET_1234&#39;</pre><pre># Log level<br>LOG_LEVEL = &#39;DEBUG&#39;</pre><pre># Feature flags<br>FEATURE_FLAGS = {<br>    &#39;DASHBOARD_NATIVE_FILTERS&#39;: True,<br>}</pre><p>Customize SQLALCHEMY_DATABASE_URI based on your database setup.</p><h3>Step 3: Set Environment Variables</h3><p>Set the environment variables needed for Superset:</p><pre>export FLASK_APP=superset<br>export SUPERSET_CONFIG_PATH=/superset_config.py</pre><h3>Step 4: Initialize and Upgrade Database</h3><p>Initialize and upgrade Superset’s metadata database:</p><pre>superset db upgrade</pre><p>Create an admin user for Superset:</p><pre>superset fab create-admin --username admin --firstname Admin --lastname User --email admin@example.com --password admin</pre><p>Initialize Superset:</p><pre>superset init</pre><h3>Step 5: Start Superset Server</h3><p>Run the Superset web server:</p><pre>superset run -h localhost -p 8088 --with-threads --reload --debugger</pre><h3>Step 6: Access Superset</h3><p>Open your web browser and go to <a href="http://localhost:8088/">http://localhost:8088</a> to access Apache Superset.</p><h3>Conclusion</h3><p>You’ve successfully installed Apache Superset on CentOS 9! Apache Superset offers a robust interface for data exploration and visualization, allowing you to create insightful dashboards and analyze data effectively.</p><p>For more detailed information and advanced configurations, check out the <a href="https://superset.apache.org/docs/installation/installing-superset-from-scratch">Apache Superset Documentation</a>.</p><p>This guide provides a straightforward approach to setting up Apache Superset on CentOS 9. Start exploring your data with Apache Superset and unleash its powerful features!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82b7618d35d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Word2vec Defined]]></title>
            <link>https://devtroid.medium.com/word2vec-defined-471f900be9b2?source=rss-ba8629553a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/471f900be9b2</guid>
            <dc:creator><![CDATA[DevTroid]]></dc:creator>
            <pubDate>Thu, 30 Dec 2021 06:00:52 GMT</pubDate>
            <atom:updated>2022-01-08T05:29:04.810Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cdxoKBw6R7Mi75hW.jpeg" /></figure><h3>Word2vec</h3><h3>Introduction</h3><p>Word2vec (word to vector), as the name suggests, is a tool that converts words into vector form.</p><p>In all technicalities, Word2vec is a shallow two-layered neural network, that is used to produce the relative model of word embedding. It works by collecting a large number of vocabulary based datasets as input and outputs a vector space, such that each word in the dictionary maps itself to a unique vector. This allows us to represent the relationship between words.</p><p>Broadly, there are two models CBOW(Continuous Bag of Words) and Skip-Gram. Both neural network architectures essentially help the network learn how to represent a word. This is unsupervised machine learning, and labels are needed to train the model. Either of these two models, can create the labels for the given input and prepare the neural network to train the model and perform the desired task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/41/0*CbttcJsqZteVo2Kf" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/0*NzKuH7ciooiQUDYx" /></figure><p>The difference in architecture between CBOW &amp; Skip-gram models</p><h3>Skip Gram</h3><p>Suppose we have 10000 unique words, and we represent an input word like “ape” as a one-hot vector(A categorical word/variable can be better understood by an ML algorithm when it is one hot encoded to 0’s and 1&#39;s). This vector will have 10000 components; each component contains one vocabulary. And we place ‘1&quot; in one position, which represents the word “ape” and place 0 in the rest of the positions.</p><p>The output of the network is a single vector with 10000 components as well. The probability that a randomly selected nearby word is that vocabulary word. We don’t need to consider the hidden layer neurons since none of them are active. However, the output neurons use softmax.</p><p>When we evaluate the trained network on an input word, the output is a probability distribution instead of a one-hot vector.</p><p><strong>The Hidden Layer</strong></p><p>For example, we use a word vector with 300 features as the input. So the hidden layer should be a 300*10000 matrix, which means there are 10000 rows for words in vocabulary and 300 columns for hidden neurons.</p><p>The one-hot vector we use as input is used to pick out the corresponding row in the matrix. This means that the hidden layers are only used as a lookup table. And the output of the hidden layer is just the word vector for the input word.</p><p><strong>The Output Layer</strong></p><p>As we pick up the word vector for “ape” in the hidden layers, it will be sent to the output layer. The output layer is a softmax regression classifier.</p><p>So what is the softmax regression classifier? Softmax regression is a generalization of logistic regression that we can use for multi-class classification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*_sgy-JpQ8-gHf0TK.png" /></figure><h3>CBOW</h3><p>CBOW(continuous bag-of-words) is a model suitable for work with smaller databases, and it does not need much RAM requirement either. In CBOW, we predict a word given its context. The entire vocabulary is used to create a “Bag of Words” model before proceeding to the next task.</p><p>The bag of words model is a simple representation of words that disregards grammar.</p><p>Here is an example for better understanding.</p><p><em>John likes to watch movies. Mary likes movies too.</em></p><p><em>Mary also likes to watch football games.</em></p><p>A list of words is created by breaking the two sentences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/41/0*BMH00kHTydXyc6lf" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/0*VVIEdmVtTHzCIe9y" /></figure><p>We then label each word with the number of occurrences. This is called a bag of words. In computers, this is usually captured as a JSON file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/41/0*kxVzwbLphsZbM0QM" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/0*Llcw9RdKcsH7G5h8" /></figure><p>The sentences are then combined to get the overall frequency of each unique word.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/41/0*jqNKo8cUV8XHzQRd" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/0*Bol95NXNF8Rg3cK-" /></figure><p>Now that the bag of words model is ready, we can use CBOW to predict the probability of a word given these groups of words.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/34/0*uv_Er2npK1hEgipp" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/0*ufAGOkkFH75kCw72.png" /></figure><p>CBOW model to predict probabilities of words</p><p>Each word and its frequency are passed as a unique vector into the input layer of the neural network. Say, if we have X words, the input layer takes in X[1XV] vectors and gives out 1[1XV] in the output layer.</p><p>The input-hidden layer matrix sizes up to [VXN] and the output-hidden layer matrix sizes to [NXV]. In this case, N is the number of dimensions. The layers have no activation function between them.</p><p>To calculate the output, the hidden input layers’ weights are multiplied by the hidden output layers weights. The error between the output and targets is calculated, and the weights are constantly readjusted through backpropagation. The only non-linearity is the softmax calculations in the output layer to generate probabilities for the word vectors.</p><p>Overall, after calculations and readjustments, the weight between the hidden-output layer is taken as the word vector representation. As we can see, this architecture allows the model to predict the current word relying on influence from surrounding words.</p><h3>Differences between CBOW and Skip-Gram</h3><p>Although the two models show mirror symmetry, they vary in terms of architecture and performance.</p><ol><li>The Skip-Gram model predicts words surrounding a certain word by relying on the contextual similarity of words. On the other hand, the CBOW model uses the Bag of words approach and predicts a word using the words that surround it.</li><li>The Skip-Gram model is more accurate when it comes to infrequent words. It suits larger databases and requires more RAM to function. The CBOW model is faster, does not guarantee the handling of infrequent words, requires less RAM, and suits smaller databases.</li></ol><p>The choice of model depends on the user’s task.</p><h3>Code tutorial</h3><p>We are using word2vec by genism . We use Retail data set. This code use word2vec model to find out familiar word for a specific word.</p><pre>import pandas as pd<br>import numpy as np<br>import random<br>from gensim.models import Word2Vec</pre><pre>df = pd.read_csv(&#39;OnlineRetail.csv&#39;)</pre><pre>purchases_train = []</pre><pre>for i in customers_train:<br>    temp = train_df[train_df[&quot;CustomerID&quot;] == i][&quot;StockCode&quot;].tolist()<br>    purchases_train.append(temp)</pre><pre># train word2vec model<br>model = Word2Vec(window = 2, sg = 1, hs = 0,<br>                 negative = 10, # for negative sampling<br>                 alpha=0.03, min_alpha=0.0007,<br>                 seed = 14)</pre><pre>model.build_vocab(purchases_train, progress_per=200)</pre><pre>model.train(purchases_train, total_examples = model.corpus_count, <br>            epochs=10, report_delay=1)</pre><pre>def similar_products(v, n = 4):<br>    <br>    # extract most similar products for the input vector<br>    ms = model.similar_by_vector(v, topn= n+1)[1:]<br>    <br>    # extract name and similarity score of the similar products<br>    new_ms = []<br>    for j in ms:<br>        pair = (products_dict[j[0]][0], j[1])<br>        new_ms.append(pair)<br>        <br>    return new_ms<br>similar_products(model[&#39;82482&#39;])   <br>#WOODEN PICTURE FRAME WHITE FINISH</pre><p>The output is:</p><pre>[(&#39;WOOD S/3 CABINET ANT WHITE FINISH&#39;, 0.9902486205101013),<br> (&#39;WOOD 2 DRAWER CABINET WHITE FINISH&#39;, 0.9844652414321899),<br> (&#39;WOODEN FRAME ANTIQUE WHITE &#39;, 0.9791655540466309),<br> (&#39;VINTAGE BILLBOARD LOVE/HATE MUG&#39;, 0.9734472036361694)]</pre><p>These sentences are similar compared to “Wooden picture frame white finish”</p><p><strong>Recommend System</strong></p><p>Recommend System is based on the past purchases user had made.</p><pre>def recommend_system(products):<br>    product_vec = []<br>    for i in products:<br>        try:<br>            product_vec.append(model[i])<br>        except KeyError:<br>            continue<br>    print(np.mean(product_vec, axis=0))    <br>    return np.mean(product_vec, axis=0)</pre><p>Output for Recommend System</p><pre>[(&#39;PAPER BUNTING WHITE LACE&#39;, 0.999230682849884),<br> (&#39;CHARLIE + LOLA RED HOT WATER BOTTLE&#39;, 0.9992085695266724),<br> (&#39;CHARLIE+LOLA PINK HOT WATER BOTTLE&#39;, 0.9992051124572754),<br> (&#39;TOTE BAG I LOVE LONDON&#39;, 0.9991719722747803)]</pre><p>In the above blog post, we introduced and explained commonly-used word embedding techniques Word2vec. This method includes an introduction, diagram, implementation, and elaboration with code on a real-world dataset. Word Embedding is the foundation of any major text analysis task, and we hope to have done justice to this topic by covering it in-depth.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=471f900be9b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Emergence of Decentralized Artificial Intelligence]]></title>
            <link>https://devtroid.medium.com/the-emergence-of-decentralized-artificial-intelligence-8dc41c375b6d?source=rss-ba8629553a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dc41c375b6d</guid>
            <dc:creator><![CDATA[DevTroid]]></dc:creator>
            <pubDate>Tue, 18 May 2021 07:07:09 GMT</pubDate>
            <atom:updated>2021-05-21T13:09:48.517Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Decentralized Artificial Intelligence</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YN9-i3zGmVlQJJrBwOAxPw.jpeg" /></figure><p>If we look today everything is centralized and limited to particular owner of that entity like Facebook, Amazon, Wikipedia, WhatsApp, YouTube etc. Like they solve problem or challenges using their own dataset/approach, they don’t actually look for generating common solution for societies problems. This had lead to emergence of centralized solutions, these websites come up with innovative ideas and become more powerful platforms because of services they provide. Like for example now a days WhatsApp has updated its privacy policy which tends to have all the personal data of user which is indirectly helping them in generating advertisements or some references of products by using textual analysis or some neural networks due to which users sees such advertisements/product references on their social media and which urge them to buy that product. So in this way only such companies have emerged as robust centralized platforms. They have also emerged as centralized server where in all the data come in and goes out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*rS9mMkV_FghQYFo0o3i-ug.jpeg" /><figcaption>Tech Giants using Centralized Artificial Intelligence</figcaption></figure><p>So, for the magnification of the future of Artificial intelligence we have to focus more on collaboration. Here collaboration relies on finding domain, group of people who are willing to share their knowledge to solve a complex society problem but which leads to risk of centralized solution-oriented organizations.</p><blockquote><strong>Benefits of Centralized Artificial Intelligence:</strong></blockquote><p>Let’s see how these Centralized Artificial Intelligence systems exploit the huge datasets they gather for their benefit. As of now all AI solutions are centralized which involve a risk for companies that implement them, but some of the benefits they get from them are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*pEavS1Wt7gF_ckG-Ag5yrA.jpeg" /><figcaption>Illustration of Facebook as a centralized social platform. Image source: Stratechery</figcaption></figure><blockquote><strong>The Rich Get Richer: <br></strong>· Many of the AI solutions in the market are provided by tech giants that control the huge datasets. These datasets keep increasing constantly as their dominance in public is more and hence more the data they accumulate, the more datasets they produce.</blockquote><blockquote><strong>Dataset Owners Influence Populations:<br></strong>· Centralized AI systems can influence populations and direct knowledge based on their willing. Most common scenarios include asking for location, asking for personal information in order to get tailored and the best suggestions for them.</blockquote><p>To overcome these benefits of only Centralized Artificial Intelligence we must focus on decentralized Artificial Intelligence</p><h3>The Decentralized Artificial Intelligence System</h3><p>Decentralized Artificial Intelligence is a way to bring innovative ideas, datasets based on intelligence to solve set of complex problems. This decentralized Intelligence model will provide opportunity to large entities / companies that control these huge datasets to be independent and will also expedite the upcoming affluential companies help make new innovations grow.</p><p><strong>Let’s now see the comparison between Centralized and Decentralized Artificially Intelligent models:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*xVAXGDvIymC3BsuZXbOPMg.png" /><figcaption>left: Fig (a) || right: Fig (b)</figcaption></figure><p>In (Fig(a)) above, all AI model development work is controlled by central authority(X). Let us assume that Model A is used for clarifying images containing text and model B is character recognition tool which generates machine encoded text, while Model C translate this encoded text from one language to another and Model D is the actual text to speech tool which will process machine encoded text to particular language and read it out, but in this case if a noisy image is being passed to the centralized model then this model will not work properly and yield correct results and also the data required for this model we will have to be follow sequential steps from model to model for proper execution, whereas in decentralized model as show in Fig(b) all the model development is done independently and is not controlled by some entity where in all the models work independently of each other. So, if a noisy image is passed to Model D of Fig(b) and since the input cannot be process by Model D same as the centralized model, then in decentralized routine the Model D will request the Model B to process the noisy image and send the machine encoded text, but then what if the Model B finds the text not clear same scenario as in centralized model? In this scenario, Model B will then send it to respective Model available with the capability of handling noisy images better for clarification and similarly extract the machine encoded text and later send it to text-to-speech model. So here we do not have the requirement to follow sequential procedure, rather we can allow the new start-ups to help us better the solution.</p><p>As demonstrated by above example, we can get a glimpse that decentralized Artificially Intelligent model helps the bigger entities / companies to embed their models / datasets into single architecture and work with the upcoming affluential companies to find the best solution possible and solve various complex problems.</p><p><strong>Conclusion / Findings</strong></p><p>Ultimately, decentralized Artificial Intelligence will provide a hierarchy of achievement that is created through the advancement of knowledge. At the root of this achievement is individualized collaboration. An application of which is already being implemented known as Synapse AI. Synapse AI provides a machine learning marketplace and exchange. This marketplace allows developers to contribute data, train machine learning models, and be compensated for both. When disparate parts come together to share their findings, new or consistent understandings can be presented to help overcome challenges and, thus, unlocking decentralized AI’s true potential.Thus according to my opinion both the structured models are good but if we want to solve major complex problem quickly and easily we should work towards the decentralized artificial intelligence.</p><blockquote>Contributors:</blockquote><blockquote>Shubham M. | Abrar M.<br>Aditya N. | Ayush R. <br>Muzamil R.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dc41c375b6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Belief Propagation Algorithm]]></title>
            <link>https://devtroid.medium.com/belief-propagation-algorithm-97774ae77930?source=rss-ba8629553a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/97774ae77930</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[DevTroid]]></dc:creator>
            <pubDate>Wed, 25 Nov 2020 10:59:38 GMT</pubDate>
            <atom:updated>2021-05-18T07:09:31.918Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Belief Propagation Algorithm</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YN9-i3zGmVlQJJrBwOAxPw.jpeg" /></figure><p>Belief Propagation Algorithm was proposed by Judea Pearl in 1982 to formulate it as an exact inference algorithm on trees and polytrees.</p><p>This Algorithm is also known as message passing algorithm or sum-product algorithm which is mainly used to perform inference or to derive conclusion from graphical model i.e (Directed Acyclic Graph).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/0*Uywf9yLwkKqA7EN3.PNG" /><figcaption>Fig 1</figcaption></figure><blockquote><strong>Where and how it is Used ?</strong></blockquote><p>It is mostly used in Bayesian Network,Markov Random Fields,low density parity checking,turbo codes etc</p><p>Let us see how it is used in Bayesian Belief Networks</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/0*J39MhaS37MpynOnP.png" /><figcaption>Fig 2</figcaption></figure><blockquote><strong>Bayesian Belief Network <br></strong>· Bayesian Belief Network is a graphical model that represents the conditional dependencies between the nodes.</blockquote><p>· In the above graph stated the nodes represent the variables which can be discrete and edges represent casual relationship.</p><p>· Belief Propagation allows the variable to talk with each other and exchange information between them.</p><blockquote>· <strong>In the above example Belief Propagation helps us to</strong></blockquote><p>Predict the umbrella sale depending upon the weather</p><p>Similarly BPA can also be used to show the probability of green leave is high when there is high probability of rainy season</p><p>Predicting health depending upon weather</p><blockquote>· <strong>Belief Propagation Algorithm uses 2 types of probabilities in Bayesian Networks</strong></blockquote><p>Joint Probability</p><p>Conditional Probability</p><p>P(x1,x2,x3……xn)=P(xi|Parent(xi))</p><p>Let’s Elaborate the below example using Belief Propagation Algorithm using joint and conditional probability</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/0*_Af_67ri-XlXaivt.png" /><figcaption>Fig 3</figcaption></figure><p>In the above example BP uses the following Properties.</p><p>· <strong>Likelihood function</strong>: It holds the information about the observation of children,eg the likelihood of wetgrass having high probability is when there is rain.We can say this function is product of all incoming messages.</p><p>· <strong>Priors</strong>: These includes the probabilities of events which are already known to the user or given.This function sums up all possible combinations of parent values times the product of respective incoming messages.</p><p>· <strong>Belief</strong>: This function takes the probabilities that are known and generate new belief from them.</p><p>P(x1,x2,x3……xn)=P(xi|Parent(xi))</p><p>Suppose if we have to find the probability of wet grass it can be achieved using the properties mentioned above</p><p>P(W)=P(W|R) * P(R) + P(W|R’) * P(R’)</p><p>Thus the certainity and uncertainity of the random variables can be made out using Belief Propagation Algorithm in Bayesian Networks</p><blockquote>Contributors:</blockquote><blockquote>Shubham M. | Abrar M.</blockquote><blockquote>Aditya N. | Ayush R.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97774ae77930" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>