Skip to content

Instantly share code, notes, and snippets.

View shivanshuraj1333's full-sized avatar

Shivanshu Raj Shrivastava shivanshuraj1333

View GitHub Profile
@shivanshuraj1333
shivanshuraj1333 / Demo.md
Last active August 26, 2024 22:53
DRA example demo

-> Machine configuration

2 Nvideia GPU A100 with 40 Gb capacity which supports MIG

-> Show the current GPU configuration

command

nvidia-smi -L

-> Docker is configured to use Nvidia container runtime, meaning docker can access GPU slices using nvidia runtime

2023-03-06T11:43:58.165346Z info envoy wasm external/envoy/source/extensions/common/wasm/context.cc:1148 wasm log istio-system.swimlane-headers-propagate: srs cluster inbound|9080|| thread=23
2023-03-06T11:43:58.165510Z info envoy wasm external/envoy/source/extensions/common/wasm/context.cc:1148 wasm log istio-system.swimlane-headers-propagate: srs plugin name thread=23
2023-03-06T11:43:58.165938Z info envoy wasm external/envoy/source/extensions/common/wasm/context.cc:1148 wasm log istio-system.swimlane-headers-propagate: srs inbound header x-swimlane alpha thread=23
2023-03-06T11:43:58.166006Z info envoy wasm external/envoy/source/extensions/common/wasm/context.cc:1148 wasm log istio-system.swimlane-headers-propagate: srs inbound header x-swimlane-service-index %!s(T=0) thread=23
2023-03-06T11:43:58.166055Z info envoy wasm external/envoy/source/extensions/common/wasm/context.cc:1148 wasm log istio-system.swimlane-headers-propagate: request header --> :authority: 34.83.143.178 thread=23
2023-03-06T11:43:58.
@shivanshuraj1333
shivanshuraj1333 / main.go
Created March 6, 2023 12:24
Header propagation
// Copyright 2020-2021 Tetrate
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@shivanshuraj1333
shivanshuraj1333 / RateLimiter.go
Created February 18, 2022 11:08
Basic rate limiter in Go
package main
import (
"context"
"fmt"
"log"
"sync"
"time"
)
@shivanshuraj1333
shivanshuraj1333 / formatter.go
Created November 12, 2021 08:31
Custom formatter for pods and nodes of package `pkg/scheduler/internal/cache/debugger/formatter.go` in `kubernetes`
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@shivanshuraj1333
shivanshuraj1333 / formatter_test.go
Created November 9, 2021 11:27
unit test for `formatter.go` in `kubernetes/pkg/scheduler/internal/cache/debugger`
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
#!/usr/bin/env bash
# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@shivanshuraj1333
shivanshuraj1333 / README.md
Last active July 2, 2021 19:15
Solution for Chaincode Labs LN Seminar : 1) LND

This gist contains the solution for Chaincode Labs LN Seminar task 1. LND Note: The updated test file lnd_single_hop_invoice_test.go is added below.

Problem Statement:

In https://github.com/lightningnetwork/lnd/blob/6d661334599ffa2a409ad6b0942328f9fd213d09/lntest/itest/lnd_single_hop_invoice_test.go#L24-L33 Alice sends payment to Bob. Add a new node (Carol), open a channel from Bob to Carol and then send a payment from Alice to Bob to Carol. Create a gist and please include the modifications you made and an output of the test you created.

Steps to run the test:

  1. If LND repository is not present in your local system run git clone https://github.com/lightningnetwork/lnd

Install venv:

 sudo apt install -y python3-venv

Create a Virtual Environment:

python3 -m venv my_env

Activate Virtual Environment:

source my_env/bin/activate

Deactivate Virtual Environment:

@shivanshuraj1333
shivanshuraj1333 / update_csv.py
Last active April 3, 2019 17:58
Script to update latest lic. version data from https://github.com/spdx/license-list-data/releases into a csv file to populate data base.
import json, csv
import requests
def Sort(sub_li):
sub_li.sort(key = lambda x: x[0])
return sub_li
csv_data = []
url = 'https://api.github.com/repos/spdx/license-list-data/releases/latest'
#get latest version release info in form of tag