Skip to content

Instantly share code, notes, and snippets.

View sanketsudake's full-sized avatar

Sanket Sudake sanketsudake

View GitHub Profile
@sanketsudake
sanketsudake / add-cloned-submodule
Created April 11, 2024 08:37
Add already cloned repo as submodules
for i in $(find example-sources -type d -depth 1)
do
echo $i
pushd $i
url=$(git remote get-url $(git remote))
echo $url
popd
git submodule add $url ./$i
done
@sanketsudake
sanketsudake / AWS Bedrock PDF Summary with langchain.md
Last active January 5, 2024 05:31
PDF summarizer with langchain and Amazon Bedrock Titan

Usage

  • Setup python dependencies from requirements.txt
  • Source your AWS enviroment credentials.
    • Enable Amazon bedrock amazon.titan-text-express-v1 model for access
    • AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN(optional)
  • Run python pdf_summary.py
    python pdf_summary.py
    

Running on local URL: http://127.0.0.1:7860

@sanketsudake
sanketsudake / fission-kafka-mqt-dashboard.json
Created November 28, 2022 10:11
Fission Kafka MQT dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
# Reference: https://sharats.me/posts/shell-script-best-practices/
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ -n "${TRACE-}" ]]; then
set -o xtrace
fi
@sanketsudake
sanketsudake / dump-analyzer
Last active November 13, 2022 07:55
Dump Analyzer for Fission
#!/usr/bin/env bash
###
# This script is used to analyze the dump files generated by the Fission CI.
###
set -o errexit
set -o nounset
set -o pipefail
if [[ -n "${TRACE-}" ]]; then
set -o xtrace
fi
@sanketsudake
sanketsudake / kind-kubernetes-metrics-server.md
Last active April 5, 2024 07:06
Running metric-server on Kind Kubernetes

I have created a local Kubernetes cluster with kind. Following are changes you need to get metric-server running on Kind.

Deploy latest metric-server release.

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.5.0/components.yaml

Within existing arguments to metric-server container, you need to add argument --kubelet-insecure-tls.

The Problem

Alice and Bob have accounts at Bankgroup. Each account has 0 or more dollars in it.

Bankgroup wants to add a new “wire” feature, where any user can transfer money to any other user. This feature has the following requirements:

  • Each wire must be between two different people in the bank and wire at least one dollar.

  • If a wire is successful, the value of the wire is deducted from the sender account and added to the receiver account.

@sanketsudake
sanketsudake / easy_cloning.md
Created January 17, 2019 06:46
Cloning repo with ease
  1. Add in .gitconfig url shortcut
[url "git@github.com:infracloudio/"]
    insteadOf = inf:
  1. Clone repo with ease
@sanketsudake
sanketsudake / boto3_assume_role.py
Last active February 22, 2019 21:43
Assume role for AWS cross-account with boto 3
import logging
import boto3
import dateutil
logger = logging.getLogger()
logger.addHandler(logging.StreamHandler()) # Writes to console
logger.setLevel(logging.INFO)
def create_sts_client(aws_access_key_id=None,
ISSUE SUMMARY
DETAILED DESCRIPTION OF IMPACT
ROOT CAUSE
REMEDIATION AND PREVENTION