Skip to content

Instantly share code, notes, and snippets.

@pjha1994
pjha1994 / blockchain.md
Created January 9, 2018 20:55 — forked from joepie91/blockchain.md
Is my blockchain a blockchain?

Your blockchain must have all of the following properties:

  • It's a merkle tree, or a construct with equivalent properties.
  • There is no single point of trust or authority; nodes are operated by different parties.
  • Multiple 'forks' of the blockchain may exist - that is, nodes may disagree on what the full sequence of blocks looks like.
  • In the case of such a fork, there must exist a deterministic consensus algorithm of some sort to decide what the "real" blockchain looks like (ie. which fork is "correct").
  • The consensus algorithm must be executable with only the information contained in the blockchain (or its forks), and no external input (eg. no decisionmaking from a centralized 'trust node').

If your blockchain is missing any of the above properties, it is not a blockchain, it is just a ledger.

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@pjha1994
pjha1994 / install_ruby_rpi.sh
Created December 15, 2017 14:15 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.4 on the Raspberry Pi (Raspbian)
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby 2.4 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Welcome message
import subprocess
import httplib2
import requests
from datetime import datetime
FORMAT = '%d-%m-%Y %H:%M:%S'
my=open('log.txt','a',encoding='utf-8')
def test_internet():
my.write('\nin test_internet'+'-------------------------'+datetime.now().strftime(FORMAT)+'\n')
while(True):
try:
import re
from bs4 import BeautifulSoup
from bs4 import SoupStrainer
import os
import httplib2
from datetime import datetime
c=0
def make_soup(s):
#test_internet()
import re
from bs4 import BeautifulSoup
from bs4 import SoupStrainer
import os
import httplib2
c=0
def make_soup(s):
match=re.compile('https://|http://|www.|.com|.in|.org|gov.in')
if re.search(match,s):
http = httplib2.Http()