Skip to content

Instantly share code, notes, and snippets.

View vnkdj5's full-sized avatar
👨‍💻
Improving Skills

Vaibhav Kumbhar vnkdj5

👨‍💻
Improving Skills
View GitHub Profile
@vnkdj5
vnkdj5 / docker-compose.yaml
Created October 7, 2024 05:09
Docker compose for dynamo, kafka, lenses, redis cluster
version: "3.9"
services:
dynamodb-local:
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath ./data"
image: "amazon/dynamodb-local:latest"
container_name: dynamodb-local
network_mode: host # Set the network mode to host
# ports:
# - "8000:8000"
volumes:
@vnkdj5
vnkdj5 / redis_cluster.sh
Last active September 28, 2024 19:58
Redis cluster Setup via docker using shell script
#!/bin/bash
if [ "$1" = "setup" ]; then
docker network create redis-cluster
docker run -e ALLOW_EMPTY_PASSWORD=yes -e REDIS_NODES=redis1,redis2,redis3,redis4,redis5,redis6 --name redis1 --network redis-cluster -p 6379:6379 -d bitnami/redis-cluster:latest
docker run -e ALLOW_EMPTY_PASSWORD=yes -e REDIS_NODES=redis1,redis2,redis3,redis4,redis5,redis6 --name redis2 --network redis-cluster -p 6380:6379 -d bitnami/redis-cluster:latest
docker run -e ALLOW_EMPTY_PASSWORD=yes -e REDIS_NODES=redis1,redis2,redis3,redis4,redis5,redis6 --name redis3 --network redis-cluster -p 6381:6379 -d bitnami/redis-cluster:latest
docker run -e ALLOW_EMPTY_PASSWORD=yes -e REDIS_NODES=redis1,redis2,redis3,redis4,redis5,redis6 --name redis4 --network redis-cluster -p 6382:6379 -d bitnami/redis-cluster:latest
docker run -e ALLOW_EMPTY_PASSWORD=yes -e REDIS_NODES=redis1,redis2,redis3,redis4,redis5,redis6 --name redis5 --network redis-cluster -p 6383:6379 -d bitnami/redis-cluster:latest
docker run -e ALLOW_EMPT
@vnkdj5
vnkdj5 / keycloak_link_if_exists_script.js
Created March 8, 2023 17:46
Keycloak JS Authenticator to Link Social accounts automatically if the user already exists
package com.gyansagar.services;
import com.gyansagar.exceptions.DuplicateEntryException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gyansagar.entities.Buyer;
import com.gyansagar.repository.BuyerRepository;
@Service
@vnkdj5
vnkdj5 / EsBulkUpdate.ts
Created April 7, 2022 06:44
Elastic search bulk add or remove from the array nodejs example
await client.bulk({
index: index,
type: "_doc",
body: [
{ update: { _id: "1" } },
{
script: {
@vnkdj5
vnkdj5 / SDES.java
Created March 28, 2020 14:00
SIMPLIFIED DATA ENCRYPTION STANDARD (S-DES) implementation java
import java.awt.datatransfer.StringSelection;
import java.io.DataInputStream;
/*
* Link For reference: https://www.brainkart.com/article/Simplified-Data-Encryption-Standard-(S-DES)_8343/
*/ // https://www.brainkart.com/article/Simplified-Data-Encryption-Standard-(S-DES)_8343/
public class SDES {
public int K1,K2;
//Note: below matrics will be provided in lab(PICT)..
//For performing P10 permutation
@vnkdj5
vnkdj5 / mpi_binary_search.cpp
Created July 1, 2019 13:59
MPI BInary Search
//============================================================================
// Name : MPI_binary_search.cpp
// Author : VaibhavK
// Version :
// Copyright : Way2TechIn
//============================================================================
#include <iostream>
#include<mpi/mpi.h>
#include<cstdlib>
@vnkdj5
vnkdj5 / mergeSort.c
Created July 1, 2019 13:41
Merge Sort Program in OpenMP
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "omp.h"
#define MAX_SIZE 10
//Function for creating an input array||Update accoorind to your need
void generate_list(int * x, int n) {
int i,j,t;
@vnkdj5
vnkdj5 / bubbleSort.c
Created July 1, 2019 13:38
Bubble Sort paralle OpenMP
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
void swap();
int main (int argc, char *argv[]) {
int SIZE =1<<8;
int A[SIZE];
for(int i=0;i<SIZE;i++)
@vnkdj5
vnkdj5 / matVecMul.cu
Created July 1, 2019 12:57
Matrix-Vector Multiplication parallel program in CUDA
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<time.h>
using namespace std;
__global__ void matrixVectorMultiplication(int *a, int *b, int *c, int n)
{
int row=threadIdx.x+blockDim.x*blockIdx.x;