Unwanted redirect from Gmail to OneLogin

Is Google Chrome redirecting you to onelogin whenever you try to login into any Google account? This is how to fix it:

  1. Open Chrome
  2. Type chrome://settings/siteData
  3. search for onelogin in top right (see example screenshot below)
  4. Capture00
  5. Delete the onelogin cookies
  6. Now try logging to gmail again. Again see the annoying redirect?
  7. This time search for accounts.google.com  in the top right
  8. Delete it (this is the crucial step)
  9. Now it should work.
Advertisements
Posted in Software | Leave a comment

Installing Bash4

A new macbook pro comes installed with bash version 3. I needed to install bash 4 to be able to use the bash debug vs code extension. To do this run

brew install bash

once its done you will need to edit /etc/shells file so that it looks like following:

WITSC02X6385JGH:temp sjain68$ cat /etc/shells

# List of acceptable shells for chpass(1).

# Ftpd will not allow users to connect who are not using

# one of these shells.

# 4.x of bash

/usr/local/bin/bash

# 3.x of bash

/bin/bash

/bin/csh

/bin/ksh

/bin/sh

/bin/tcsh

/bin/zsh
Posted in Software, Uncategorized | Leave a comment

ABAC

showing how to add an attribute named manufacturer and set its value to true. file helper.js in balance-transfer app. see https://fabric-sdk-node.github.io/release-1.3/FabricCAServices.html#register__anchor

Screen Shot 2018-11-30 at 3.21.06 PM

later on you can check this attribute as follows in your chaincode:

Screen Shot 2018-11-30 at 3.20.50 PM

Posted in Software | Leave a comment

Remove annoying tslint errors/warnings in vs code

Goto Code -> Preferences -> Settings -> TSLint and uncheck Enable

Screen Shot 2018-11-30 at 10.35.46 AM

for bonus also uncheck Javascript > Validate: Enable

Screen Shot 2018-11-30 at 10.33.21 AM

Posted in Software | Leave a comment

Running the typescript balance-transfer app

There are several problems you will run into. First problem is this

you won’t be able to run ts-node after npm installing it. To fix it modify the PATH environment variable

PATH=$PATH:./node_modules/.bin

Next problem is when you try to run ./runApp.sh it will give

============== node modules installed already =============

cp: cannot create regular file ‘node_modules/fabric-client/index.d.ts’: No such file or directory
cp: cannot create regular file ‘node_modules/fabric-ca-client/index.d.ts’: No such file or directory
/home/siddjain/fabric-samples-v13/balance-transfer/typescript/node_modules/ts-node/src/index.ts:307
        throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
              ^
TSError: ⨯ Unable to compile TypeScript
Solution to this is to run

npm install before running ./runApp.sh. once you do that, you should now see
============== node modules installed already =============

[2018-11-29 18:56:17.141] [DEBUG] Helper – [crypto_ecdsa_aes]: Hash algorithm: SHA2, hash output size: 256
[2018-11-29 18:56:17.224] [DEBUG] Helper – [utils.CryptoKeyStore]: CryptoKeyStore, constructor – start
[2018-11-29 18:56:17.225] [DEBUG] Helper – [utils.CryptoKeyStore]: constructor, no super class specified, using config: fabric-client/lib/impl/FileKeyValueStore.js
[2018-11-29 18:56:17.234] [DEBUG] Helper – [crypto_ecdsa_aes]: Hash algorithm: SHA2, hash output size: 256
[2018-11-29 18:56:17.235] [DEBUG] Helper – [utils.CryptoKeyStore]: CryptoKeyStore, constructor – start
[2018-11-29 18:56:17.235] [DEBUG] Helper – [utils.CryptoKeyStore]: constructor, no super class specified, using config: fabric-client/lib/impl/FileKeyValueStore.js
[2018-11-29 18:56:17.248] [INFO] SampleWebApp – ****************** SERVER STARTED ************************
[2018-11-29 18:56:17.248] [INFO] SampleWebApp – **************  http://localhost:4000  ******************

(node:714) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead

Next note that on their README.md they say

  • Node.js v6.9.0 – 6.10.0 ( Node v7+ is not supported )

Screen Shot 2018-11-30 at 10.17.49 AM

However that is plain wrong. In fact you will need to have Node v8 installed (nothing more and nothing less) since the async-await was introduced only in v8 of Node.

the HL Fabric prerequisites say that
If you will be developing applications for Hyperledger Fabric leveraging the Hyperledger Fabric SDK for Node.js, you will need to have version 8.9.x of Node.js installed.
Posted in Software | Leave a comment

How to get rid off gossip logs in Hyperledger Fabric?

The gossip service outputs very verbose and useless logs in Fabric. These messages can be seen if one tries to view the logs of a peer container.

Screen Shot 2018-11-30 at 9.57.59 AM

How can one get rid of them? Today i tried 2 ways none of which worked.

Method 1: This was based on what I read on the official documentation

Capture

so I added it to the base.yaml file as follows:

command: peer logging setlevel ^gossip error && peer node start

this actually caused some problem at runtime and the container did not start properly. Then somewhere on stackoverflow I read to use bash – c “” so I tried that:

command: bash -c "peer logging setlevel ^gossip error && peer node start"

That also did not work. Then somewhere I read not to use bash but use /bin/bash. So I tried that and no surprise that too did not work. Note to self: try running the command from the docker container of the peer and see if it works then

Method 2: This method is based on what I read here. Accordingly I added CORE_LOGGING_GOSSIP=WARNING in base.yaml and that too did not work.

11/30/18: I have now tried all possible permutations and combinations. using bash, /bin/bash, changing the order of commands, running peer logging setlevel ^gossip error from inside the peer container and none of the options will silence the gossip debug logs. So frustrated with HL Fabric.

below is error message when I try to run peer logging setlevel ^gossip error from inside the container:

Screen Shot 2018-11-30 at 9.58.10 AM

screenshot of base.yaml (have tried all possible permutations)

Screen Shot 2018-11-30 at 10.04.14 AM

Making this note to remind myself of the constant problems I keep running into with HL Fabric. Should have chosen Quorum to develop my blockchain.

Posted in Software | Leave a comment

Hyperledger Fabric: How to debug balance-transfer typescript app in VS Code?

How to debug typescript app in VS Code?

  1. In VS Code goto Debug -> Add Configuration… and add following configuration to launch.json
    Screen Shot 2018-11-29 at 3.48.00 PM

2. cd to the directory where app.ts is located and from there run

$ /usr/local/bin/node --nolazy -r ts-node/register --inspect-brk=49528 app.ts

It should display a message

Debugger listening on ...

3. In VS Code go to View -> Debug and click on green button to launch Attach

4. The terminal should now display a message saying

Debugger Attached.

5. The debugger is attached now but the execution is paused. In VS Code click on the button to continue the execution (or press F5)

Screen Shot 2018-11-29 at 5.08.28 PM

6. That’s it you should be able to debug now

Screen Shot 2018-11-29 at 3.46.52 PM

Make sure the loaded scripts window shows your code.

Screen Shot 2018-11-29 at 3.48.54 PM

In debug console you should be able to debug variables

Screen Shot 2018-11-29 at 3.56.49 PM

Posted in Software | Leave a comment