Skip to content

Instantly share code, notes, and snippets.

View adityajoshi12's full-sized avatar
🎯
Focusing

Aditya Joshi adityajoshi12

🎯
Focusing
View GitHub Profile
2024-04-20 08:07:46.968 UTC [viperutil] getKeysRecursively -> DEBU 001 Found map[interface{}]interface{} value for metrics
2024-04-20 08:07:46.968 UTC [viperutil] unmarshalJSON -> DEBU 002 Unmarshal JSON: value cannot be unmarshalled: invalid character 'p' looking for beginning of value
2024-04-20 08:07:46.968 UTC [viperutil] getKeysRecursively -> DEBU 003 Found real value for metrics.Provider setting to string prometheus
2024-04-20 08:07:46.968 UTC [viperutil] getKeysRecursively -> DEBU 004 Found map[string]interface{} value for metrics.Statsd
2024-04-20 08:07:46.968 UTC [viperutil] unmarshalJSON -> DEBU 005 Unmarshal JSON: value cannot be unmarshalled: invalid character 's' after top-level value
2024-04-20 08:07:46.968 UTC [viperutil] getKeysRecursively -> DEBU 006 Found real value for metrics.Statsd.WriteInterval setting to string 30s
2024-04-20 08:07:46.968 UTC [viperutil] unmarshalJSON -> DEBU 007 Unmarshal JSON: value is not a string: <nil>
{
"channel_group": {
"groups": {
"Consortiums": {
"groups": {
"uatuat": {
"groups": {
"struatwalamMSP": {
"groups": {},
"mod_policy": "Admins",
@adityajoshi12
adityajoshi12 / docker-compose.yaml
Created August 19, 2023 12:40
etcd cluster docker compose
x-variables:
flag_initial_cluster_token: &flag_initial_cluster_token '--initial-cluster-token=mys3cr3ttok3n'
common_settings: &common_settings
image: quay.io/coreos/etcd:v3.5.9
entrypoint: /usr/local/bin/etcd
ports:
- 2379
services:
etcd-1:
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
@adityajoshi12
adityajoshi12 / caesar-cipher.go
Created July 29, 2023 12:06
Caesar Cipher is a simple substitution cipher that shifts characters in the plaintext by a fixed number of positions to generate ciphertext.
package main
import (
"fmt"
)
// Function to perform Caesar Cipher encryption
func caesarEncrypt(plaintext string, shift int) string {
ciphertext := ""
for _, char := range plaintext {
@adityajoshi12
adityajoshi12 / slice.go
Created June 24, 2022 07:42
Golang slice utility functions
//Intersection returns the lists of all the elements that are common to both slices.
func Intersection(a, b interface{}) []interface{} {
set := make([]interface{}, 0)
hash := make(map[interface{}]bool)
av := reflect.ValueOf(a)
bv := reflect.ValueOf(b)
for i := 0; i < av.Len(); i++ {
el := av.Index(i).Interface()
hash[el] = true
@adityajoshi12
adityajoshi12 / install-java.sh
Created October 4, 2021 16:25
java installation on ubuntu
sudo apt update
sudo apt install default-jre -y
sudo apt install default-jdk -y
sleep 2
echo "export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java" >> ~/.profile
sleep 2
source ~/.profile
caliper:
benchconfig: ./benchmarks/assetCCBenchmark.yaml
networkconfig: ./networks/networkConfig.yaml
bind:
sut: fabric:2.2
report:
path: ./report.html
logging:
template: "%timestamp%%level%%module%%message%%metadata%"
formats:
'use strict';
const { WorkloadModuleBase } = require('@hyperledger/caliper-core');
class MyWorkload extends WorkloadModuleBase {
constructor() {
super();
}
async initializeWorkloadModule(workerIndex, totalWorkers, roundIndex, roundArguments, sutAdapter, sutContext) {
'use strict';
const { WorkloadModuleBase } = require('@hyperledger/caliper-core');
class MyWorkload extends WorkloadModuleBase {
constructor() {
super();
this.txIndex = -1;
this.colors = ['red', 'blue', 'green', 'black', 'white', 'pink', 'rainbow'];
this.owners = ['Alice', 'Bob', 'Claire', 'David'];