This file contains hidden or 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
var db = mongoose.connect('mongodb://localhost:27017/DB'); | |
// In middleware | |
app.use(function (req, res, next) { | |
// action after response | |
var afterResponse = function() { | |
logger.info({req: req}, "End request"); | |
// any other clean ups |
This file contains hidden or 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
{ | |
"main": "server/index.js", | |
"scripts": { | |
"dev": "nodemon --watch server server/index.js", | |
"build": "next build", | |
"start": "NODE_ENV=production node server/index.js" | |
}, | |
"dependencies": { | |
"apollo-boost": "^0.1.13", | |
"apollo-server": "^2.0.4", |
This file contains hidden or 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
## Encrypt | |
tar cz * | openssl enc -e -aes-256-cbc -salt -out keybase_`date "+%Y%m%d"`.tar.gz.enc | |
## Decrypt | |
openssl enc -d -aes-256-cbc -salt -in <ENCRYPTED_KEYBASE_TARBALL> | tar xvz | |
## Crontab | |
10 12 * * * cd /Users/dwallraff/backups && tar cz /keybase/private/dwallraff | openssl enc -e -aes-256-cbc -salt -k $PASSWORD -out keybase_`date "+%Y%m%d"`.tar.gz.enc >/dev/null 2>&1 |
This file contains hidden or 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
/** | |
* Generate wallets (Alice, Bob, Carol), create a json file and import private keys to Bitcoin Core | |
* | |
* BIP32 methods | |
* - fromBase58 | |
* - fromPrivateKey | |
* - fromPublicKey | |
* - fromSeed | |
* | |
* BIP39 methods |
This file contains hidden or 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
#!/usr/bin/env bash | |
# This shebang line will use the first bash in your PATH, which should be 4.x | |
# Bash 4.x is required for this script | |
# Libbitcoin-explorer (bx) | |
# Configure bx.cfg config file to testnet values for testnet | |
# Not all commands accept --version option | |
# Associative arrays are stored in a 'hash' order, so no ordering. | |
# Name: entropy |
This file contains hidden or 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 | |
if [ -z $1 ]; | |
then | |
echo "You must include an integer as an argument."; | |
exit; | |
fi | |
if (( $1 > "2147483647" )) || (( $1 < "-2147483647" )); | |
then |
This file contains hidden or 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 convert = { | |
bin2dec : s => parseInt(s, 2).toString(10), | |
bin2hex : s => parseInt(s, 2).toString(16), | |
dec2bin : s => parseInt(s, 10).toString(2), | |
dec2hex : s => parseInt(s, 10).toString(16), | |
hex2bin : s => parseInt(s, 16).toString(2), | |
hex2dec : s => parseInt(s, 16).toString(10), | |
lenBytesDec: bin => (bin.length/8).toString(10), | |
lenBytesHex: bin => (bin.length/8).toString(16), | |
} |
This file contains hidden or 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 | |
# RaspiBolt channel overview display, by robclark56 | |
# make executable & copy to | |
# /usr/local/bin/lnchannels | |
# current user must be able to execute bitcoin-cli and lncli | |
# Usage | |
# $ lnchannels to display lnd mainnet channels | |
# $ lnchannels --testnet to display lnd testnet channels |
This file contains hidden or 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 | |
# RaspiBolt channel balance display, by robclark56 | |
# make executable & copy to | |
# /usr/local/bin/lnbalance | |
# current user must be able to execute bitcoin-cli and lncli | |
# Usage | |
# $ lnbalance to display lnd mainnet status | |
# $ lnbalance --testnet to display lnd testnet status |
This file contains hidden or 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 | |
# by Stadicus & JanakaSteph | |
# copy script to /etc/update-motd.d/ and make it executable (chmod +x) | |
# /etc/update-motd.d/20-thundroid-welcome | |
# root must be able to execute bitcoin-cli and lncli | |
# Set colors | |
### | |
color_red='\033[0;31m' | |
color_green='\033[0;32m' |
NewerOlder