Skip to content

Instantly share code, notes, and snippets.

@bellflower2015
bellflower2015 / chainparams.cpp
Last active August 25, 2023 05:55
Calculating Genesis Block
// ... snip ...
#include <arith_uint256.h>
// ... snip ...
class CMainParams : public CChainParams {
public:
CMainParams() {
@omarbaruzzo
omarbaruzzo / gist:a86a65d890ed823013315ea2d3727c2d
Created June 28, 2018 13:21
GenesisCalculator - code to be included in chainparams.cpp to calculate the genesis block, nnonce, merkle root etc.
#include "arith_uint256.h"//Mod.
//----------------------------------------------------------------------------------------------------------
//Mod.
/*
// calcolo del Blocco Genesi
// Resettiamo il valore del blocco
consensus.hashGenesisBlock = uint256S("0x");
std::cout << std::string("Iniziamo a calcolare il blocco:\n");
if (true && (genesis.GetHash() != consensus.hashGenesisBlock)) {
@aviafelix
aviafelix / another_patcher.py
Last active February 26, 2024 02:32
Patching binary files with Python
#/usr/bin/env python3
"""
Yet another simple binary patcher
"""
patches = [
{
# 1 Windows x64, version 3, build 1234
'file': 'file_1.bin',
'offset': 0x0BA950,
'original': b'\x00',
@chazu
chazu / genesis.txt
Created February 17, 2018 16:54 — forked from moh53n/genesis.txt
This code is from "http://dillingers.com/blog/2015/04/18/how-to-make-an-altcoin" with some changes for newer versions of Bitcoin. Use this for mine the genesis block for a new coin.
/**
* This code is from "http://dillingers.com/blog/2015/04/18/how-to-make-an-altcoin" with some changes for newer versions of Bitcoin.
* Use this for mine the genesis block for a new coin.
* Put this before "consensus.hashGenesisBlock = genesis.GetHash();"
*/
/////////GENESIS MINING///////////////
/*
printf("Genesis mining started\n");
genesis.nNonce = 0;
consensus.hashGenesisBlock = uint256S("0x001");
'use strict'
var sqlite = require('sqlite3').verbose();
var db = new sqlite.Database('test_db');
db.getAsync = function (sql) {
var that = this;
return new Promise(function (resolve, reject) {
that.get(sql, function (err, row) {
if (err)
@rickdaalhuizen90
rickdaalhuizen90 / index.html
Created April 1, 2017 19:40
Render html page with node.js
<h1>Hello world!</h1>
@moh53n
moh53n / genesis.txt
Created January 14, 2017 16:03
This code is from "http://dillingers.com/blog/2015/04/18/how-to-make-an-altcoin" with some changes for newer versions of Bitcoin. Use this for mine the genesis block for a new coin.
/**
* This code is from "http://dillingers.com/blog/2015/04/18/how-to-make-an-altcoin" with some changes for newer versions of Bitcoin.
* Use this for mine the genesis block for a new coin.
* Put this before "consensus.hashGenesisBlock = genesis.GetHash();"
*/
/////////GENESIS MINING///////////////
/*
printf("Genesis mining started\n");
genesis.nNonce = 0;
consensus.hashGenesisBlock = uint256S("0x001");
@Brainiarc7
Brainiarc7 / gifenc.sh
Created December 17, 2016 16:08 — forked from dplesca/gifenc.sh
#gif with text overlay #generator using #ffmpeg - inspired by http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
#!/bin/bash
#parameters:
# $1 - mp4 url
# $2 - start time in format hh:mm:ss.mic
# $3 - duration in seconds
# $4 - text for gif overlay
# $5 - output file without extension
if [ "$#" -ne 5 ]
then
echo "Usage: gifenc.sh \$1 \$2 \$3 \$4 \$5
@daliborgogic
daliborgogic / delay.js
Created December 16, 2016 15:26
Node.js Async/Await delay
'use strict'
const timeout = ms => new Promise(res => setTimeout(res, ms))
function convinceMe (convince) {
let unixTime = Math.round(+new Date() / 1000)
console.log(`Delay ${convince} at ${unixTime}`)
}
async function delay () {
@h-yamamo
h-yamamo / ChaCha+Camellia.md
Last active March 18, 2022 08:19
Support ChaCha20-Poly1305 and Camellia-GCM for debian and ubuntu openssl package

Support ChaCha20-Poly1305 and Camellia-GCM for debian and ubuntu openssl package

In order to easily build, I made sets of patches that resolved conflicts (chacha20-poly1305, camellia-gcm, equal-preference-group).

How to build

  • Required packages: packaging-dev, lzip / Preparation: sudo apt-get build-dep openssl or openssl1.0

Ubuntu 16.04 LTS (xenial)