Skip to content

Instantly share code, notes, and snippets.

View hclivess's full-sized avatar
🏠
Working from home

Jan Kučera hclivess

🏠
Working from home
View GitHub Profile
@hclivess
hclivess / encrypt_decrypt.py
Created August 2, 2019 20:45
bismuth encryption interface
from Cryptodome.Cipher import AES, PKCS1_OAEP
from Cryptodome.PublicKey import RSA
from Cryptodome.Random import get_random_bytes
import base64
import ast
from bisbasic import essentials
from bisbasic.simplecrypt import decrypt
import getpass
key, public_key_readable, private_key_readable, encrypted, unlocked, _, myaddress, keyfile = essentials.keys_load_new("wallet.der")
@hclivess
hclivess / pprop.py
Last active July 28, 2019 18:22
peerlist proposal
def peersync(self, subdata: str) -> int:
"""Got a peers list from a peer, process. From worker().
returns the number of added peers, -1 if it was locked or not accepting new peers
subdata is a dict, { 'ip': 'port'}"""
with self.peersync_lock:
try:
total_added = 0
subdata = self.dict_validate(subdata)
data_dict = json.loads(subdata)
@hclivess
hclivess / debug.md
Last active July 10, 2019 00:15
Debugging Bismuth
  1. Create file named config_custom.txt in your Bismuth folder
  2. Enter the following lines:

debug=True

terminal_output=True

debug_level=WARNING

  1. Restart your node
@hclivess
hclivess / gist:d82157b4f42ceb5d79618de55b17947e
Last active October 12, 2019 19:12
How to compile old crypto
sudo apt-get remove libssl-dev
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install -y git unzip build-essential libssl-dev libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev libevent-dev autogen automake libtool libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qt5-default
sudo ldconfig
@hclivess
hclivess / digest.py
Created June 29, 2019 19:36
digest improvement proposal
import hashlib
import os
import sys
import essentials
import mempool as mp
import mining
import mining_heavy3
import staking
from difficulty import *
@hclivess
hclivess / digest.py
Created June 29, 2019 19:31
digest improvement proposal
import hashlib
import os
import sys
import essentials
import mempool as mp
import mining
import mining_heavy3
import staking
from difficulty import *
@hclivess
hclivess / solar_panel.py
Last active June 24, 2019 17:29
calculates kilowatthour production in a month based on pannel wattage and solar radiation
#calculates kilowatthour production in a month based on pannel wattage and solar radiation
solar_radiation = 4.9
panel_wattage = 330
wh = solar_radiation * panel_wattage
kwh = wh / 1000
kwd_month = kwd * 28
print (f"watt_hour {wh}")
del /f /s /q dist 1>nul
rmdir /s /q dist
mkdir dist
python -m nuitka --follow-imports wallet.py --windows-icon=graphics\icon.ico --standalone --show-progress -j 8 --recurse-all --include-package=coincurve --plugin-enable=tk-inter
robocopy wallet.dist dist\files /MOVE /E
robocopy "C:\Program Files\Python37\Lib\site-packages\Cryptodome" "dist\files\Cryptodome" /MIR
robocopy "C:\Program Files\Python37\Lib\site-packages\coincurve" "dist\files\coincurve" /MIR
@hclivess
hclivess / tornador.py
Created June 5, 2019 23:10
Tornado Web Background Thread (using separately updated object)
import json
import tornado.ioloop
import tornado.web
import dator
import threading
import time
class MainHandler(tornado.web.RequestHandler):
def initialize(self, updater):
self.updater = updater
@hclivess
hclivess / veriblock_scam
Created March 29, 2019 07:12
veriblock is a CIA scam
from blockchain import blockexplorer
from difflib import SequenceMatcher
def similar(a, b):
return SequenceMatcher(None, a, b).ratio()
def compare (forked_shitcoin_hashes):
winner = None
shitcoin_race_winner = 0