Skip to content

Instantly share code, notes, and snippets.

View rajeshpv's full-sized avatar

Rajesh Rao rajeshpv

  • Consultant
  • Cary NC
  • 22:43 (UTC -05:00)
View GitHub Profile
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "kafka-python",
# ]
# ///
"""Connect to Kafka and read messages from the fcs topic."""
import os
from datetime import datetime
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "kafka-python",
# ]
# ///
"""Connect to Kafka and read messages from the fcs topic."""
import os
from kafka import KafkaConsumer
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "confluent-kafka",
# ]
# ///
"""Connect to Kafka and read messages from the fcs topic."""
import os
from confluent_kafka import Consumer

Yes — Do Not Disturb (DND) on macOS prevents notifications from popping up for almost all apps, but with a few important nuances.


What DND does block

When DND is ON:

  • ❌ No notification banners or alerts
  • ❌ No notification sounds
@rajeshpv
rajeshpv / K8_resouce.md
Created July 20, 2025 17:49
K8 resource alloc

In Kubernetes, Quality of Service (QoS) classes define how resources (CPU and memory) are allocated to pods, especially during times of resource contention. The three QoS classes are:

  • Guaranteed
  • Burstable
  • BestEffort

Here’s a breakdown of the difference between Burstable and Guaranteed QoS classes:


Here's a clear and honest comparison of Kaplan vs. Princeton Review SAT prep courses, based on pricing, features, teaching style, and results.


🧠 1. Teaching & Curriculum

Feature Kaplan Princeton Review
Teaching Style Structured, test-focused Deep content review + strategy
Class Options Live Online, On Demand, Tutoring Live Online, On Demand, Tutoring
@rajeshpv
rajeshpv / agile_in_my_words.md
Last active April 8, 2025 14:17
Agile in my words :)

My Agile Experience and Insights

In my previous workplace, Agile was followed and executed seriously. Before that, I used to wonder why time constraints or measurements were necessary in technology, software development, or innovation. But in the real world, especially in a competitive market, if we cannot plan and deliver predictably, we are already too late.
Put simply: daily improvement is today’s innovation.

Key Insights from My Agile Experience

  • For Agile to be truly successful, a cohesive and stable team is essential. Sticking with the same team over time builds consistency, trust, and velocity.

  • Here’s how I like to define Agile in simple terms using an analogy:

@rajeshpv
rajeshpv / jvm_stat.md
Created March 27, 2025 13:54
jvm_stat

Capturing JVM heap allocation and comparing it between two executions of a Java application can be super insightful when you're analyzing memory usage, leaks, or performance. Here’s a practical way to do it:


🚀 Step-by-Step Guide

✅ 1. Enable JVM Heap Monitoring

Use the following Java options when running your app to capture memory usage:

@rajeshpv
rajeshpv / k8-ping.sh
Created February 12, 2025 00:43
Pings every 10 secs with 1 sec timeout to simulate k8 live probe test
#!/bin/bash
# have export APP_URL="http://service.com/"
LOG_FILE="output-k8-ping.log"
while true; do
# Run curl and capture output + exit code
# note: curl is given 1 sec of timeout else to error out (the -m 1)
OUTPUT=$(curl -m 1 -o /dev/null -s -w "{ DNS_Lookup: %{time_namelookup}, TCP_Connect: %{time_connect}, SSL_Handshake: %{time_appconnect}, TTFB: %{time_starttransfer}, Total_Time: %{time_total} }s\n" "$APP_URL")
EXIT_CODE=$?
db.collectionA.insertMany([
    { "_id": 1, "field1A": "A", "field2A": 100 },
    { "_id": 2, "field1A": "B", "field2A": 200 }

]);

db.collectionB.insertMany([
 { "_id": 1, "field1B": "A", "field2B": 100 },