$ wget http://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip
$ unzip ken_all.zip
| /* | |
| メモ:Counterblock API の "get_preferences" が吐き出す address_aliases に含まれているハッシュ化されたアドレスは、以下のようなロジックで生成されている。 | |
| */ | |
| var CryptoJS = require("crypto-js"); | |
| var addr = 'mkcpH67kGUUzVBpKU5P5QkPT48DygcjCgQ'; // address | |
| var base64 = CryptoJS.SHA256(addr).toString(CryptoJS.enc.Base64); | |
| console.log("ハッシュ化されたアドレス:", base64); // 'MvB0qNP3dcHwbatXgFkST2wmc5/D+Pmq/1zgetO0EQc=' | |
| /* |
| // Imported from js/external/mnemonic.js of Counterwallet@github | |
| // and changed to CommonJS style | |
| exports.getInstance = function(args) { | |
| var bits, i, l, w1, w2, w3, n; | |
| if (typeof args == "undefined" || typeof args == "number") { | |
| bits = args || 96; | |
| if (bits % 32 !== 0) | |
| throw "Can only generate 32/64/96/128 bit passwords"; | |
| this.random = new Uint32Array(bits / 32); | |
| if (window.crypto && window.crypto.getRandomValues) |
| # First, login container like this: | |
| $ docker exec -it <container> /bin/bash | |
| # Now you are in the container, try to get host's IP address like this: | |
| $ /sbin/ip route|awk '/default/ { print $3 }' |
| # /root/.bitcoin-config/bitcoin.testnet.conf | |
| testnet=1 | |
| rpcuser=rpc | |
| rpcpassword=rpc | |
| server=1 | |
| printtoconsole=1 | |
| rpcallowip=0.0.0.0/0 | |
| rpcthreads=50 | |
| rpctimeout=300 | |
| txindex=1 |
| const querystring = require('querystring'); | |
| /** | |
| * Parses "bitcoin:****" link | |
| * | |
| * @param {String} - link. | |
| * eg: "bitcoin:1LRm2ebiM7S8Li3DXYj7N2QzyewQ36Deoh?amount=1&message=%EF%BC%BC(%5Eo%5E)%EF%BC%8F%EF%BD%B5%EF%BE%9C%EF%BE%80" | |
| * @return {Object} - `{ link, to, amount, message }` | |
| * Note: `message` is uri-decoded | |
| */ |
| /** | |
| * Crypto Utility | |
| * @author akirattii <[email protected]> (http://mint.pepper.jp) | |
| * | |
| * Caution: Assuming server-side use only! | |
| */ | |
| /* | |
| Usage: | |
| ``` | |
| const CryptoUtil = require('../lib/CryptoUtil.js'); |
| /** | |
| * Fetch address by zipcode | |
| */ | |
| function fetchAddressByZipcode(zipcode, cb) { | |
| let url = "http://zipcloud.ibsnet.co.jp/api/search?callback=?&zipcode=" + zipcode; | |
| $.getJSON(url).done((data, status, jqXHR) => { | |
| let result = data["results"][0]; | |
| vm.prefecture = result["address1"]; | |
| vm.city = result["address2"]; |
| const crypto = require('crypto'); | |
| const secp256k1 = require('secp256k1'); | |
| // or require('secp256k1/elliptic') | |
| // if you want to use pure js implementation in node | |
| const msg = process.argv[2]; // message to be signed you pass | |
| const digested = digest(msg); | |
| console.log(`0) Alice's message: | |
| message: ${msg} | |
| message digest: ${digested.toString("hex")}`); |
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
26137efa979f mysql "docker-entrypoint..." 8 months ago Up 10 minutes 0.0.0.0:3306->3306/tcp container-mysql
$ sudo docker exec container-mysql mysqld --version`
mysqld Ver 5.7.15 for Linux on x86_64 (MySQL Community Server (GPL))