Skip to content

Instantly share code, notes, and snippets.

View thackerronak's full-sized avatar

Ronak Thacker (smartSense) thackerronak

  • smartSense solutions
  • Ahmedabad
View GitHub Profile
NodeJS Chaincode Deploy and Test
start Docker
cd /fabric-samples/basic-network /basic network
Edit docker-compose.yml change line no 72 comment and 73 uncomment. //prod to devp network
Edit start.sh add ‘cli’ in 15 no. line (docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com peer0.org1.example.com couchdb cli)
./start.sh //run start script to up network
docker logs -f peer0.org1.example.com //log (1 terminal)
docker exec -it cli bash //peer (2 terminal)
cd /fabric-samples/chaincode/hyperledger/fabric/peer/nodefiles (3 terminal)
@thackerronak
thackerronak / AESHelper.java
Last active September 5, 2024 16:35 — forked from armanso/AES.java
AES encryption/decryption in crypto-js way, use KDF for generating IV and Key, use CBC with PKCS7Padding for Cipher
import com.sun.jersey.core.util.Base64;
import java.io.UnsupportedEncodingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Random;
import javax.crypto.BadPaddingException;
@thackerronak
thackerronak / index.js
Created December 2, 2022 06:09
JS/JavaScript extract query params as array from URL
/*
Input : https://www.amazon.com/s?k=mac+book&crid=25WTZ65PMNIO8&sprefix=mac+book%2Caps%2C278&ref=nb_sb_noss_2
Output :
[
{
"k": "mac+book"
},
{
"crid": "25WTZ65PMNIO8"
},