Skip to content

Instantly share code, notes, and snippets.

View sanketsudake's full-sized avatar

Sanket Sudake sanketsudake

View GitHub Profile
// Unit testing is an important part of writing
// principled Go programs. The `testing` package
// provides the tools we need to write unit tests
// and the `go test` command runs tests.
// For the sake of demonstration, this code is in package
// `main`, but it could be any package. Testing code
// typically lives in the same package as the code it tests.
package main
@sanketsudake
sanketsudake / go-cache.md
Last active February 6, 2025 03:38
Go Cachec Checking and Cleanup

Check Go Cache Size

du -sh $(go env GOCACHE)

Check largest files in cache

find $(go env GOCACHE) -type f | xargs du -s | sort -n
@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 April 22, 2025 16:41
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 December 27, 2025 07:49
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