Angular – Http Get API Code Example with Promise

In Javascript, promise are resolved or rejected

Promise, in Javascript, allows an asynchronous operation to happen in the sense that caller function getting promise object returned by callee function proceeds ahead with the program execution. And, upon the return of promise object, the processing continues. The Promise concept can be used with Angular Http service to achieve asynchronous data retrieval from the server using GET API. The code example in this article applies to both Angular 2 and Angular 4. On the lighter side, here is a comic strip on whether Promises are kept or not :). In Javascript, promises go from state of “pending” to “resolution” or “rejection”. In this post, you will learn about some of the following …

Continue reading

Posted in AngularJS, Web. Tagged with , , .

How to Install Hyperledger Explorer & Access Fabric Network

Hyperledgder Explorer is a Blockchain explorer which can be used to view the details on the one or more blockchain network (channels) created using Hyperledger Fabric 1.0. In this post, you will learn about some of the following: Introduction to Hyperledger Explorer App Installation/Setup of Hyperledger Explorer Configure hyperledger explorer for the first network Starting the Explorer App Introduction to Hyperledger Explorer App Hyperledger Explorer is a Nodejs based web app which runs on Node/ExpressJS with MySQL as the backend database. It provides details related Fabric blockchain network (channels) based on configuration provided in the file, blockchain_explorer/config.json. The following represents some of the key details provided by the explorer app vis-a-vis …

Continue reading

Posted in BlockChain, Hyperledger, Tools, Tutorials. Tagged with , , .

Kubernetes – Cheatsheet of Commands for Namespaces

Kubernetes Namespaces Cheatsheet

Kubernetes namespaces represents virtual clusters (logical entity with a unique name) created out of same physical cluster to enable allocation or split of cluster resources to different group of users. Namespaces are, primarily, used for managing cluster resources across dev/test/production environments by attaching different level of authorization controls and policies to different sections of cluster resources. In simpler words, it allows to create a community of users (developers, testers, production ops) in relation to some of the following: Cluster resources available for usage (pods, services, deployments, replication controllers etc) Who could do what with available cluster resources (policies) Number of resources that could be used by the community (quotas) This post …

Continue reading

Posted in Kubernetes. Tagged with .

Learn to Create Hyperledger Fabric Blockchain with byfn.sh – Part 1

Hyperledger Fabric Blockchain with byfn.sh

Hyperledger Fabric comes up with a script namely byfn.sh which can be used to Build Your First Network (byfn). Hyperledger Fabric script, byfn.sh (found in folder fabric-samples/first-network), can be used to build your first Hyperledger Fabric permissioned blockchain network. As I went about writing the post, it got much longer. Thus, I have split the post into two parts. In the first part, you will learn about some of the following: A quick introduction to some of the following: Installation pre-requisites before getting started with byfn.sh execution Initial configuration prior to executing byfn.sh How to go about executing byfn.sh Deep dive into byfn.sh execution to learn key aspects of building a permissioned blockchain network such …

Continue reading

Posted in BlockChain, Hyperledger, Tutorials. Tagged with , .

Quantum Computing – Two Ways to Install QISKit on Linux

Install QISKit Dependencies

This article represents different ways in which you can go about installing Quantum Information Science Kit (QISKit) on Linux and related distros such as Ubuntu. QISKit is software development kit (SDK) for writing quantum computing experiments, programs, and applications. In this post, you will learn about some of the following topics in relation to installing QISKit on Linux: Install QISKit using PIP Install QISKit from Github repository Install QISKit using PIP You can go about installing QISKit using PIP, a Package manager for installing python libraries. The catch here is the requirement of using Python 3.5. or later. Often, we have python 2.7. setup as a default python alternative for …

Continue reading

Posted in Quantum Computing. Tagged with , .

Angular – How to Prevent XSS Attacks – Code Examples

How to prevent XSS attack in Angular App

