Skip to content

Instantly share code, notes, and snippets.

View philsong's full-sized avatar

S. philsong

View GitHub Profile
@philsong
philsong / pg_change_schema_owner.sh
Created October 10, 2015 01:51 — forked from bspkrs/pg_change_schema_owner.sh
Changes the owner on all tables, sequences, views, and functions in a PostgreSQL database with support for identifiers with whitespace and non-public schemas.
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script sets ownership for all tables, sequences, views, and functions for a given schema.
Run this script as your postgres OS user.
@philsong
philsong / Dockerfile
Last active August 29, 2015 14:28 — forked from andychase/Dockerfile
Faking XT Nodes for fun
# Use the Ubuntu Linux distro as the base for this image
FROM ubuntu
# Install necessary build tools
RUN apt-get update && apt-get upgrade --yes && apt-get install build-essential clang git --yes
# Download and install PseudoNode
RUN cd /root && git clone https://github.com/basil00/PseudoNode.git && cd ./PseudoNode && make
# These two commands enable port 8333 to be routed and start the node by default
EXPOSE 8333
CMD ["bash", "-c", "cd /root/PseudoNode && ./pseudonode --stealth --coin=bitcoin-xt"]
@philsong
philsong / genNonce.cpp
Last active August 29, 2015 14:06
计算符合pow要求的最小值
CBlock block;
block.nNonce = 2084731820;
block.vtx.push_back(txNew);
block.hashPrevBlock = 0;
block.hashMerkleRoot = block.BuildMerkleTree();
block.nVersion = 1;
block.nTime = 1409745976;
block.nBits = 0x1e0ffff0;
#if 1
package main
import (
"log"
"github.com/piotrnar/gocoin/blockdb"
"github.com/piotrnar/gocoin/btc"
"encoding/hex"
)
func main() {
// Set real Bitcoin network