Skip to content

Instantly share code, notes, and snippets.

View sudeepdino008's full-sized avatar

sudeep sudeepdino008

View GitHub Profile
@sudeepdino008
sudeepdino008 / memalloc.c
Last active May 8, 2022 16:10
malloc and free
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
typedef struct free_l {
size_t chunk_size;
struct free_l* previous;
@sudeepdino008
sudeepdino008 / block-specimen.json
Created May 16, 2022 19:18
sample block specimen from rinkeby network
{
"Type": "block-replica",
"NetworkId": 4,
"Hash": "0xd32276e96ac6b9c294279928c0153dc5d44e22632058776d571b230ee6e9c7a9",
"TotalDifficulty": 17319955,
"Header": {
"parentHash": "0x5001b3290cdeb2e8ec2d2004a2d7a1923a03690a0fa25056da6cd970c7b9ef4a",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"miner": "0x0000000000000000000000000000000000000000",
"stateRoot": "0x3ca517697b68f7b8eb16fdcb8e84c2a493ead86007a5ef38ca75b0cde22d6412",
@sudeepdino008
sudeepdino008 / argbash_generator
Created May 26, 2022 10:45
generate bash cli parsing code using argbash template
#!/bin/bash
#
# This is a rather minimal example Argbash potential
# Example taken from http://argbash.readthedocs.io/en/stable/example.html
#
# ARG_OPTIONAL_SINGLE([geth_location], , [location of geth codebase], [./bsp-geth])
# ARG_OPTIONAL_SINGLE([erigon_location], , [location of erigon codebase], [./cov-erigon])
# ARG_OPTIONAL_SINGLE([output_location], , [location of output directory], [./outputs])
# ARG_OPTIONAL_BOOLEAN([build_geth], , [should re-build geth?], off)
# ARG_OPTIONAL_BOOLEAN([build_erigon], , [should re-build erigon?], off)
@sudeepdino008
sudeepdino008 / block-replica.json
Created July 20, 2022 12:46
block replica for block - 15173593
This file has been truncated, but you can view the full file.
{ "codecVersion": 0.2, "elements": 1, "endBlock": 15173593, "replicaEvent": [ { "data": { "Hash": "0x05e3dd247a38afe45d6e6dee3429fdcf72caa25e078c13afbc0ef89846b80752", "Header": { "baseFeePerGas": 54243931946, "difficulty": 11879742875104400, "extraData": "U0JJQ3J5cHRvLmNvbSBQb29sKGV1KQ==", "gasLimit": 29999972, "gasUsed": 24706132, "logsBloom": [ 158, 44, 241, 251, 169, 222, 255, 182, 120, 184, 221, 158, 174, 253, 99, 160, 51, 63, 190, 61, 190, 85, 141, 95, 88, 149, 253, 46, 183, 229, 243, 69, 221, 255, 225, 204, 165, 252, 73, 239, 195, 245, 215, 8, 126, 223, 239, 103, 138, 232, 209, 250, 254, 33, 187, 125, 246, 198, 204, 61, 107, 119, 170, 255, 45, 238, 94, 252, 206, 118, 223, 234, 255, 154, 127, 31, 165, 7, 249, 244, 114, 182, 187, 164, 6, 124, 243, 199, 220, 238, 15, 223, 211, 227, 251, 229, 50, 166, 255, 207, 155, 243, 84, 175, 199, 117, 248, 187, 141, 53, 46, 239, 183, 7, 220, 108, 130, 211, 215, 217, 199, 79, 44, 191, 228, 43, 190, 239, 62, 20, 175, 213, 58, 75, 92, 246, 180, 235, 75, 195, 153, 183, 41
@sudeepdino008
sudeepdino008 / deep-diff.sh
Last active November 1, 2022 14:54
deep diff of json files: ./deep-diff <file1> <file2>
#!/bin/sh
out1=$(mktemp)
out2=$(mktemp)
trap "rm -f $out1 $out2" 0 2 3 15
jq -S '.' $1 > out1
jq -S '.' $2 > out2
@sudeepdino008
sudeepdino008 / 15084335.specimen.json
Created January 2, 2023 05:08
block specimen for eth block 15084335
{
"Type": "block-specimen",
"NetworkId": 1,
"Hash": "0x6cae5c317d2e9b2f83c831227d244cf898802da0f92225699ccc79a26d66b15e",
"TotalDifficulty": 0,
"Header": {
"parentHash": "0xa9fbbd05cfffb723f62e1e2a74b2d1e902b0519dec301d37cad783a8caf3f901",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"miner": "0x2a20380dca5bc24d052acfbf79ba23e988ad0050",
"stateRoot": "0xd49a70e44ab7a61b0e39ebd52187f534fee2320831a3fb66704d687b162cb90e",
@sudeepdino008
sudeepdino008 / evm_transition_build_script.sh
Last active February 24, 2023 10:56
build script for evm transition tool
#!/bin/bash
#
# This is a rather minimal example Argbash potential
# Example taken from http://argbash.readthedocs.io/en/stable/example.html
#
# ARG_OPTIONAL_SINGLE([evm_tool_version],[],[version of evm tool to be used],[latest])
# ARG_OPTIONAL_SINGLE([output_location],[],[output location of generated evm binary],[./])
# ARG_OPTIONAL_SINGLE([repo_download_location],[],[location of repo to be downloaded],[./])
# ARG_OPTIONAL_BOOLEAN([remove_repo],[],[should delete repo once build is done?],[off])
# ARG_HELP([builds evm transition tool)])
This file has been truncated, but you can view the full file.
Ñ0x4a45fb8ad6c9963a874806a3f2331122c82c62701b76072b0d772180e8c93951block-replicaÑ0x4a45fb8ad6c9963a874806a3f2331122c82c62701b76072b0d772180e8c93951*0xc70d815d562d3cfa955Ñ0xdd2083679090d34df714ea51bdff4bd68d1952336c86aed05deaacf3637892ecÑ0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347T0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5Ñ0xf0ac6a47319b3d689c6c381c09121e004da377a2aa7fa6af4f7b3add5041bbe4Ñ0x09056176add9b3de1e0cdf74d7ad5845874e76af3258fe669c1b6238ed3ad31fÑ0x3aa6ad119e95854c5112cecb09fc414bf28f39afdd4431e42b0af0cc2e65fc32Ä~Úî‘Ú™.‰lê<ƒ¿äb≤»å2Zûfí¿‚™Æ>–§ ¶ÜË$∞Æ ∂û$,2FÜ∆åÇÙƒ⁄ÇÊbé.ÿ˛Ë∫$Ϭ`òˆ⁄‚“¿Í‡ƒ≤4ÇËb»>‰∏†Ä8\$–.∆ñåÃ|ö∏äfi2r* ¥∂™∆∏8ƒÆ†∏§îZ˛Ë‰“§™∆∞¯¬ò ÜÜfi¢$xä˙“∏êÏTÇæ¬æÊfi∞“Ê2Æ–Z‰r»∞ö§ä¬Ë∫‹,¨ŒÄéD∆分˙ÆÆfÑú\l™j∞¨˛ÓêÚ¨†⁄˛⁄™ÏàÙ\>˙‰Ï˛Ï⁄–¿îP¨à:ƒ@¬–J<åBÚ≤Óåæ¯ÄäòÓÄ0x00xfd1281ÄéŒˇìÊ»û
@sudeepdino008
sudeepdino008 / block-replica.json
Last active September 26, 2023 16:11
block-replica example
{
"elements": 1,
"endBlock": 15084335,
"replicaEvent": [
{
"data": {
"Hash": "0x6cae5c317d2e9b2f83c831227d244cf898802da0f92225699ccc79a26d66b15e",
"Header": {
"baseFeePerGas": 48090598751,
"difficulty": 11905180535994968,