This article represents concepts and related instructions, code example/sample in relation to Cross-site scripting (XSS) security vulnerabilities in Angular app and how to prevent XSS attacks. This instruction in this article is valid for Angular 5.* and Angular 4.* versions. Before we get started, read the related details on XSS on this page, Top 10 Angular security Best Practices. This article will look into some of the following details in relation to XSS vulnerability and how attacks due to XSS can be prevented using Angular out-of-the-box utilities. What is Cross-site Scripting (XSS) Attack? Different types of XSS Vulnerabilities Angular approach to prevent XSS attacks Angular recommendations to prevent Server XSS …

Continue reading

Posted in AngularJS, Application Security, Javascript, Tutorials, Web. Tagged with , , .

Quantum Computing – How to Install QISKit using PIP

This article represents instructions and related concepts on how to install QISKit (Quantum Information Science Kit) using PIP. As per Wikipedia Page on PIP, PIP is a package management system used to install and manage software packages written in Python. This article assumes that you are working with Linux distributions (distros) OS such as Ubuntu etc. The following topics are discussed in this article: What is QISKit Install Python PIP Install QISKit using PIP Install Command Test First Quantum program What is QISKit? QISKit is a software development kit (SDK) comprising of Python-based software libraries that can be used to create quantum computing programs, compile them, and execute them on one of …

Continue reading

Posted in Quantum Computing. Tagged with , .

Kubernetes – How to Create / Delete Namespaces; Why Namespaces?

kubernetes dashboard create namespace

This article represents concepts related to Kubernetes Namespace and how to create/delete the namespaces. The following topics are discussed in this article: What are namespaces? How to create namespaces? How to work with namespaces? How to delete namespaces? What are Namespaces? Kubernetes namespace can be seen as a logical entity used to represent cluster resources for usage of a particular set of users. This logical entity can also be termed as a virtual cluster. One physical cluster can be represented as a set of multiple such virtual clusters (namespaces). The namespace provides scope for names. Names of resource within one namespace need to be unique. By default, Kubernetes starts with the following three …

Continue reading

Posted in Kubernetes, Tools, Tutorials. Tagged with .

How to Install Kubernetes on Mac OS/X

Kubernetes Dashboard

This article represents point-to-point instructions on how to install / setup Kubernetes on Mac OS/X. We will look into steps for installing Minikube for working with Kubernetes on Mac OS. The goal is to install stand-alone Kuberenetes for development purpose. The following are the steps: Install NodeJS & Docker Runtime for Mac Install Homebrew Install Xyve Driver (or Hyperkit Driver) Install Minikube Install Kubectl Start Minikube Access Kubernetes Dashboard Minikube Commands for Kubernetes Install NodeJS & Docker Runtime for Mac Make sure you have NodeJS and Docker Runtime installed for MacOS. Install Homebrew First and foremost, we need to install the Homebrew, the package manager of MacOS. Use the following command to setup Homebrew: Once installation is complete, execute the …

Continue reading

Posted in Kubernetes, Tools, Tutorials.

Angular – Create PWA with Angular Material UI/UX

Angular PWA with angular material sample

This article represents instructions and concepts related to How to create a Progressive Web Angular App (PWA) with Angular Material. Angular Material represents material design components for Angular apps. Create Progressive Web App (PWA) with Angular The following page represents instructions and related concepts on creating PWAs using different Angular versions such as Angular 4 and Angular 5: How to create PWA using Angular 4 and earlier versions How to create PWA using Angular 5 Why Angular Material Design? Angular PWA can be created with both, Bootstrap as well as Angular Material. From some of the following pages, it looks like Angular Material is preferred choice if you are looking …

Continue reading

Posted in AngularJS, Javascript, UI, Web. Tagged with , , .

How to Install Kubernetes in Ubuntu VM

Kubernetes Namespaces Cheatsheet

This article represents a quick, crisp and to-the-point instructions on how to setup Kubernetes on Ubuntu VM. The steps below would help you get started with Kubernetes on your laptop with the help of Minikube. Minikube is a tool which runs a single-node kubernetes cluster inside a VM (virtualbox in this article) on your laptop. In this article, we will look at the steps for installing Kubernetes within an Ubuntu VM.  The steps remain almost same for Ubuntu OS with the difference of how you enable the virtualization at BIOS level. Install VirtualBox (as part of installing a hypervisor) Enable Virtualization Install Kubectl Install Minikube Start/stop Kubernetes Install VirtualBox First …

