Skip to content

Instantly share code, notes, and snippets.

View Freyert's full-sized avatar

Fulton Byrne Freyert

  • Durham, NC
View GitHub Profile
@Freyert
Freyert / truffle.js
Created August 7, 2018 14:41
Truffle with Kaleido
const Web3 = require('web3');
module.exports = {
networks: {
geth: {
provider: function () {
return new Web3.providers.HttpProvider('https://USERNAME:PASSWORD@HTTP_RPC_ENDPOINT')
},
network_id: '*',
gasPrice: 0
},
@Freyert
Freyert / App.java
Last active July 3, 2018 15:09
web3j quorum public tx
package kaleido.quorum;
import java.io.IOException;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.RemoteCall;
@Freyert
Freyert / kaleido_env.tf
Created June 5, 2018 17:35
kaleido_terraform_Env
resource "kaleido_environment" "myEnv" {
consortium_id = "${kaleido_consortium.mine.id}"
name = "My Environment"
description = "Deployed with Terraform"
env_type = "${element(var.env_types, 0)}"
consensus_type = "${element(var.quorum_consensus, 0)}"
}
@Freyert
Freyert / variable.tf
Created June 5, 2018 17:34
kaleido terraform variable quorum_consensus
variable "quorum_consensus" {
type = "list"
default = ["raft", "ibft"]
description = "Consensus methods supported by quorum."
}
@Freyert
Freyert / main.tf
Created June 5, 2018 17:18
Simple, Robust Kaleido Environment
/*
This creates suite of environments using all available
environment types and consensus methods.
*/
variable "kaleido_api_key" {
type = "string"
description = "Kaleido API Key"
}
@Freyert
Freyert / cf_scp_app.sh
Last active March 16, 2017 21:53
Cloud Foundry SCP entire NodeJS App
#!/bin/bash
#https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html#ssh-command
APP_NAME="my_app"
GUID=$(cf app $APP_NAME --guid)
INFO=$(cf curl /v2/info)
export CF_SSH_ENDPOINT=$(printf $INFO | jq '.app_ssh_endpoint' | cut -d ':' -f1 | tail -c +2)
export CF_SSH_PORT=$(printf $INFO | jq '.app_ssh_endpoint' | cut -d ':' -f2 | tr -d \")
export CF_SSH_FINGERPRINT=$(printf $INFO | jq '.app_ssh_host_key_fingerprint' | cut -d ':' -f1 | tail -c +2)
@Freyert
Freyert / npm-debug.log
Created November 17, 2016 20:02
npm install error
info it worked if it ends with ok
1 verbose cli [ '/Users/fulton/.nvm/versions/node/v4.6.2/bin/node',
1 verbose cli '/Users/fulton/.nvm/versions/node/v4.6.2/bin/npm',
1 verbose cli 'install',
1 verbose cli 'slc',
1 verbose cli '-g' ]
2 info using npm@3.10.9
3 info using node@v4.6.2
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
This one is useful af. Thanks @MHBauer and @bmangold
https://github.com/docker/docker/issues/18078
docker commit $STOPPED_CONTAINER user/test_image
docker run -ti --entrypoint=sh user/test_imag
var json = requestAsync('https://www.ibm.com')
.catch(recoverFromErrors)
.then(function(res) {
return JSON.parse(res.body);
});
console.log(json);
if (true) {
doThis();
} else {
doThat();
}