Skip to content

Instantly share code, notes, and snippets.

View j-thepac's full-sized avatar

Deepak j-thepac

View GitHub Profile
@j-thepac
j-thepac / important_azure.sql
Last active February 21, 2025 10:39
Import Queries Azure SQL
/* Performance */
-- Do analysis using below queries
-- Also SQL logs in UI
- Open Azure Portal Homepage
- Search for Dedicated SQL pool
- Click on the Dedicated SQL Pool > Monitoring > metrice > filter DWU used - note down time
- Goto Query Activity and corelaetd the query executed in the above time

TerraForm

  1. Create "n" nos of clould apps ,Online Apps , Link and Configure
  2. InfraStructure as Code (IAC)

Files Structure :

Pre-Req :

  • main.tf - Main File
  • dependencies.tf (depends_on) - Pre-Req
  • required_providers.tf - Download Interface communicate to target
@j-thepac
j-thepac / Tree_traversal.py
Created September 1, 2024 14:34
Tree Traversal - BFS , DFS , BFS_graph, DFS_graph
class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
def BFS(self,root):
if root is None: return
queue = [root]
while queue:
@j-thepac
j-thepac / syncMulitThreadVsNormal.py
Created August 14, 2024 07:51
To check the performance of Normal Operation vs MulitThreaded Operations
'''
Excercise for Async Multithreaded vs Normal
Problem :
1. To call 2 api
2. Get the response
3. Convert the response data into pandas Dataframe
RUN 1 :
Time take by Async multithreaded = 0.4613368511199951
@j-thepac
j-thepac / Promethus_Grafana.md
Last active July 28, 2024 05:13
Kubernetes ,Promethus and Grafana

Kubernetes with Prometheus and Grafane

  • Helm Chart : Package installer for kubernetes

  • Prometheus: Open-source monitoring and alerting toolkit ( A Prometheus deployment needs dedicated storage space to store scraping data)

  • Grafana : visualization, and observability in Prometheus

1. Pre-Req

minikube start 		# minikube start --memory='12g' --cpus='4' -n 3
@j-thepac
j-thepac / multiThread.py
Created July 21, 2024 16:22
MultiThread in Python
'''
threading
1. No return
2. Can run seperatr function
concurrent.futures
1. Return
2. Only run 1 Function in 1 map
'''
@j-thepac
j-thepac / async.py
Created July 21, 2024 16:20
Async in Python
'''
Calling Normal Function using Async Functions
1. to_thread
2. gather+to_thread
Calling ASync Function using Async Functions
1. No need of to_thread
2. only gather
'''
'''
find max_duration, avg_duration for each CPID using Duration , round numbers to 2 deciaml places
ChargingEvent CPID StartDate StartTime EndDate EndTime Energy PluginDuration
16673806 AN11719 31/12/17 14:46:00 31/12/17 18:00:00 2.4 3.2333333333333334
16670986 AN01706 31/12/17 11:25:00 31/12/17 13:14:00 6.1 1.8166666666666667
3174961 AN18584 31/12/17 11:26:11 01/01/18 12:54:11 24 25.466666666666665
16674334 AN00812 31/12/17 15:18:00 01/01/18 14:06:00 6.7 22.8
3176831 AN24139 31/12/17 18:25:18 01/01/18 13:09:18 6.1 18.733333333333334
16673920 AN03984 31/12/17 14:54:00 31/12/17 19:19:00 5.6 4.416666666666667
@j-thepac
j-thepac / Digital_routes_employee.sql
Created July 20, 2024 13:26
Digital_routes_employee
/*
id,name,salary,boss
10,k,1500,50
50,H,3000,10
10,J,4500,20
20,K,10000,NULL
70,J,1500,10
60,Oliver,2000,70
30,L,1501,50
@j-thepac
j-thepac / Digitals_routes_players.sql
Last active July 20, 2024 13:51
Digitals_routes_players
/*
To create a table with group_id and winner_id based on below logic
Expected Result
group_id,winner_id
1,45
2,20
3,40
In matches tables