Continue reading

Posted in Kubernetes, Tools, Tutorials. Tagged with .

Hyperledger Fabric – Are Channels Private Blockchain? (Deep Dive)

hyperledger fabric channels

This article represents Hyperledger Fabric Channels concepts and related details in form of some of the following topics: What are Channels? Hyperledger Fabric Blockchain Network is a channel Channels are private and permissioned Blockchain Channels explained with examples Channels – channel configuration, genesis block Ordering service creates a transaction block per channel Blockchain network is categorized into two broad classes: Public network: Anyone can join this type of network. For example, bitcoin network. Private or permissioned network: A member needs to be authenticated by the assigned membership service provider (identity issuing authority service) for joining and conducting transactions in the network. Hyperledger Fabric can be said to be private or permissioned blockchain. …

Continue reading

Posted in BlockChain, Hyperledger. Tagged with , , .

Angular 5 – How to Create Progressive Web Apps (PWA)

progressive web apps with Angular 5

This article represents steps and instructions on how to create a progressive web app (PWA) using Angular 5. In the previous article, we saw the steps to create PWA with Angular 4 and earlier versions, along with installation pre-requisites and introduction to PWA. This article will refer the previous article at various places. What are Progressive Web Apps (PWA)? Check out the details in my previous article, How to create progressive web app using Angular 4. The following are key requirements of PWA which shall be addressed in this article: Discoverable (Using manifest file) App-like offline experience (Using out-of-box Service-worker) Installation pre-requisites Install Lightspeed Chrome plugin for testing the aspects …

Continue reading

Posted in AngularJS, Tutorials, Web. Tagged with , , , .

Angular – How to Create Progressive Web App with Angular 4

progressive web app using angular

This article represents steps required to get started with / create progressive web app (PWA) using Angular 4.* and earlier versions such as Angular 2.*. You will note that we used the sw-precache NPM module for working with a service worker for seamless offline experience when the internet is not available. This is one of the key requirements of a progressive web app.  Angular 5.* introduced the service-worker concept for providing out-of-the-box support for the App-like offline experience. We shall deal with using Angular 5 service worker for creating a progressive web app in a follow-up article. What are Progressive Web Apps (PWA)? A progressive web app has some of …

Continue reading

Posted in AngularJS, Tutorials, Web. Tagged with , , , .

Hyperledger Fabric – Cryptogen Tool Not Found…Exiting

hyperledger fabric cryptogen tool

This error, Cryptogen Tool Not Found…Exiting occurred when I tried to build the first network by executing byfn.sh script using following commands for the first time after downloading and installing hyperledger fabric platform binaries/components and fabric samples: The following screenshot represents the error: Why the Error – Cryptogen Tool Not Found This error occurs, primarily, due to the reason that cryptogen tool can be not be found in the path. The path to cryptogen tool needs to be set to PATH variable. This can be confirmed by checking the logs of the script execution by putting the following code (set -x) in the beginning of the file, byfn.sh, as shown below. Note that the code set-x is used to expand …

Continue reading

Posted in BlockChain, Hyperledger. Tagged with , .

Angular – Top 10 Security Best Practices vis-a-vis Security Risks

angular security best practices

Are you concerned about security vulnerabilities in your angular app? Have you been wondering whether one or more of your angular apps are at security risks? Your worries regarding potential security bugs in your angular apps are well justified given security threats to web apps in general. This article would help you learn some of the top security best practices for your Angular apps. Some of these best practices may as well be applied for earlier versions of AngularJS. We shall be referring the security best practices in relation to some of the OWASP Top 10 Security Vulnerabilities. Some of the recommendations include out-of-box support from Angular Http utility such as DomSanitizer and HttpClient which is part of Angular 2, Angular 4 and Angular 5. Quick Recall …

Continue reading

Posted in AngularJS, Application Security, UI, Web. Tagged with , , , .