Skip to content

Instantly share code, notes, and snippets.

View uniibu's full-sized avatar
🏠
Don't comment bad code - rewrite it

Uni Sayo uniibu

🏠
Don't comment bad code - rewrite it
View GitHub Profile
@uniibu
uniibu / lnd.update.v0.10.4-beta.sh
Last active September 7, 2020 21:09
Raspiblitz Manual LND Install
#!/bin/bash
# "*** Raspiblitz Manual LND ***"
## Copied from https://github.com/rootzoll/raspiblitz/blob/v1.6/build_sdcard.sh#L97-L108
echo "Detect CPU architecture ..."
isARM=$(uname -m | grep -c 'arm')
isAARCH64=$(uname -m | grep -c 'aarch64')
isX86_64=$(uname -m | grep -c 'x86_64')
if [ ${isARM} -eq 0 ] && [ ${isAARCH64} -eq 0 ] && [ ${isX86_64} -eq 0 ] ; then
echo "!!! FAIL !!!"
Update your qtum client to Mainnet Ignition v0.19.1 https://github.com/qtumproject/qtum/releases/tag/mainnet-ignition-v0.19.1
Then run the following commands:
1. qtum-cli invalidateblock 29f0c1bf7382e8475cae39f89040a6a036761327f4b90cd138affd7cd88d0010
2. qtum-cli reconsiderblock 29f0c1bf7382e8475cae39f89040a6a036761327f4b90cd138affd7cd88d0010
enode://4d13bd3dfba3247276a06ea6a95b624a728515fe7d32f9f09a88ea346fc11491fd0b5b69ef41111fc051920fbc8be0b97a02e30c55b238a3128ea2217b8205ec@151.80.102.25:57850
enode://3e2cae51aa325fbec95a4e27d8eb2c657a5fe628ccc0ff11aec6de19a4d81244f3577d97f37c8a3057b5e5eb553034dacd98bb160b1b1b92e2f44e9643d1be55@34.67.158.219:40608
enode://9b2af51dc4f00ec63e723f0d7d45689457495f9f2ba8e5df3a764795c86ccb28533e9bf431def46e69e1fb006188ca693832d19318218dccc0b34a08c516cf22@100.24.116.235:40456
enode://de02cac9ade6e25790e9451fe32e52aa6d2c19a42c3a384b16402da1bd5a17a0cc9006f3801e813e17d61dad43579e96bda32693d6b3c72604c5b1d5ad3c29b7@123.190.64.17:63520
enode://81863f47e9bd652585d3f78b4b2ee07b93dad603fd9bc3c293e1244250725998adc88da0cef48f1de89b15ab92b15db8f43dc2b6fb8fbd86a6f217a1dd886701@193.70.55.37:30303
enode://4afb3a9137a88267c02651052cf6fb217931b8c78ee058bb86643542a4e2e0a8d24d47d871654e1b78a276c363f3c1bc89254a973b00adc359c9e9a48f140686@144.217.139.5:30303
enode://c16d390b32e6eb1c312849fe12601412313165df1a705757d671296f1ac8783c5cff09eab0

Keybase proof

I hereby claim:

  • I am uniibu on github.
  • I am unibtc (https://keybase.io/unibtc) on keybase.
  • I have a public key ASAy6vfK7Twj5YocSjQTIDBfJgAiK96hMC2iL_bSiySukQo

To claim this, I am signing this object:

@uniibu
uniibu / .eslintrc
Created November 18, 2018 13:13
eslimytc
{
"root": true,
"env": {
"commonjs": true,
"node": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2018,
@uniibu
uniibu / docker_install.sh
Created September 21, 2018 13:03
Docker and docker compose install script
#!/usr/bin/env bash
# Environment variables you need to set so you don't have to edit the script below.
export DOCKER_CHANNEL=stable
export DOCKER_COMPOSE_VERSION=$(wget -qO- https://api.github.com/repos/docker/compose/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')
# Update the apt package index.
sudo apt-get update
# Install packages to allow apt to use a repository over HTTPS.

Usecase - Integrating Monacoin to Coinomi

A simple usecase of a Bitcoin compatible coin integration. Not all coins are created equal, so it is possible that extra work must be done to successfully integrate a new cryptocurrency.

  1. Start the Monacoin daemon and in the monacoin.conf file add the option "txindex=1"
rpcuser=monacoinrpc
rpcpassword=MFfySYp9o9qQi0mYbQmxOdE1pEHVS1DQuhhHssOzkO3
rpcport=8022
@uniibu
uniibu / fastcopy_chaindata.py
Created November 30, 2017 12:51 — forked from laanwj/fastcopy_chaindata.py
Fast local copy of Bitcoin Core blockchain state
#!/usr/bin/python3
# Copyright (c) 2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Fast local copy of Bitcoin Core blockchain state.
This utility hardlinks all but the last block data file (rev and blk),
and hardlinks all .ldb files to the destination. The last data files as well
as the other leveldb data files (such as the log) are copied.
@uniibu
uniibu / cryptorandom.js
Created August 9, 2017 11:04
Generate random alphanumeric string using nodejs crypto module
const crypto = require('crypto');
const alphanumeric = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
function randomize(seed, len) {
const sourceArray = seed.split('');
let baselen = typeof len === 'undefined' ? sourceArray.length : len;
const rnd = crypto.randomBytes(baselen);
const result = [];
let counter = 0, characterIndex, r;
@uniibu
uniibu / native_lodash.js
Created August 5, 2017 18:22
native counterpart of some lodash functions
const assert = require('assert');
/**
* Determines if two values are equal(performs deep comparison).
*
* @param {*} obj The first value to compare from
* @param {*} other The value to compare to
* @return {boolean} True if equal, False otherwise.
*/
const isEqual = (obj, other) => {
try {