Skip to content

Instantly share code, notes, and snippets.

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.
@shiva1333
shiva1333 / 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,
@shiva1333
shiva1333 / RateLimiter.go
Created February 18, 2022 11:08
Basic rate limiter in Go
package main
import (
"context"
"fmt"
"log"
"sync"
"time"
)
@shiva1333
shiva1333 / 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
@shiva1333
shiva1333 / 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
@shiva1333
shiva1333 / verify-structured-logging.sh
Created September 18, 2021 11:17
Modified kubernetes/hack/verify-structured logging for https://github.com/kubernetes/kubernetes/issues/105101
#!/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
#
@shiva1333
shiva1333 / 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:

@shiva1333
shiva1333 / 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
@shiva1333
shiva1333 / fetchLic.py
Created March 30, 2019 23:44
Script to update dump data from https://github.com/spdx/license-list-data into a csv file to populate data base.
import json, csv
import os
def Sort(sub_li):
sub_li.sort(key = lambda x: x[0])
return sub_li
files = next(os.walk("./license-list-data/json/details"))[2]
lic_dir = 'license-list-data/json/details'
csv_data = []