Skip to content

Instantly share code, notes, and snippets.

@mrfelton
mrfelton / unlock.sh
Last active Jul 30, 2019
Shell script to unlock lnd on system startup
View unlock.sh
#!/bin/bash
# Do nothing if the WALLET_PASSWORD var is not set.
if [ -z "$PASSWORD" ]; then
echo "[lnd_unlock] Please set PASSWORD in order to unlock wallet automatically."
s6-pause
fi
# output script content for easier debugging.
# set -x
# exit from script if error was raised.
set -e
@mrfelton
mrfelton / lnd.log
Created Aug 19, 2018
lnd sync logs (multiple hosts)
View lnd.log
[INF] BTCN: Starting cfheaders sync at block_height=1384261, hash=000000000001e2d21cabb2927085ed4418db8fc63fa1d826cefab60c3c0fee5c
[INF] BTCN: Starting cfheaders sync for filter_type=0
[DBG] BTCN: Sending getcfcheckpt to 35.231.86.179:18333 (outbound)
[DBG] BTCN: Sending getcfcheckpt to 35.196.85.107:18333 (outbound)
[INF] LNWL: Done catching up block hashes
[INF] LNWL: Started rescan from block 000000000001e2d21cabb2927085ed4418db8fc63fa1d826cefab60c3c0fee5c (height 1384261) for 1 address
[DBG] BTCN: Received cfcheckpt from 35.196.85.107:18333 (outbound)
[DBG] BTCN: Received unhandled message of type cfcheckpt from 35.196.85.107:18333 (outbound)
[DBG] BTCN: Received cfcheckpt from 35.231.86.179:18333 (outbound)
[DBG] BTCN: Received unhandled message of type cfcheckpt from 35.231.86.179:18333 (outbound)
View gist:cda5c07b4ad13f0df75c8b17ca74de66
thedeathmachine:lnd tom$ make
Compiling dependencies.
dep ensure -v
# Gopkg.lock is out of sync with Gopkg.toml and project imports:
github.com/lightningnetwork/lnd/aezeed: imported or required, but missing from Gopkg.lock's input-imports
github.com/lightningnetwork/lnd/autopilot: imported or required, but missing from Gopkg.lock's input-imports
github.com/lightningnetwork/lnd/brontide: imported or required, but missing from Gopkg.lock's input-imports
github.com/lightningnetwork/lnd/chainntnfs: imported or required, but missing from Gopkg.lock's input-imports
github.com/lightningnetwork/lnd/chainntnfs/bitcoindnotify: imported or required, but missing from Gopkg.lock's input-imports
github.com/lightningnetwork/lnd/chainntnfs/btcdnotify: imported or required, but missing from Gopkg.lock's input-imports
View gist:425337282a3b2734630be4d4ae03fa28
process.env.GRPC_SSL_CIPHER_SUITES =
"ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384";
var grpc = require("grpc");
var fs = require("fs");
const lndCert = fs.readFileSync("/home/bitcoin/.lnd/tls.cert");
const credentials = grpc.credentials.createSsl(lndCert);
const lnrpcDescriptor = grpc.load("rpc.proto");
@mrfelton
mrfelton / resthook.js
Created Jun 29, 2016
Example fullcube webhook client implementation
View resthook.js
const bodyParser = require('body-parser')
const crypto = require('crypto')
const logger = require('fullcube-logger')
module.exports = function resthookBootFn(app) {
/**
* Calculate a secret token based on the payload and the shared secret
* @param secret
* @param payload
* @returns {*}
View gist:c28f6c54735628b20f81
diff --git a/lib/esConnector.js b/lib/esConnector.js
index 99318ac..3aa48db 100644
--- a/lib/esConnector.js
+++ b/lib/esConnector.js
@@ -175,19 +175,20 @@ ESConnector.prototype.setupMappings = function (modelNames, callback) {
return !modelNames || _.includes(modelNames, mapping.name);
});
log('ESConnector.prototype.setupMappings', 'mappingsToSetUp', _.pluck(mappingsToSetUp, 'name'));
-
Promise.map(
View gist:edbf31ed2d7ab6a753f6
diff --git a/modules/pantheon/pantheon_apachesolr/pantheon_apachesolr.module b/modules/pantheon/pantheon_apachesolr/pantheon_apachesolr.module
index e3e732c..97bd383 100644
--- a/modules/pantheon/pantheon_apachesolr/pantheon_apachesolr.module
+++ b/modules/pantheon/pantheon_apachesolr/pantheon_apachesolr.module
@@ -72,6 +72,18 @@ function pantheon_apachesolr_help($path, $arg) {
}
/**
+ * Implemenets hook_permission().
+ */
View gist:7775884
## CONFIG ---
# Some variables to make our life easier.
# These are sourced in from a local config file so that we can keep them out of git.
# PANTHEON_SITE_NAME='X'
# PANTHEON_USERNAME='X'
# PANTHEON_PASSWORD='X'
# PANTHEON_SITE_USERNAME='X'
# PANTHEON_SITE_PASSWORD='X'
# TEST_SUITE_FILE='X'#
#
View gist:4539540
diff --git a/commerce_realex.module b/commerce_realex.module
index e1b86a0..407d143 100644
--- a/commerce_realex.module
+++ b/commerce_realex.module
@@ -156,11 +156,12 @@ function _commerce_realex_supported_card_types() {
*/
class RealexParser {
- // Initialise variables.
- var $parser;
View gist:4147055
core = 7.x
api=2
; Include SAC Platform makefile
includes[] = https://github.com/stoneacre/sac_platform/blob/7.x-3.x/sac_platform.make