Skip to content

Instantly share code, notes, and snippets.

View rajkrrsingh's full-sized avatar

Rajkumar Singh rajkrrsingh

View GitHub Profile
rajkrrsingh /
Last active May 28, 2024 22:39
bash script to setup local llama3 model on EC2 instance using ollama and access through your machine
#!/usr/bin/env bash

set -o errtrace
set -o nounset
set -o pipefail

# Quick steps to create the VPC/Public Subnet/EC2 in the aws account.

output=$(aws sts get-caller-identity 2>&1)
rajkrrsingh / Java DNS
Last active September 4, 2022 23:54
how the java dns resolution work

lets take a sample code to demonste what happen when java tries to resolve the ip for the give hostname.


public class DNSClient {
    public static void main(String[] args) {
 InetAddress address = null;
rajkrrsingh /
Created May 28, 2021 23:15
Configuring Impyla for CDW Hive LLAP Cluster
import logging
import os
import pandas
from impala.dbapi import connect
from impala.util import as_pandas

conn = connect(host=HIVE_HS2_HOST,port=443,
rajkrrsingh /
Last active March 3, 2021 05:55
aws cli commands for day to day work


List users

aws iam list-users

Current user

aws iam get-user

List access key

rajkrrsingh /
Created August 2, 2020 23:06
Java11 HttpClient to test the jwt authentication
package org.example;

import java.nio.charset.StandardCharsets;
rajkrrsingh /
Created June 15, 2020 05:11
Remote Debug Java Application running on Kubernetes Cluster

Following steps can be used to debug java application running on Remote Cluster, for sake of similicity I am using bare minimum pod config to spin the HS2 pod on the cluster.

  1. Build a docker image as per, The image push the debug config -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n to the JVM opts, the same can be achieved through the ConfigMap descriptor.

  2. Create HS2 Deployments

apiVersion: apps/v1
rajkrrsingh /
Last active May 25, 2020 17:17
Helm cheat sheet to the help on helm commands

Installation and setup

curl -fsSL -o
chmod 700
helm version
helm repo add stable

helm search and install app

rajkrrsingh /
Last active May 13, 2020 23:22
quick start guide to test Hive Merge features

Create Non-ACID table

create external table nonacid_n1 (key int, a1 string, value string) stored as orc;
insert into nonacid_n1 values(1, 'a11', 'val1');
insert into nonacid_n1 values(2, 'a12', 'val2');

| nonacid_n1.key  | nonacid_n1.a1  | nonacid_n1.value  |
| 1               | a11            | val1              |
rajkrrsingh /
Last active March 20, 2023 18:19
reference guide to run kafka command on CDP-DC cluster

CDP-DC kafka useful kafka commands

-- list topics
kafka-topics --list --bootstrap-server `hostname -f`:9092

-- create topic 
kafka-topics --create --bootstrap-server `hostname -f`:9092 --replication-factor 1 --partitions 1 --topic kafkatopic

-- produce messages
kafka-console-producer --broker-list `hostname -f`:9092 --topic kafkatopic
rajkrrsingh /
Created December 29, 2019 01:55
simple golang webapp on docker to quick test

Golang App

mkdir golang-web-app
cd golang-web-app
vim main.go
package main

import (