This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get rid of remotes | |
git fetch --prune --all | |
# Check branches for stuff you might want to keep | |
# This will show branches that are NOT on the remote for origin or upstream | |
git branch | grep -v "$(git branch --remote | grep -e "origin/\|upstream/" | grep -v "\->" | cut -d/ -f2)" | |
# Here's another one to check. checks your local master and gives any branches that are merged to master | |
git branch --merged=master | grep -v master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SELECTION=$1 | |
if [ -z "$1" ] | |
then | |
SELECTION="JPN" | |
fi | |
# Default JPN | |
CODE=108 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# docker, docker-compose, bash, jq, sed 必要。 | |
# このスクリプトはLinuxで作られたので、各コマンドの細かい使い方が違ってたらすみません。 | |
# OSXは使ったことないので。。。 | |
# | |
# lndのgithubをクローンしないといけません。例えば: | |
# | |
# rm -rf /tmp/lndtest | |
# mkdir -p /tmp/lndtest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### new ubuntu 18.04 server | |
### Be sure to run | |
# sudo apt-get update && sudo apt-get -y upgrade && sudo reboot | |
### For security updates | |
### Then run this script with passwordless sudo account ubuntu (default for ubuntu AWS EC2): | |
# CERTDOMAIN=something.yourdomain.com CERTEMAIL=mailname@yourdomain.com ./thisScript.sh | |
# Install Bitcoin 0.17.0 etc. | |
sudo add-apt-repository -y ppa:bitcoin/bitcoin &>/dev/null | |
sudo apt-get update &>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# これを実行して lnd を起動 | |
LIST=(\ | |
188.166.148.62:18333 \ | |
159.203.125.125:18333 \ | |
); \ | |
INDEX=$((RANDOM % 2)); \ | |
NODE=${LIST[$INDEX]}; \ | |
docker run -d \ | |
-v /tmp/lndock:/root/.lnd \ | |
-v /tmp/lndockdata:/data \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CSP_DIRECTIVES = ` | |
default-src | |
'self' | |
; | |
object-src | |
'none' | |
; | |
report-uri | |
someURL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make_keybase_subteam(){ | |
# usage: | |
# make_keybase_subteam myteam newsubteam | |
# creates the subteam, sets good defaults, then turns it into a big team. | |
# will automatically join subteam. | |
if [ -z "$1" ]; then | |
echo "need to specify team name" | |
return 1 | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function pbkdf2(message, salt, iterations, keyLen, algorithm) { | |
const msgBuffer = new TextEncoder('utf-8').encode(message) | |
const msgUint8Array = new Uint8Array(msgBuffer) | |
const saltBuffer = new TextEncoder('utf-8').encode(salt) | |
const saltUint8Array = new Uint8Array(saltBuffer) | |
const key = await crypto.subtle.importKey('raw', msgUint8Array, { name: 'PBKDF2' }, false, ['deriveBits']) | |
const buffer = await crypto.subtle.deriveBits({ "name": 'PBKDF2', "salt": saltUint8Array, "iterations": iterations, "hash": algorithm }, key, keyLen * 8) | |
const hashArray = Array.from(new Uint8Array(buffer)) | |
const hashHex = hashArray.map(b => ('00' + b.toString(16)).slice(-2)).join('') | |
return hashHex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// first, run sudo apt-get install jq nodejs npm | |
// second, run npm install bluebird co to install dependencies, and make sure bitcoin-cli can run these commands. | |
// third, run node thisScript.js and it will change all the addresses on your bitcoind into segwit addresses. | |
var Promise = require('bluebird'); | |
var co = require('co'); | |
var exec = Promise.promisify(require('child_process').exec); | |
var main = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install git://github.com/bitcoinjs/bitcoinjs-lib.git#56dfb873d3f05817e19befa976592bc0f371a6d3 | |
// installing the above commit of bitcoinjslib will allow you to take the var redeemScript and | |
// create a bech32 raw segwit address with this function: | |
// var bech32address = bitcoin.address.fromOutputScript(redeemScript) | |
var bitcoin = require('bitcoinjs-lib') | |
var mnemonic = require('bip39') | |
// log output near bottom | |
function main() { | |
// mnemonic seed starts here | |
var seed = mnemonic.mnemonicToSeed('print common jewel hospital hip fish auction indicate depth ignore ship tissue') |