Skip to content

Instantly share code, notes, and snippets.

View hhua's full-sized avatar

Han Hua hhua

  • GV
  • Bay Area
View GitHub Profile
# Update & Upgrade the System
sudo apt-get update
sudo apt-get upgrade
# Install dependencies there might be more based on your system
# However below instructions are for the fresh Ubuntu install/server
# Please carefully watch the logs because if something could not be install
# You have to make sure it is installed properly by trying the command or that particular
# dependency again
@hhua
hhua / improved-lnd-bitcoind-mainnet.md
Created July 29, 2019 19:29 — forked from bretton/improved-lnd-bitcoind-mainnet.md
Detailed guide to installing LND and Bitcoind on Ubuntu 16.04 LTS for Mainnet

Intro

This guide is specific to getting LND 0.5-beta and Bitcoind running on Ubuntu 16.04 LTS for mainnet. It is ageing rapidly and includes steps not necessary on newer versions of LND

Original installation guide:

This guide is broken into the following sections:

  • Install bitcoind and set to start automatically
  • Install development tools and dependancies
@hhua
hhua / steps.md
Last active December 12, 2018 01:22
Run Geth on GCP
geth --cache 1024 --gcmode=archive --syncmode=full console --rpc --rpcapi eth,web3,admin,debug,miner,personal,txpool,db
curl -4 -i -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"debug_getModifiedAccountsByNumber","params":[4000000],"id":1}' http://localhost:8545
curl -4 -i -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlockByHash","params":["0xefb816edfb39869209734532606f2c9ea18b9bf8de95c24efec341267de7b1ec",{"tracer": "callTracer", "timeout": "8m"}],"id":1}' http://localhost:8545
@hhua
hhua / geth_api.md
Last active March 8, 2018 22:18
Geth JSON RPC

eth_blockNumber

  • curl -4 -i -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' http://localhost:8545
{"jsonrpc":"2.0","id":83,"result":"0x294362"}

eth_getBlockByNumber

Verifying my Blockstack ID is secured with the address 15vbFjPWDA1CVfgudBTgVgVWXPUKGvbgrq https://explorer.blockstack.org/address/15vbFjPWDA1CVfgudBTgVgVWXPUKGvbgrq
@hhua
hhua / q.js
Created February 15, 2017 01:01 — forked from loriopatrick/q.js
var a = "[\"test\", \"hello\", [\"world\", \"speak\", 3, [\"apple\"], 18], [\"foo\", \"bar\", [2, 3, 4], [2, 1], \"53\"]]";
var b = "{ \"item\": [2, 3, { \"foo\": \"bar\", \"test\": { \"run\": [5, 4, 8] } }, { \"test\": \"yes\" } ] }";
// extract(a, "0") returns "test"
// extract(a, "3.2.0") returns 2
// extract(b, "item.2.foo") returns "bar"
@hhua
hhua / exercise.tour.go
Created October 27, 2016 04:28 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@hhua
hhua / nginx.conf.default
Created January 21, 2016 20:15 — forked from nishantmodak/nginx.conf.default
Default Nginx Conf
#user nobody;
#Defines which Linux system user will own and run the Nginx server
worker_processes 1;
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
#error_log logs/error.log; #error_log logs/error.log notice;
#Specifies the file where server logs.
#
# This will force ActiveRecord to create proper `interval` column types in PostgreSQL
#
# def change
# add_column :leases, :period, :interval
# end
#
# This applies to a generated `schema.rb` file too.
#
# No special OID type is applied to an `interval` type. Rails will treat it as a string, although