<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog on Kamran Zafar</title><link>https://kamranzafar.org/blog/</link><description>Recent content in Blog on Kamran Zafar</description><generator>Hugo</generator><language>en-AU</language><lastBuildDate>Sun, 13 Sep 2026 20:00:46 +1000</lastBuildDate><atom:link href="https://kamranzafar.org/blog/index.xml" rel="self" type="application/rss+xml"/><item><title>The AI That Isn’t Allowed to Remember</title><link>https://kamranzafar.org/blog/2026/09/13/the-ai-that-isnt-allowed-to-remember/</link><pubDate>Sun, 13 Sep 2026 20:00:46 +1000</pubDate><guid>https://kamranzafar.org/blog/2026/09/13/the-ai-that-isnt-allowed-to-remember/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;Building a Qur’an and Hadith research tool meant treating the general purpose LLM’s own memory as a liability, not a feature. And three production failures that taught me why every layer of the pipeline around it earns its keep.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Ask a general-purpose chat model to quote a hadith on a specific ruling, and it will usually hand you something that looks right: a plausible book name, a narrator chain, a quote in confident English. Ask it to check its own answer and it will often defend the fabrication just as confidently. That’s not a rare glitch, it’s the model doing exactly what it was trained to do, produce fluent, plausible continuations. The problem is that “plausible” and “real” are unrelated properties, and for a domain where the exact wording of a source &lt;em&gt;is&lt;/em&gt; the evidence, a fluent misquote isn’t a stylistic slip. It’s fabricated primary-source material attributed to a real book and a real scholar.&lt;/p&gt;</description></item><item><title>Building an Intelligent Document Indexing &amp; Search System with OpenSearch Vector DB, and Ollama AI</title><link>https://kamranzafar.org/blog/2026/04/15/building-an-intelligent-document-indexing-search-system-with-opensearch-vector-db-and-ollama-ai/</link><pubDate>Wed, 15 Apr 2026 21:54:31 +1000</pubDate><guid>https://kamranzafar.org/blog/2026/04/15/building-an-intelligent-document-indexing-search-system-with-opensearch-vector-db-and-ollama-ai/</guid><description>&lt;p&gt;Organisations today generate enormous volumes of documents — contracts, statements, reports, compliance evidence, engineering drawings, emails, and more. Traditional keyword search struggles to extract meaning from this information. Today’s users’ want answers and deep document insights, not just matching text.&lt;/p&gt;&#10;&lt;p&gt;By combining &lt;strong&gt;Spring Boot&lt;/strong&gt;, &lt;strong&gt;OpenSearch Vector DB&lt;/strong&gt;, and &lt;strong&gt;Ollama&lt;/strong&gt; AI, you can build a modern document intelligence platform capable of:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Indexing documents into vector embeddings&lt;/li&gt;&#10;&lt;li&gt;Performing semantic and hybrid search&lt;/li&gt;&#10;&lt;li&gt;Running Retrieval‑Augmented Generation (RAG)&lt;/li&gt;&#10;&lt;li&gt;Delivering grounded, context‑aware answers&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;a href="https://medium.com/@kamranzafarau/building-an-intelligent-document-indexing-search-system-with-opensearch-vector-db-and-ollama-ai-d0449a4f26e7" rel="noopener"&gt;Continue reading…&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Real-Time Data Replication Using Change Data Capture (CDC) with Debezium and Kafka</title><link>https://kamranzafar.org/blog/2025/07/03/real-time-data-replication-using-change-data-capture-cdc-with-debezium-and-kafka/</link><pubDate>Thu, 03 Jul 2025 14:53:57 +1000</pubDate><guid>https://kamranzafar.org/blog/2025/07/03/real-time-data-replication-using-change-data-capture-cdc-with-debezium-and-kafka/</guid><description>&lt;p&gt;In today’s world of distributed systems and real-time analytics, keeping data in sync across databases is critical. This blog post walks you through a practical demo of implementing &lt;strong&gt;Change Data Capture (CDC)&lt;/strong&gt; to replicate data from &lt;strong&gt;SQL Server&lt;/strong&gt; to &lt;strong&gt;PostgreSQL&lt;/strong&gt;, using &lt;strong&gt;Debezium&lt;/strong&gt;, &lt;strong&gt;Apache Kafka&lt;/strong&gt;, and &lt;strong&gt;Kafka Connect&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;We’ll set up a fully functional pipeline that captures changes in SQL Server and streams them to a PostgreSQL sink — all within Docker containers.&lt;/p&gt;</description></item><item><title>Securing Hazelcast (tcp) traffic with Stunnel</title><link>https://kamranzafar.org/blog/2019/06/11/securing-hazelcast-tcp-traffic-with-stunnel/</link><pubDate>Tue, 11 Jun 2019 11:16:04 +1000</pubDate><guid>https://kamranzafar.org/blog/2019/06/11/securing-hazelcast-tcp-traffic-with-stunnel/</guid><description>&lt;p&gt;Hazelcast is a distributed in-memory data grid, which allows to evenly share data among nodes in clustered environments. The open source version of Hazelcast does not support encryption at the transport or even at the cache level. So in order to secure traffic in the Hazelcast cluster, we need to extend it by making some code changes, which may not always be an option.&lt;/p&gt;&#10;&lt;p&gt;There is however another way to secure the transport by using stunnel. As the official documentation states, “Stunnel is a proxy designed to add TLS encryption functionality to existing clients and servers without any changes in the programs’ code”. This sounds like a perfect option in our case, and allows us to decouple transport encryption from our Hazelcast applications.&lt;/p&gt;</description></item><item><title>Docker and iptables firewall</title><link>https://kamranzafar.org/blog/2017/04/05/docker-and-iptables-firewall/</link><pubDate>Wed, 05 Apr 2017 02:20:42 +1000</pubDate><guid>https://kamranzafar.org/blog/2017/04/05/docker-and-iptables-firewall/</guid><description>&lt;p&gt;Docker works perfectly fine when no firewall is running on the host machine. Without the firewall docker containers can communicate with each other and with the outside world. But with the firewall we need to setup some rules in order to allow traffic to and from the docker interface. Below it is detailed how we can configure the firewall for docker on a Centos server.&lt;/p&gt;&#10;&lt;p&gt;First of all let us find the docker interface and IP, we can do that using the &lt;em&gt;&lt;strong&gt;ifconfig&lt;/strong&gt;&lt;/em&gt; command:&lt;/p&gt;</description></item><item><title>Atomic Updates on MongoDB with Spring Data</title><link>https://kamranzafar.org/blog/2016/10/25/atomic-updates-on-mongodb-with-spring-data/</link><pubDate>Tue, 25 Oct 2016 00:04:09 +1100</pubDate><guid>https://kamranzafar.org/blog/2016/10/25/atomic-updates-on-mongodb-with-spring-data/</guid><description>&lt;p&gt;MongoDB provides operators for atomic updates in addition to the normal insert and modify functionality. These operators include, &lt;strong&gt;$inc&lt;/strong&gt;, &lt;strong&gt;$set&lt;/strong&gt; and &lt;strong&gt;$unset&lt;/strong&gt;; and are particularly useful for keeping counters and for &lt;em&gt;thread-safe&lt;/em&gt; field updates, which helps resolve data-related concurrency issues in web and multi-threaded applications. If persistence is required and performance is not an issue, these operators can also be a good replacement for single-threaded caching solutions like Redis by providing &lt;em&gt;persistent&lt;/em&gt; atomic operations. The use cases for using these operations include, real-time web analytics, leader boards, rate limiting etc.&lt;/p&gt;</description></item><item><title>CAS and distributed Infinispan integration</title><link>https://kamranzafar.org/blog/2016/10/18/cas-and-distributed-infinispan-integration/</link><pubDate>Tue, 18 Oct 2016 21:02:08 +1100</pubDate><guid>https://kamranzafar.org/blog/2016/10/18/cas-and-distributed-infinispan-integration/</guid><description>&lt;p&gt;CAS is a centralised authentication server that makes it very easy to implement single sign-on (SSO) in java application, and is a very good OAuth alternative. For distributed/clustered environments CAS also offers integration with a number of caching technologies in order to support single-logout (SLO). Recently we had an issue on clustered Wildfly J2EE servers where we had to support SLO in our distributed spring-boot based applications. Infinispan is the default distributed caching technology used by Wildfly, and unfortunately we didn’t find any integration support provided by CAS for Infinispan. So I wrote an integration library for CAS &amp;amp; Infinispan, which is &lt;a href="https://github.com/kamranzafar/cas-client-support-distributed-infinispan" rel="noopener"&gt;available on github&lt;/a&gt; under Apache License. This library makes it possible to achieve SLO in distributed J2EE applications on Wildfly.&lt;/p&gt;</description></item><item><title>Spring and Infinispan Integration on Wildfly Cluster</title><link>https://kamranzafar.org/blog/2016/09/17/spring-and-infinispan-integration-on-wildfly-cluster/</link><pubDate>Sat, 17 Sep 2016 20:45:37 +1000</pubDate><guid>https://kamranzafar.org/blog/2016/09/17/spring-and-infinispan-integration-on-wildfly-cluster/</guid><description>&lt;p&gt;Spring framework provides a caching abstraction API that makes it very easy and consistent to use a lot of embeddable caching frameworks like, EHCache, Infinispan, Hazelcast etc. But sometimes it is also necessary to integrate with the underlying application server’s caching framework, especially in a clustered, distributed environment. In this post I will show how we can integrate a spring-boot application, deployed on clustered Wildfly application servers (version 10.1.0.Final), to integrate with the distributed Infinispan cache. Below is an illustration:&lt;/p&gt;</description></item><item><title>Spring Boot and WordPress CMS Integration</title><link>https://kamranzafar.org/blog/2016/08/08/spring-boot-and-wordpress-integration/</link><pubDate>Mon, 08 Aug 2016 18:02:53 +1000</pubDate><guid>https://kamranzafar.org/blog/2016/08/08/spring-boot-and-wordpress-integration/</guid><description>&lt;p&gt;There are a lot of excellent open source content management systems available today,  WordPress being one of them, which is widely used. WordPress is a PHP based CMS so not a lot of cohesion is available with other technologies like Java, and is simply ignored as a viable content management option just for being non-Java.&lt;/p&gt;&#10;&lt;p&gt;In this post I will demonstrate how WordPress can be integrated with Spring Boot applications, all made possible with &lt;a href="http://v2.wp-api.org/" rel="noopener"&gt;WordPress REST plugin&lt;/a&gt; and a &lt;a href="https://github.com/kamranzafar/spring-wpapi" rel="noopener"&gt;Spring client&lt;/a&gt;. Both of these are open source and available for free. Below is a simple design diagram that explains how this integration works. This post assumes that the reader has prior knowledge of WordPress and Spring Boot.&lt;/p&gt;</description></item><item><title>Using Standalone ActiveMQ Broker with Wildfly</title><link>https://kamranzafar.org/blog/2016/04/07/using-standalone-activemq-broker-with-wildfly/</link><pubDate>Thu, 07 Apr 2016 21:37:45 +1000</pubDate><guid>https://kamranzafar.org/blog/2016/04/07/using-standalone-activemq-broker-with-wildfly/</guid><description>&lt;p&gt;Wildfly is an open source J2EE container, which comes with an embedded HornetQ JMS broker enabled by default in it’s &lt;em&gt;full&lt;/em&gt; configuration. The embedded HornetQ works great out of the box, but sometimes it can be handy to use an existing JMS broker, like ActiveMQ. ActiveMQ includes a JCA resource adaptor that can be used to integrate it with J2EE containers. Below we will see how to integrate standalone ActiveMQ 5.13.2 with Wildfly 9.0.2 server.&lt;/p&gt;</description></item><item><title>Protect your identity from SSH servers</title><link>https://kamranzafar.org/blog/2016/01/17/protect-your-identity-from-ssh-servers/</link><pubDate>Sun, 17 Jan 2016 22:19:18 +1100</pubDate><guid>https://kamranzafar.org/blog/2016/01/17/protect-your-identity-from-ssh-servers/</guid><description>&lt;p&gt;Recently I came across a tweet that highlighted a serious privacy issue related to SSH servers and online services that publish user information in public domain without having to explicitly take permission from users.&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;Added a OpenSSH roaming vuln test to the whoami server $ ssh &lt;a href="https://t.co/MSn1TEQGTs" rel="noopener"&gt;https://t.co/MSn1TEQGTs&lt;/a&gt; (code: &lt;a href="https://t.co/HMIH00CxHg" rel="noopener"&gt;https://t.co/HMIH00CxHg&lt;/a&gt;) &lt;a href="https://t.co/9tolWWvXZJ" rel="noopener"&gt;pic.twitter.com/9tolWWvXZJ&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;— Filippo Valsorda (@FiloSottile) &lt;a href="https://twitter.com/FiloSottile/status/688234526925979649" rel="noopener"&gt;January 16, 2016&lt;/a&gt;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;In this tweet the guy talks about running a SSH server that matches the incoming connection’s public key with the public keys of Github users, which for some reason Github has kept in the public domain (totally not cool!).&lt;/p&gt;</description></item><item><title>Real-time Web Cam Surveillance with Raspberry-PI</title><link>https://kamranzafar.org/blog/2015/11/29/real-time-web-cam-surveillance-with-raspberry-pi/</link><pubDate>Sun, 29 Nov 2015 21:46:23 +1100</pubDate><guid>https://kamranzafar.org/blog/2015/11/29/real-time-web-cam-surveillance-with-raspberry-pi/</guid><description>&lt;p&gt;Raspberry PI is a great little tool for building small projects, from personal web servers to robot butlers. With it’s linux core you could potentially use RPI like a regular linux box. There are loads of example projects available on the internet. Here I will present how to use RPI to build a &lt;strong&gt;poor man’s surveillance camera&lt;/strong&gt; using an ordinary web cam. I found an old web cam in the drawer, I seldom open, that came in handy for this project.&lt;/p&gt;</description></item><item><title>XMPP web chat with ejabberd, Converse.js and Spring MVC</title><link>https://kamranzafar.org/blog/2015/08/05/xmpp-web-chat-with-ejabberd-converse-js-and-spring-mvc/</link><pubDate>Wed, 05 Aug 2015 23:15:58 +1000</pubDate><guid>https://kamranzafar.org/blog/2015/08/05/xmpp-web-chat-with-ejabberd-converse-js-and-spring-mvc/</guid><description>&lt;p&gt;&lt;strong&gt;&lt;a href="https://conversejs.org/" rel="noopener"&gt;Converse.js&lt;/a&gt;&lt;/strong&gt; is a fine little &lt;a href="http://xmpp.org/" rel="noopener"&gt;&lt;strong&gt;XMPP&lt;/strong&gt;&lt;/a&gt; web chat client that can easily be used in web applications. It can integrate with various online XMPP services, like Google Talk, MSN etc. In this post I will demonstrate how to use converse.js with &lt;strong&gt;&lt;a href="https://www.ejabberd.im/" rel="noopener"&gt;ejabberd&lt;/a&gt;&lt;/strong&gt; in a Spring based application. I used Ubuntu linux box to for this demo.&lt;/p&gt;&#10;&lt;p&gt;ejabberd is available in main Ubuntu repositories so can be installed by using the following command.&lt;/p&gt;</description></item><item><title>Organizing Media files on Linux</title><link>https://kamranzafar.org/blog/2013/12/24/organizing-media-files-on-linux/</link><pubDate>Tue, 24 Dec 2013 17:10:09 +1100</pubDate><guid>https://kamranzafar.org/blog/2013/12/24/organizing-media-files-on-linux/</guid><description>&lt;p&gt;Recently I was doing some cleanup on my Dropbox account, and I found that some folders (especially “Camera Uploads”) had like a million unorganized images and video files that were auto uploaded from my mobile phone and other devices. Unfortunately Dropbox doesn’t automatically organize these files in date folders or even gives you an option to do so. So I decided to write a script to organize the files myself in the Dropbox folder on my Linux Desktop. Below is a simple shell script that can do this.&lt;/p&gt;</description></item><item><title>Clustering and Load balancing Tomcat servers</title><link>https://kamranzafar.org/blog/2013/08/03/clustering-tomcat/</link><pubDate>Sat, 03 Aug 2013 23:11:12 +1000</pubDate><guid>https://kamranzafar.org/blog/2013/08/03/clustering-tomcat/</guid><description>&lt;p&gt;Tomcat is by far the most popular open source Java servlet container that can easily be scaled to ensure high availability. In this post I will show how easy it is to distribute and scale java web applications using tomcat clusters. In this example we will also use Apache web server to load balance the cluster.&lt;/p&gt;&#10;&lt;p&gt;Below is a simple setup of a cluster with two &lt;strong&gt;Tomcat 7&lt;/strong&gt; nodes with &lt;strong&gt;Apache web server 2.2&lt;/strong&gt; as a load balancer.&lt;/p&gt;</description></item><item><title>Demise of J2ME</title><link>https://kamranzafar.org/blog/2012/09/14/demise-of-j2me/</link><pubDate>Fri, 14 Sep 2012 23:24:03 +1000</pubDate><guid>https://kamranzafar.org/blog/2012/09/14/demise-of-j2me/</guid><description>&lt;p&gt;Since the arrival of iOS and Android smartphones, J2ME has really faded into the background. And it is not because iOS and Android are better platforms, it is because J2ME didn’t evolve with the rapid technological growth of mobile devices. J2ME was originally intended for low-end devices, as a lightweight Java runtime and was very successful. But we haven’t seen any new enhancements to the platform for the commonly available new high-end mobile devices nowadays. There has been &lt;a href="http://jcp.org/en/jsr/detail?id=172" rel="noopener"&gt;some&lt;/a&gt; &lt;a href="http://jcp.org/en/jsr/detail?id=179" rel="noopener"&gt;maintenance&lt;/a&gt; releases here and there but no substantial improvements were seen in the platform. &lt;a href="http://jcp.org/en/jsr/detail?id=249" rel="noopener"&gt;Some&lt;/a&gt; &lt;a href="http://www.jcp.org/en/jsr/detail?id=246" rel="noopener"&gt;proposed&lt;/a&gt; &lt;a href="http://www.jcp.org/en/jsr/detail?id=297" rel="noopener"&gt;enhancements&lt;/a&gt; are lying dormant in the neo-political and ever bureaucratic JCP. And since Oracle acquired Sun Microsystems, and started pushing their ADF platform for corporate mobile solutions, the future of J2ME is looking very bleak.&lt;/p&gt;</description></item><item><title>Sharing VPN connection on Linux</title><link>https://kamranzafar.org/blog/2012/08/16/sharing-vpn-connection-on-linux/</link><pubDate>Thu, 16 Aug 2012 23:52:48 +1000</pubDate><guid>https://kamranzafar.org/blog/2012/08/16/sharing-vpn-connection-on-linux/</guid><description>&lt;p&gt;Most VPN servers allow a single remote session per user, which is all you need most of the times. But sometimes it is necessary to connect multiple devices to the VPN server; but using a single user account it is impossible if the server doesn’t allow it. There is a way around this problem by sharing the VPN connection from a central node to other computers by setting up an ad-hoc wireless network using the wireless modem of the central computer as a hot-spot. The idea is fairly simple provided the central computer has two network cards:&lt;/p&gt;</description></item><item><title>Near Field Communication (NFC)</title><link>https://kamranzafar.org/blog/2011/09/10/near-field-communication-nfc/</link><pubDate>Sat, 10 Sep 2011 20:00:17 +1000</pubDate><guid>https://kamranzafar.org/blog/2011/09/10/near-field-communication-nfc/</guid><description>&lt;p&gt;Near Field Communication (NFC) is a wireless/radio-frequency technology that works over short-range. This involves communicating data between devices(“initiator” and “target”) in close proximty normally requiring less than 10 centimeters. In the realm of mobile phones, the “initiator” is the mobile handset and the target is typically a RFID(Radio Frequency Identification) Tag for passive communication. To understand it; RFID Tags, for passive communication can be thought as QR/barcodes and the smartphone as a “reader”. But with NFC it is also possible to have an “active” communication, which requires powered RFID Tags enabling peer-to-peer communication between itself and the NFC-enabled device, similar to Bluetooth.&lt;/p&gt;</description></item><item><title>A free software license</title><link>https://kamranzafar.org/blog/2011/04/21/a-free-software-license/</link><pubDate>Thu, 21 Apr 2011 22:59:28 +1000</pubDate><guid>https://kamranzafar.org/blog/2011/04/21/a-free-software-license/</guid><description>&lt;p&gt;There are many free software licenses available these days, from &lt;a href="http://en.wikipedia.org/wiki/GNU_General_Public_License#.22Viral.22_Nature" rel="noopener"&gt;viral&lt;/a&gt; and stringent licenses like &lt;a href="http://www.gnu.org/licenses/gpl.html" rel="noopener"&gt;GPL&lt;/a&gt;, with some grey and confusing like &lt;a href="http://www.gnu.org/copyleft/lesser.html" rel="noopener"&gt;LGPL&lt;/a&gt; to business friendly licenses like &lt;a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noopener"&gt;ASL&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/MIT_License" rel="noopener"&gt;X11&lt;/a&gt;. All of these licenses are “open source”, which means the software source is also available to public along with its binaries. Which is great for open source and I personally like ASL among the lot and tend to use it for most of my open source software. But sometimes you might feel that these licenses are not “free” enough, and pack tons of terms and conditions in a pretty complicated language. There should be a software specific license which doesn’t restrict the user in anyway and allows to freely use, modify and distribute the software in any way the user likes. And the derived work should be allowed for both commercial and personal use, with or without a charge.&lt;/p&gt;</description></item><item><title>Why is git better than svn</title><link>https://kamranzafar.org/blog/2011/04/07/git-better-than-svn/</link><pubDate>Thu, 07 Apr 2011 16:42:46 +1000</pubDate><guid>https://kamranzafar.org/blog/2011/04/07/git-better-than-svn/</guid><description>&lt;p&gt;Well I am not going to start debating over this question, as &lt;a href="http://stackoverflow.com/questions/161541/svn-vs-git" rel="noopener"&gt;most&lt;/a&gt; &lt;a href="http://thinkvitamin.com/code/why-you-should-switch-from-subversion-to-git/" rel="noopener"&gt;people&lt;/a&gt; &lt;a href="https://git.wiki.kernel.org/index.php/GitSvnComparison" rel="noopener"&gt;on the web are doing so&lt;/a&gt;. I am not going to list pros and cons of both &lt;a href="http://subversion.apache.org/" rel="noopener"&gt;svn&lt;/a&gt; and &lt;a href="http://git-scm.com/" rel="noopener"&gt;git&lt;/a&gt; and make a vague conclusion in the end. I being a user of both svn and git, found git better for the kind of work I do and the way I do it. I was mainly a svn user before I heard people talking about git being easier etc. than svn; after I started using git I agree with these people. With git, it is much easier, simpler, faster and natural(in the realm of development) to manage your code, to create and clone repos; branch, tag and merge code. Apart from being simple and powerful, git is also decentralized and distributed in nature, which undoubtedly is git’s main advantage over svn.&lt;/p&gt;</description></item></channel></rss>