Skip to content

Instantly share code, notes, and snippets.

View arjunKumbakkara's full-sized avatar
💭
Focus

Arjun Kumbakkara arjunKumbakkara

💭
Focus
  • 6d Technologies pvt ltd.
  • Bangalore ,Karnataka , India
View GitHub Profile
@arjunKumbakkara
arjunKumbakkara / pythonCallbackDemo.py
Created October 11, 2023 07:20
A beautiful demo of Callback in Python.Do visualize in PythonTutor Visualize
def sqrt(x, guess=0.1):
print("Trying:", guess, "-- Value:", guess*guess)
if good_enough(guess, x):
return guess
else:
guess = improve_guess(guess, x)
return sqrt(x, guess)
def good_enough(guess, x):
DEPLOYING A COMPRESSED SPRING BOOT APPLICATION(WAR) AS COMPARED TO AN EXPLODED APP PATCH
IN A TOMCAT SERVER WITH EXTERNALIZED PROPERTIES
Author:Arjun Kumbakkara (arjunkumbakkara@gmail.com)|https://arjunkumbakkara.github.io
First of all : SPRING BOOT CONVERSION
1. Convert your Spring boot application to Tomcat compatible (For SpringBoot2.x its easier for 1.x make sure you do the below)
a. remove the embedded Tomcat. Note: When using embedded tomcat , server.context=/api from application.properties wont work!
@arjunKumbakkara
arjunKumbakkara / GitMergeManualSteps
Created October 12, 2020 05:01
Git Merge Process (Manual with IDE and without Meld,kraken etc)
Git Merge Process (Manual with IDE and without Meld,kraken etc)Final Steps :
1. Be in Master : git checkout master
2. git pull
3. git checkout new-branch
4. git pull
5. git checkout master
6. git merge new- branch
@arjunKumbakkara
arjunKumbakkara / pyuac.py
Created March 5, 2020 20:25 — forked from sylvainpelissier/pyuac.py
pyuac - elevate a Python process with UAC on Windows compatible Python 3.
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vim: fileencoding=utf-8 tabstop=4 expandtab shiftwidth=4
"""User Access Control for Microsoft Windows Vista and higher. This is
only for the Windows platform.
This will relaunch either the current script - with all the same command
line parameters - or else you can provide a different script/program to
run. If the current user doesn't normally have admin rights, he'll be
@arjunKumbakkara
arjunKumbakkara / Full Redis Cluster setting up process
Created December 17, 2019 12:53
Redis Cluster Setup Complete Cross Server Clustering with Slotting
Make all nodes up
======================
[prepaid@GSI-1 cluster]$ ../../src/redis-server redis30011.conf
../../src/redis-server redis8580.conf
../../src/redis-server redis8581.conf
../../src/redis-server redis8582.conf
../../src/redis-server redis8583.conf
@arjunKumbakkara
arjunKumbakkara / Migrate Keys from One Redis DB to Another Redis DB
Last active January 16, 2020 10:40
Beautiful and Painful Redis Cluster Migration
#set connection data accordingly
#Will only work for redis > 5.0
#Easiest way
#if it doesnt work , then try with target_db=0 for both
#Also always use -c after redis-cli . Or else the redirection wont work and it will throw (error) Move
#There are multiple ways of doing it. One is via MIGRATE command , 2nd is via DUMP and RESTORE command.
source_host=localhost
source_port=6379
@arjunKumbakkara
arjunKumbakkara / StepsToGitIt
Last active March 14, 2019 06:33
Git Steps with the same IDE (Eclipse, without a difftool,mergetool)
First go to the local repo which is project folder
1.git status
See the modified changes , now
2. Adding all files
git add .
Note:below only pushes the changes to local repo
3.git commit -m "Changes"
@arjunKumbakkara
arjunKumbakkara / SessionBasedGuiLoadTest
Created March 13, 2019 13:30
This JMX(Jmeter) test plan allows to record and fire with a load of Thread servers (Remember to set the manual proxy to Localhost:8888 , So that the requests to a session based gui is via this test plan thus allowing the load test.Use session Manager importantly)
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="3.2" jmeter="3.2 r1790748">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
@arjunKumbakkara
arjunKumbakkara / Truncate Table with Foreign Key Constraints
Created March 13, 2019 11:14
Truncate a table with Foreign Key Constraints (If the SET FOREIGN KEY =0 doesnt work then)
Classic method: Turn off the Foreign Keys and
#SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS;
#SET FOREIGN_KEY_CHECKS=0;
DO YOUR CHANGES!!
#SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
@arjunKumbakkara
arjunKumbakkara / SecurityContractCheck.java
Created March 6, 2019 06:56
Loops through a given JSON and does field by field verification against a set of configured Security tags
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;