Skip to content

Instantly share code, notes, and snippets.

@erangaeb
erangaeb / solana-cli
Last active September 5, 2024 21:02
install solana cli
# put solana cli inside ~/.solana directory
mkdir ~/.solana
cd ~/.solana
# download and unzip binary
wget https://github.com/solana-labs/solana/releases/download/v1.8.5/solana-release-x86_64-apple-darwin.tar.bz2
tar jxf solana-release-x86_64-apple-darwin.tar.bz2
@erangaeb
erangaeb / w-538.json
Last active June 26, 2024 03:14
w-528 nft schema to represent medicine recipe
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Medical Recipe NFT",
"type": "object",
"properties": {
"tokenId": {
"type": "string",
"description": "Unique identifier for the NFT"
},
"recipeName": {
@erangaeb
erangaeb / lxc_install_mongodb
Last active February 23, 2024 14:12
Install mongodb in lxc container
# GPG keys
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
# list file for MongoDB
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
# install
sudo apt-get update
sudo apt-get install -y mongodb-org
--------------------------- MODULE BlockchainTransactions ---------------------------
EXTENDS Integers, Sequences, TLC
(*-- Constants used in the specification --*)
CONSTANT Clients, KafkaNodes, SmartContracts, StorageNodes, CacheNodes, LokkaServices
(*-- The set of all possible transactions --*)
VARIABLE transactions, messageBroker, blockchainStorage, distributedCache, blocks
(* -- Define the initial state of the blockchain system --*)
@erangaeb
erangaeb / ipfs-cluster-secret
Created May 25, 2022 03:00
generate ipfs cluster secret
# generate cluster secret
export CLUSTER_SECRET=$(od -vN 32 -An -tx1 /dev/urandom | tr -d ' \n')
echo $CLUSTER_SECRET
# this is the generated cluster secret
e23e876e6742615eca9aefdc05943fa0d1bbc18f7d0a4f27e22ff8931fc56624
@erangaeb
erangaeb / podman
Created April 25, 2023 03:34
install podman
# install podman
❯❯ brew install podman
# initializes a new Linux runtime envirounment which known as podman machine
# podman behind the scene uses quem emulator to provide linux runtem envirounment
# --cpus 4 (specify cpus)
# --memory=6144 (specify memory)
❯❯ podman machine init --cpus 4 --memory=6144
# list podman machines
@erangaeb
erangaeb / docker-compose.yml
Created November 12, 2022 10:07
deployment of vault with consul storage backend
version: '3.8'
services:
vault-consul:
image: erangaeb/vault-consul:0.1
ports:
- 8200:8200
environment:
- VAULT_ADDR=http://127.0.0.1:8200
- VAULT_API_ADDR=http://127.0.0.1:8200
@erangaeb
erangaeb / minikube
Created November 7, 2021 10:33
configure docker0 bridge
# the default docker0 bridge inside minikube
minikube ssh
ifconfig
>> output
docker0 Link encap:Ethernet HWaddr 02:42:E1:6D:15:33
inet addr:172.17.0.1 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:311191 errors:0 dropped:0 overruns:0 frame:0
TX packets:307842 errors:0 dropped:0 overruns:0 carrier:0
@erangaeb
erangaeb / minikube
Last active November 14, 2023 17:37
configure memory and cpu
# by default minikube alloca 2 cpus and 2 gb memory
minikube start
# delete existing minikube instance and allocate more memory/cpu on start up
minikube stop
minikube delete
minikube start --memory 8192 --cpus 4
>> 🔥 Creating hyperkit VM (CPUs=4, Memory=8192MB, Disk=20000MB)
# keep existing minikube instance and allocate more memory/cpu
{
"token_id": "pbom123",
"timestamp": "2023-11-01T12:30:00Z",
"package": {
"package_id": "pkg789",
"package_name": "example_app"
},
"pull_requests": [
{
"id": "pr456",