<?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 Gahano on Medium]]></title>
        <description><![CDATA[Stories by Gahano on Medium]]></description>
        <link>https://medium.com/@rajagenupula?source=rss-a8f61068a924------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*rRbYj0PbfYTSs17u.</url>
            <title>Stories by Gahano on Medium</title>
            <link>https://medium.com/@rajagenupula?source=rss-a8f61068a924------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 21:36:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajagenupula/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[Ansible: local playbook execution]]></title>
            <link>https://medium.com/@rajagenupula/ansible-local-playbook-execution-e1ae060c2e42?source=rss-a8f61068a924------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1ae060c2e42</guid>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[ansible-playbook]]></category>
            <category><![CDATA[ansible-tutorial]]></category>
            <dc:creator><![CDATA[Gahano]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 02:03:55 GMT</pubDate>
            <atom:updated>2025-04-14T02:05:16.033Z</atom:updated>
            <content:encoded><![CDATA[<p>..Before all this, make you have installed ansible. most of the package managers have ansible available. apt install ansible dnf install ansible brew install ansible all works.</p><p>Create a directory for your playbooks. My intent is to have a bootstrap playbook, I am a distro hopper, the longest OS I stayed with Debian, apart from that, I tried with Endeavour, Arch, Fedora and FreeBSD then back to Debian. I don’t know but felt good here. My idle RAM usage is &lt; 700 MB.</p><p>So every time I switch between a new OS, I have to do basic setup. Instead I want to keep a playbook which does things for me, similar to nix.</p><p>We need local execution of ansible here.</p><p>You need to edit couple of files</p><pre>raja@laptop:/kd/init_setup$ ls -la<br>total 24<br>drwxr-xr-x  2 raja raja 4096 Apr 14 07:16 .<br>drwxr-xr-x 10 raja raja 4096 Apr 11 21:59 ..<br>-rw-r--r--  1 raja raja   29 Apr 14 07:08 .ansible.cfg<br>-rw-r--r--  1 raja raja   35 Apr 14 07:08 inventory<br>-rw-r--r--  1 raja raja   70 Apr 14 07:16 launch.sh<br>-rw-r--r--  1 raja raja  243 Apr 14 07:16 playbook.yaml<br>raja@laptop:/kd/init_setup$</pre><pre>raja@laptop:/kd/init_setup$ cat .ansible.cfg <br>[defaults]<br>transport = local<br><br>raja@laptop:/kd/init_setup$ cat inventory <br>127.0.0.1 ansible_connection=local<br><br>raja@laptop:/kd/init_setup$ cat playbook.yaml <br>---<br>- hosts: 127.0.0.1<br>  connection: local<br>  become: Yes<br>  become_method: sudo<br><br>  tasks:<br>    - name: install basic packages<br>      ansible.builtin.package:<br>        name:<br>          - apache2<br>          - vim<br>          - git<br>          - vagrant<br><br><br>raja@laptop:/kd/init_setup$ cat launch.sh <br>ansible-playbook --connection=local --ask-become-pass ./playbook.yaml<br></pre><p>With this, all I had to bash launch.sh</p><p>You can also extend this, you can create ansible custom role use it where ever required.</p><p>But yeah, simple is good.</p><p>Hope it helps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1ae060c2e42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is shebang in Shell Scripting?]]></title>
            <link>https://medium.com/@rajagenupula/what-is-shebang-in-shell-scripting-9bd907065a3a?source=rss-a8f61068a924------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bd907065a3a</guid>
            <category><![CDATA[shell-script]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[shebang]]></category>
            <dc:creator><![CDATA[Gahano]]></dc:creator>
            <pubDate>Mon, 18 Mar 2024 22:16:45 GMT</pubDate>
            <atom:updated>2024-03-18T22:16:45.919Z</atom:updated>
            <content:encoded><![CDATA[<p>Shebang saves you some effort with typing only filename to execute it in its specified interpreter. For example, create a file with print(&quot;Hello World&quot;) in it to execute it with Python as below</p><pre>root@026ce6ca5997:/scripts# cat hello_in_python.py<br>print(&quot;Hello World&quot;)</pre><p>Now, to execute this, you obviously need to use the python binary before it like</p><pre>root@026ce6ca5997:/scripts# python3 hello_in_python.py<br>Hello World</pre><p>but using shebang, you can do it more quickly, at the beginning of the script/file mention the target interpreter</p><pre>#!/usr/bin/python3<br>print(&quot;Hello World&quot;)</pre><p>Then make it executable and run</p><pre>root@026ce6ca5997:/scripts# chmod +x hello_in_python.py<br>root@026ce6ca5997:/scripts# ./hello_in_python.py<br>Hello World</pre><p>You dont have to tell which is the interpreter anymore everytime you call this. This is good approach when you want to keep all your utils at a single place and you dont have to append which language it was made of. You can use this with Ruby, perl etc.</p><pre>root@026ce6ca5997:/scripts# cat hello.rb<br>#!/usr/bin/env ruby<br>puts &quot;You can also use env and mention your interpreter location or binary name&quot;<br>puts &quot;add shebang, make it executable&quot;<br>puts &quot;and call it directly&quot;<br>root@026ce6ca5997:/scripts#<br><br>root@026ce6ca5997:/scripts# chmod +x hello.rb<br>root@026ce6ca5997:/scripts# ./hello.rb<br>You can also use env and mention your interpreter location or binary name<br>add shebang, make it executable<br>and call it directly</pre><p>Shebang is very basic in shell scripts, though I am not writing much shell scripting these days, you can still use this for any programming languages if you are an admin/devops engineer who writes lot of system utils.</p><p>Hope it helps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bd907065a3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to know which profile your shell uses ?]]></title>
            <link>https://medium.com/@rajagenupula/how-to-know-which-profile-your-shell-uses-1fa5bcf96780?source=rss-a8f61068a924------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fa5bcf96780</guid>
            <dc:creator><![CDATA[Gahano]]></dc:creator>
            <pubDate>Mon, 18 Mar 2024 21:57:28 GMT</pubDate>
            <atom:updated>2024-03-18T21:57:28.427Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to know which .profile your shell uses ?</h3><p>In shell scripting we have so many profile files which our current shell refers while loading the terminal.</p><p>In future or even now, if you come across any question like is there any canonical way to determine what is the source file, then simply follow this trick.</p><p>We know that the profile files as .bashrc, .bash_profile , .profile and if you are using ZSH then it will .zshrc. In most of the linux operating systems BASH is the default shell and .bashrc is the shell preferred source to load the shell.</p><p>I know this looks stupid, but this is a good hack, simply add a line in each file like I am .bashrc or I am .bash_profile like in each file with its filename.</p><p>Launch the shell again, and it will print you the source automatically.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fa5bcf96780" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fix Bluetooth Headset Voice Chop in Linux]]></title>
            <link>https://medium.com/@rajagenupula/fix-bluetooth-headset-voice-chop-in-linux-30c008e34f7e?source=rss-a8f61068a924------2</link>
            <guid isPermaLink="false">https://medium.com/p/30c008e34f7e</guid>
            <category><![CDATA[bluetooth]]></category>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Gahano]]></dc:creator>
            <pubDate>Sun, 17 Mar 2024 07:41:06 GMT</pubDate>
            <atom:updated>2024-03-17T07:41:06.649Z</atom:updated>
            <content:encoded><![CDATA[<p>I am using Debian bookworm as my daily driver. As I connected my Sony Bluetooth headset, the voice started chopping or skipping the continuity. Upon searching/googling came across this fix via stackoverflow. In simple words, I need to increase buffer interval from 0 to 50ms and the audio will be buffered a bit early to avoid this lagging.</p><p>Find out your bluetooth MAC and respective probe name via which the output coming out of your bluetooth headset. In my case</p><pre><br>$ ppactl list | grep -Pzo ‘.*bluez_card(.*\n)*’<br> Name: bluez_card.90_7A_58_D3_D9_00<br> Driver: module-bluez5-device.c<br> Owner Module: 24<br> Properties:<br> device.description = “WH-XB910N”<br> device.string = “90:7A:58:D3:D9:00”<br> bluetooth.battery = “60%”<br> Profiles:<br> handsfree_head_unit: Handsfree Head Unit (HFP) (sinks: 1, sources: 1, priority: 30, available: yes)<br> a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 40, available: yes)<br> off: Off (sinks: 0, sources: 0, priority: 0, available: yes)<br> Active Profile: a2dp_sink<br> Ports:<br> headset-output: Headset (type: Headset, priority: 0, latency offset: 0 usec, availability unknown)<br> Part of profile(s): handsfree_head_unit, a2dp_sink<br> headset-input: Headset (type: Headset, priority: 0, latency offset: 0 usec, availability unknown)<br> Part of profile(s): handsfree_head_unit<br>```</pre><p>So we are interested in <strong>Name</strong> and <strong>headset-output</strong> . Then execute below command</p><pre><br>$ pactl set-port-latency-offset bluez_card.90_7A_58_D3_D9_00 headset-output 50000 <br>$ sudo systemctl restart bluetooth<br>```</pre><p>Hope it helps.<br>Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30c008e34f7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka — How you should design.]]></title>
            <link>https://medium.com/@rajagenupula/kafka-how-you-should-design-815db7e20285?source=rss-a8f61068a924------2</link>
            <guid isPermaLink="false">https://medium.com/p/815db7e20285</guid>
            <category><![CDATA[kafka]]></category>
            <dc:creator><![CDATA[Gahano]]></dc:creator>
            <pubDate>Mon, 11 Mar 2024 07:11:43 GMT</pubDate>
            <atom:updated>2024-03-11T07:11:43.840Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kafka — How you should design.</h3><p>This article focus on how we want to process our data.</p><p><em>Are we fine with losing any messages ?</em></p><ul><li>If our message/events are payment requests then its a strictly no.</li><li>if our messages are about an alert/event that diskspace is crossing 75%, then may be yes, even we lose this event, no big harm.</li><li>So can we risk losing the data ? depends upon how much important they are.</li><li>If you have scheduling mechanism, example like sending events alerts from sensors, IoT devices for every 5 sec, then losing data is fine, because you would get the next event in 5 sec anyway.</li></ul><p><em>Do we need to group the data in anyway ?</em></p><ul><li>This is tricky one, but in simple terms, is there any correlation between the events ? So by processing these events in group, we can get more clarity ? then yes we need to group them while processing.</li><li>If all the events you generate are completely random and they dont draw any meaning/pattern even you group them, then we dont need to group the messages.</li><li>We can include a key in the messages/events and we can use that to group the messages.</li><li>If you are dealing with a monitoring system, then you can group the alerts by adding a field like priority.</li></ul><p><em>Consumers should get the data in the same order ?</em></p><ul><li>Do we need order of the messages/events ? Yes it is important if we are dealing with payment transactions or processing transactions of an e-commerce application. You cant cancel-order if there order itself not yet processed unless your consumer end applications added that error handling.</li><li>For example you are processing RSS Feed from all your subscriptions, here you dont need order.</li></ul><p><em>Is history / old messages/events are matter to you ?</em></p><ul><li>in simple words, do you want to retain the events to track their changes like an audit.</li><li>For example, a customer has balance of 100 USD and later another deposit request came with 10USD, do you want to know when did you received that 10 USD Txs ?</li></ul><p><em>How many consumers ?</em></p><ul><li>How your consumers placed ? all are independent or is it like a row of consumers, how will read the events one after another ?</li><li>Because consumers need to received/read the data and this need to managed because you do need to handle the read load at the consumer end.</li></ul><p>This is not a completed end-end list, but a good start on planning. I will update this article soon with more information.</p><p>Hope it helps.</p><p>Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=815db7e20285" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka — Using SQL Connector to read Data from Database]]></title>
            <link>https://medium.com/@rajagenupula/kafka-using-sql-connector-to-read-data-from-database-a01653cee7e5?source=rss-a8f61068a924------2</link>
            <guid isPermaLink="false">https://medium.com/p/a01653cee7e5</guid>
            <category><![CDATA[kafka-consumer]]></category>
            <category><![CDATA[kafka-producer]]></category>
            <category><![CDATA[kafka-connect]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[sqlite]]></category>
            <dc:creator><![CDATA[Gahano]]></dc:creator>
            <pubDate>Sun, 10 Mar 2024 02:07:21 GMT</pubDate>
            <atom:updated>2024-03-10T02:07:21.907Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kafka — Using SQL Connector to read Data from Database</h3><p>After my first post on Kafka, with terminology and a simple example of producer and consumer, in this article, I am sharing the way to read the data from database and sharing that to consumer via kafka.</p><p>As usual, most of the commands are self explantory, I added text where it matters, and tried to keep this article as a completely practical approach.</p><h3>Install Confluent CLI</h3><pre>sudo apt-get install gnupg2 software-properties-common<br>wget -qO - https://packages.confluent.io/confluent-cli/deb/archive.key | sudo apt-key add<br>sudo add-apt-repository &quot;deb https://packages.confluent.io/confluent-cli/deb stable main&quot;<br>sudo apt install confluent-cli</pre><h3>Install Confluent Community version</h3><pre>curl -O https://packages.confluent.io/archive/7.6/confluent-community-7.6.0.tar.gz<br>tar -xvf confluent-community-7.6.0.tar.gz<br>echo &quot;export CONFLUENT_HOME=/home/qemu/confluent-7.6.0&quot; &gt;&gt; ~/.bashrc<br>echo &quot;export PATH=$PATH:/home/qemu/confluent-7.6.0/bin&quot; &gt;&gt; ~/.bashrc<br>exec $SHELL</pre><h3>Install conflunet hub</h3><p>if you choose platform, you dont need to install confluent-hub cli separately.</p><pre>wget http://client.hub.confluent.io/confluent-hub-client-latest.tar.gz<br>mkdir confluent-hub<br>cd confluent-hub<br>tar -xvf confluent-hub-client-latest.tar.gz<br>echo &quot;export PATH=$PATH:/home/qemu/confluent-hub/bin&quot; &gt;&gt; ~/.bashrc<br>exec $SHELL</pre><h3>Install Java</h3><pre>wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz<br>tar -xvf jdk-21_linux-x64_bin.tar.gz <br># add below lines in bashrc or zshrc<br>export JAVA_HOME=/home/qemu/jdk-21.0.2<br>export PATH=$PATH:$JAVA_HOME/bin<br># then reload your shell<br>exec $SHELL<br># verify java version<br>qemu@debian:~/jdk-21.0.2$ javac -version<br>javac 21.0.2<br>qemu@debian:~/jdk-21.0.2$ java -version<br>java version &quot;21.0.2&quot; 2024-01-16 LTS<br>Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58)<br>Java HotSpot(TM) 64-Bit Server VM (build 21.0.2+13-LTS-58, mixed mode, sharing)<br>qemu@debian:~/jdk-21.0.2$</pre><h3>Install SQL Connector</h3><pre>confluent-hub install confluentinc/kafka-connect-jdbc:10.7.5</pre><h3>Install Sqlite3 DB</h3><pre>sudo apt install sqlite3</pre><p>Insert rows</p><pre>qemu@debian:~$ sqlite3 kafkatest.db<br>SQLite version 3.40.1 2022-12-28 14:03:47<br>Enter &quot;.help&quot; for usage hints.<br>sqlite&gt; Create table invoices ( <br>   ...&gt; id INT primary KEY NOT NULL,<br>   ...&gt; title text NOT NULL,<br>   ...&gt; details CHAR(50),<br>   ...&gt; billedamt REAL,<br>   ...&gt; modified TIMESTAMP DEFAULT (STRFTIME(&#39;%s&#39;, &#39;now&#39;)) NOT NULL<br>   ...&gt; );<br>sqlite&gt; INSERT INTO invoices (id,title,details,billedamt)  VALUES (1, &#39;book&#39;, &#39;Franz Kafka&#39;, 500.00 );<br>sqlite&gt; select * from invoices;<br>1|book|Franz Kafka|500.0|1710033500<br>sqlite&gt; </pre><pre>qemu@debian:~$</pre><p>Path for kafkatest DB file: <strong>/home/qemu/kafkatest.db</strong></p><p>Connector setup</p><pre>mkdir -p $CONFLUENT_HOME/etc/kafka-connect-jdbc/<br>vim $CONFLUENT_HOME/etc/kafka-connect-jdbc/kafkatest-sqlite.properties<br># add below lines into file<br>name=kinaction-test-source-sqlite-jdbc-invoice<br>connector.class=io.confluent.connect.jdbc.JdbcSourceConnector<br>tasks.max=1<br>connection.url=jdbc:sqlite:/home/qemu/kafkatest.db<br>mode=incrementing<br>incrementing.column.name=id<br>topic.prefix=kinaction-test-sqlite-jdbc-</pre><h3>Start the local kafka setup</h3><pre>cofluent local services connect start <br># all services should be up like below<br>Using CONFLUENT_CURRENT: /tmp/confluent.973850<br>Starting ZooKeeper<br>ZooKeeper is [UP]<br>Starting Kafka<br>Kafka is [UP]<br>Starting Schema Registry<br>Schema Registry is [UP]<br>Starting Connect<br>Connect is [UP]</pre><p>Tell your cluster about your SQL Connector</p><pre>confluent local services connect connector config jdbc-source --config $CONFLUENT_HOME/etc/kafka-connect-jdbc/kafkatest-sqlite.properties</pre><p>Check the status</p><pre>qemu@debian:~$ confluent local services connect connector status<br>[<br>  &quot;jdbc-source&quot;<br>]</pre><pre>qemu@debian:~$ confluent local services connect connector status jdbc-source <br>The local commands are intended for a single-node development environment only, NOT for production usage. See more: <a href="https://docs.confluent.io/current/cli/index.html">https://docs.confluent.io/current/cli/index.html</a><br>As of Confluent Platform 8.0, Java 8 will no longer be supported.</pre><pre>{<br>  &quot;name&quot;: &quot;jdbc-source&quot;,<br>  &quot;connector&quot;: {<br>    &quot;state&quot;: &quot;RUNNING&quot;,<br>    &quot;worker_id&quot;: &quot;127.0.1.1:8083&quot;<br>  },<br>  &quot;tasks&quot;: [<br>    {<br>      &quot;id&quot;: 0,<br>      &quot;state&quot;: &quot;RUNNING&quot;,<br>      &quot;worker_id&quot;: &quot;127.0.1.1:8083&quot;<br>    }<br>  ],<br>  &quot;type&quot;: &quot;source&quot;<br>}</pre><p>Now the<strong> kafkatest.db</strong> will be our source and this SQL connector we just created will act as our producer, and send the data into kafka broker.</p><p>From the property file we mentioned, we have a prefix, so every row from a specific table can be read on a topic as <strong>prefix+tableName.</strong></p><p>For example, we have created table named ‘<strong>invoices</strong>’ and our prefix in the config is as ‘<strong>kinaction-test-sqlite-jdbc-’</strong>, then we should watch over the topic <strong>‘kinaction-test-sqlite-jdbc-invoices’.</strong></p><p>So lets use the consumer to read the messages/events which are actually rows of the table</p><pre>qemu@debian:~$ kafka-avro-console-consumer --topic kinaction-test-sqlite-jdbc-invoices --bootstrap-server localhost:9092  --from-beginning<br>[2024-03-10 06:56:08,349] INFO KafkaAvroDeserializerConfig values: <br>	auto.register.schemas = true<br>	..... TRUNCATING FEW ROWS ........<br>	schema.registry.url = [http://localhost:8081]<br>  value.subject.name.strategy = class io.confluent.kafka.serializers.subject.TopicNameStrategy<br> (io.confluent.kafka.serializers.KafkaAvroDeserializerConfig:370)<br>{&quot;id&quot;:1,&quot;title&quot;:&quot;book&quot;,&quot;details&quot;:{&quot;string&quot;:&quot;Franz Kafka&quot;},&quot;billedamt&quot;:{&quot;float&quot;:500.0},&quot;modified&quot;:1710033500}<br>{&quot;id&quot;:2,&quot;title&quot;:&quot;book&quot;,&quot;details&quot;:{&quot;string&quot;:&quot;Franz Kafkav2&quot;},&quot;billedamt&quot;:{&quot;float&quot;:500.0},&quot;modified&quot;:1710034085}<br>^CProcessed a total of 2 messages<br>qemu@debian:~$</pre><p>Once you started the consumer, lets get into the sqlite console and insert another row into invoices table</p><pre>qemu@debian:~$ sqlite3 kafkatest.db <br>SQLite version 3.40.1 2022-12-28 14:03:47<br>Enter &quot;.help&quot; for usage hints.<br>sqlite&gt; INSERT INTO invoices (id,title,details,billedamt)  VALUES (2, &#39;book&#39;, &#39;Franz Kafkav2&#39;, 500.00 );<br>sqlite&gt;</pre><p>And this row you can see at the consumer end.</p><blockquote>Note:<em> This took me a lot of time, finally I tried this on a new VM. I want to know more towards debug side, why things didnt work earlier. If you read this and came across any sources for debugging please tag.</em></blockquote><p>Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a01653cee7e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To: Kafka — Getting Started]]></title>
            <link>https://medium.com/@rajagenupula/how-to-kafka-getting-started-ab082279abd5?source=rss-a8f61068a924------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab082279abd5</guid>
            <category><![CDATA[kafka-installation]]></category>
            <category><![CDATA[kafka-consumer]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[kafka-producer]]></category>
            <dc:creator><![CDATA[Gahano]]></dc:creator>
            <pubDate>Sat, 02 Mar 2024 19:23:51 GMT</pubDate>
            <atom:updated>2024-03-06T22:53:49.736Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/165/1*nTUyDn0YfhpeQRznAdb3mg.png" /></figure><h3>How To: Kafka — Getting Started</h3><p><em>What is Kafka ? </em>Apache Kafka is a distributed event store and stream-processing platform. It is an open-source system developed by the Apache Software Foundation written in Java and Scala. The project aims to provide a unified, high-throughput, low-latency platform for handling real-time data feeds[1]</p><p><strong>The enough terminology to get started with Kafka</strong></p><ul><li>Cluster: This is a set of Kafka brokers.</li><li>Zookeeper: This is a cluster coordinator — a tool with different services that are part of the Apache ecosystem.</li><li>Broker: This is a Kafka server, also the Kafka server process itself.</li><li>Topic: This is a queue (that has log partitions); a broker can run several topics.</li><li>Offset: This is an identifier for each message.</li><li>Partition: This is an immutable and ordered sequence of records continually appended to a structured commit log.</li><li>Producer: This is the program that publishes data to topics.</li><li>Consumer: This is the program that processes data from the topics.</li><li>Retention period: This is the time to keep messages available for consumption.</li><li>Message/Record: Event published into Kafka Topic</li></ul><p>So, Producer is something using which we publish the events into Kafka Topic. And A consumer is something which watch over the topic it wants for events published in the topic.</p><p>You can say, then why Kafka ? why can’t we send the events directly from client -&gt; server and vice-versa. We have to remember two important points.</p><ul><li>Kafka is not a solution for each and every problem where you need to stream the data or events or messages.</li><li>Kafka is suitable where you need a solution which is reliable , fault-tolerant and resilient. The Kafka architecture is designed in a such a way that every message is replicated across the brokers, in multiple replicas. So even one broker in the Kafka cluster went down the remaining brokers will make sure that there is no data loss.</li></ul><h3>Installation</h3><ul><li>Download the Kafka <a href="https://kafka.apache.org/downloads">https://kafka.apache.org/downloads</a></li></ul><pre>wget https://downloads.apache.org/kafka/3.7.0/kafka_2.13-3.7.0.tgz<br>tar -xvf kafka_2.13-3.7.0.tgz</pre><ul><li>Make sure Java installed</li></ul><pre>wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz<br>tar -xvf kafka_2.13-3.7.0.tgz<br>[vagrant@localhost bin]$ echo &quot;export PATH=$PATH:/home/vagrant/jdk-21.0.2/bin&quot; &gt;&gt; ~/.bashrc<br>[vagrant@localhost bin]$ echo &quot;export JAVA_HOME=/home/vagrant/jdk-21.0.2&quot; &gt;&gt; ~/.bashrc<br>[vagrant@localhost bin]$ exec $SHELL<br>[vagrant@localhost bin]$ java -version<br>java version &quot;21.0.2&quot; 2024-01-16 LTS<br>Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58)<br>Java HotSpot(TM) 64-Bit Server VM (build 21.0.2+13-LTS-58, mixed mode, sharing)<br>[vagrant@localhost bin]$ javac -version<br>javac 21.0.2<br>[vagrant@localhost bin]$</pre><h3>Zookeeper</h3><ul><li>A distributed store that provides discovery, configuration, and synchronization services in a highly available way.</li><li>Zookeeper will be replaced by the<strong> Kafka Raft Metadata mode (KRaft)</strong></li><li>Kafka provides fault tolerance and resilience and something needed to provide needed coordination for all that to work and ZK takes care of that.</li><li>For the Kafka brokers ( 1… n ) to work properly, and to co ordinate with each other, they need to come to an agreement.</li><li>to know more about Zookeeper involvement in Kafka, read more on znodes or ZkUtils.scala</li></ul><p>Enough reading, lets see small practical example and lets wrap up this article.</p><pre># Start Zookeeper<br>./bin/zookeeper-server-start.sh ./config/zookeeper.properties<br><br># Start Kafka<br> ./bin/kafka-server-start.sh ./config/server.properties</pre><p>Now we need to create a topic, so that the producer client can send messages/records/events to the topic and similarly consumers can read the data.</p><pre># Create topic to send messages/records<br>[vagrant@localhost kafka_2.13-3.7.0]$ bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --topic medium_kafka --partitions 3 --replication-factor 1<br>WARNING: Due to limitations in metric names, topics with a period (&#39;.&#39;) or underscore (&#39;_&#39;) could collide. To avoid issues it is best to use either, but not both.<br>Created topic medium_kafka.<br>[vagrant@localhost kafka_2.13-3.7.0]$ bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic medium_kafka<br>Topic: medium_kafka     TopicId: gTcRKgk0RV2X1VXfP7Dt2w PartitionCount: 3       ReplicationFactor: 1 Configs: <br>        Topic: medium_kafka     Partition: 0    Leader: 0       Replicas: 0     Isr: 0<br>        Topic: medium_kafka     Partition: 1    Leader: 0       Replicas: 0     Isr: 0<br>        Topic: medium_kafka     Partition: 2    Leader: 0       Replicas: 0     Isr: 0<br>[vagrant@localhost kafka_2.13-3.7.0]$<br></pre><ul><li>partitions 3 means, 3 partitions like partition0,1,2 will be created in each broker, right now we have only one instance of kafka broker running, so 3 partitions will be created in that broker.</li><li>replication-factor 1 means, actually no replication at all, because you are not writing data to any other kafka broker.</li></ul><p>Let’s say for example, you have 2 kafka brokers, and you mentioned partitions as 2 and replication-factor as 2. So now each broker will have 2 partitions and data will be replicated to two partitions across the cluster.</p><p>This replication will happen in a manner like, assume broker1 and broker2 are the kafka service running servers, broker1.partion0 data will be replicated to broker1.partition0 and similarly broker0.partition1 data to broker1.partition1.</p><p>Lets interact with Producer and Consumer clients and send the data between them via Kafka broker.</p><p><strong>Producer console</strong></p><pre>[vagrant@localhost kafka_2.13-3.7.0]$ ./bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic medium_kafka</pre><p><strong>Consumer Console</strong></p><pre>[vagrant@localhost kafka_2.13-3.7.0]$ ./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic medium_kafka --from-beginning</pre><p>Now you can send messages at Producer console, and you can see them received at consumer console on the same <strong>topic, </strong>here is my execution log</p><pre>[vagrant@localhost kafka_2.13-3.7.0]$ ./bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic medium_kafka<br>&gt;Hello<br>&gt;This message sent from kafka producer client<br>&gt;hope you received.<br>&gt;^C[vagrant@localhost kafka_2.13-3.7.0]$ ^C<br>[vagrant@localhost kafka_2.13-3.7.0]$ <br><br>[vagrant@localhost kafka_2.13-3.7.0]$ ./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic medium_kafka --from-beginning<br>Hello<br>This message sent from kafka producer client<br>hope you received.<br>^CProcessed a total of 3 messages<br>[vagrant@localhost kafka_2.13-3.7.0]$</pre><p>That’s for this initial article, please reference for more reading. In the next article, I will explain about using FileStream and Kafka Connect.</p><p>Thank you.</p><p>Ref:</p><p>[1]:<a href="https://en.wikipedia.org/wiki/Apache_Kafka">https://en.wikipedia.org/wiki/Apache_Kafka</a></p><p>[2]: <a href="https://www.redhat.com/en/blog/apache-kafka-10-essential-terms-and-concepts-explained">https://www.redhat.com/en/blog/apache-kafka-10-essential-terms-and-concepts-explained</a></p><p>[3]:<a href="https://www.conduktor.io/kafka/kafka-topic-replication/">https://www.conduktor.io/kafka/kafka-topic-replication/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab082279abd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Compile VIM from source]]></title>
            <link>https://medium.com/@rajagenupula/compile-vim-from-source-c4b2ece40123?source=rss-a8f61068a924------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4b2ece40123</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[install]]></category>
            <category><![CDATA[vim]]></category>
            <dc:creator><![CDATA[Gahano]]></dc:creator>
            <pubDate>Fri, 02 Jun 2023 05:51:19 GMT</pubDate>
            <atom:updated>2023-06-02T05:55:32.820Z</atom:updated>
            <content:encoded><![CDATA[<p>By default, Vim binary available in repository not have all language features enabled. We can install vim from the source with all features.</p><p>Step1 — Download VIM from source (Current latest Vim9.0)</p><pre>$ wget https://ftp.nluug.nl/pub/vim/unix/vim-9.0.tar.bz2<br>$ tar -xvf vim-9.0.tar.bz2<br>$ cd vim90</pre><p>Step 2 — Install required package to compile from source</p><pre>$ sudo apt-get install libncurses5-dev libgtk2.0-dev libatk1.0-dev \<br>libcairo2-dev libx11-dev libxpm-dev \<br>libxt-dev python3-dev ruby-dev mercurial</pre><p>Step 3: If you have installed vim already, to remove</p><pre>$ sudo apt-get remove vim vim-runtime gvim vim-tiny vim-common vim-gui-common</pre><h3>Step 4: Install from source with config and make</h3><pre>$ ./configure --with-features=huge --enable-multibyte --enable-rubyinterp \<br>--enable-python3interp --with-python-config-dir=/usr/lib/python3.9/config-3.9-x86_64-linux-gnu \<br>--enable-perlinterp --enable-luainterp --enable-gui=gtk2 --enable-cscope \<br>--prefix=/usr<br><br>$ make VMRUNTIMEDIR=/usr/share/vim/vim9<br>$ sudo make install</pre><p>To configure Vim post installation, I used <a href="https://vim-bootstrap.com/#tagline">https://vim-bootstrap.com</a>.</p><p>Hope it helps.</p><p>Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4b2ece40123" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2 Cents Of My Philosophy]]></title>
            <link>https://medium.com/@rajagenupula/2-cents-of-my-philosophy-65830f97189d?source=rss-a8f61068a924------2</link>
            <guid isPermaLink="false">https://medium.com/p/65830f97189d</guid>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[stoicism]]></category>
            <category><![CDATA[stoic]]></category>
            <dc:creator><![CDATA[Gahano]]></dc:creator>
            <pubDate>Wed, 28 Dec 2022 15:54:51 GMT</pubDate>
            <atom:updated>2022-12-28T15:54:51.889Z</atom:updated>
            <content:encoded><![CDATA[<p>The books I am reading are on the subject of Stoicism. I admire that very much and I like to follow at least a few principles in my everyday life. I writing down a few points I noted recently.</p><h3><strong>Cautious vs Confidence</strong></h3><ul><li>When you have an option to select while making a choice, always be <strong>cautious</strong>. You have options, so do the math, calculate what is best for you, run simulations on how your life would be if you pick given choices.</li><li>If you are in a completely new situation, stranger land, then confusion might push you into panic, which leads towards wrong decision which might make you fall for evil traps. Instead, be with confidence, keep your composure calm. See things clearly, take decision based on information available, take small steps.</li></ul><h3>Decision Vs Results</h3><ul><li>You can judge a thing, but you can&#39;t judge a decision. A decision is more like the best option you think you have at that moment of taking the decision which might look good or best while taking, but in the future it might not look so good.</li><li>In simple words, there isn’t such a thing as a decision. You have selected the best option among the options that were given to you.</li><li>So what is the best you can do? Pick the best decision and be responsible/accountable for its results, either good or bad.</li></ul><h3>Keeping Calm</h3><ul><li>How do you keep calm or maintain your attitude ? Simply by not judging on the things out of your control. So no emotion leads to no response, which leads to no perspective change.</li></ul><p>Though the way I write might not be so good, I am trying to improve it. And the points I mentioned, hope they will help you adjust your wind if you like.</p><p>— <br>Raja</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65830f97189d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>