$ docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.0; | |
contract MyContract { | |
// State variables | |
uint public myVariable; | |
// Events | |
event MyEvent(uint indexed value); | |
// Constructor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CryptoJS = require('crypto-js'); | |
// Create an array of data items | |
const data = ['data1', 'data2', 'data3', 'data4']; | |
// Function to generate Merkle tree | |
function generateMerkleTree(data) { | |
if (data.length === 0) return []; | |
if (data.length === 1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Root | |
| | |
----------------------------------- | |
| | | |
0x123 0x456 | |
| | | |
------------------- ------------------- | |
| | | | | |
"balance" "nonce" "storage" "code" | |
| | | | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
function calculateMerkleRoot(transactions) { | |
if (transactions.length === 0) { | |
return null; | |
} | |
// Create a copy of the transactions array | |
let hashes = [...transactions]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
// Block Header | |
const version = 1; | |
const previousBlockHash = 'ABC123'; | |
const merkleRoot = 'XYZ789'; | |
const timestamp = 1642931200; | |
let nonce = 0; | |
// Difficulty Target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
// Transactions | |
const transactions = ['T1', 'T2', 'T3', 'T4', 'T5']; | |
// Merkle Root Calculation | |
function calculateMerkleRoot(transactions) { | |
if (transactions.length === 0) { | |
return null; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If your time does not permit the close supervision of your project then i am here for your help related with LAMP or LEMP Stack and others. | |
Contact Me For Engaged Your Works: | |
Telegram: https://t.me/LinuxGun | |
WhatsApp: https://wa.link/5ow7oz | |
#!/bin/bash | |
# This will remove Apache | |
sudo service apache2 stop | |
sudo apt-get purge apache2 apache2-utils apache2.2-bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
du -hsx -- * | sort -rh | head -10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!usr/bin/python | |
""" | |
Sample python script to migrate documents from mongodb to apache couchdb database. | |
This script reads a document from mongodb and writes it to couchdb database. | |
**Script does not support the use case for 'documents with attachments' | |
""" | |
from bson import json_util, objectId | |
import json | |
from argparse import ArgumentParser | |
import requests |