ALL ABOUT ANSIBLE VAULT

All About Ansible Vault

This blog is about using ansible vault. Vault is a way to encrypt subtle information in Ansible scripts.

A distinctive Ansible setup comprises some sort of secret to fully setup a server or application. The common types of “secret” include passwords, SSH keys, SSL certificates, API tokens and whatever which the user do not want the public to see.

Since it is common to store Ansible configurations in version control, we need a way to store confidential data securely.

Ansible Vault is the answer to this. Ansible Vault can encrypt anything inside of a YAML file, using a password of the user choice.

USING ANSIBLE VAULT

A classic use of Ansible Vault is to encrypt variable files. Vault can encrypt any YAML file, but the most common files to encrypt are:

* Files within the group_vars directory
* A role’s defaults/main.yml file
* A role’s vars/main.yml file
* Any other file used to store variables.

ENCRYPTING AN EXISTING FILE

The characteristic use case is to have a normal, plaintext variable file to encrypt. Using ansible-vault, we can encrypt and define the password needed to decrypt later:

# Encrypt a role’s defaults/main.yml file ansible-vault encrypt defaults/main.yml > New Vault password: > Confirm New Vault password: > Encryption successful

The ansible-vault command will request the user for a password twice. Once that is done, the file will be encrypted. If the user edits the file directly, the user will just see encrypted text. It will be something like this:

$ANSIBLE_VAULT;1.1;AES256
65326233363731663631646134306563353236653338646433343838373437373430376464616339 3333383233373465353131323237636538363361316431380a643336643862663739623631616530 35356361626434653066316661373863313362396162646365343166646231653165303431636139 6230366164363138340a356631633930323032653466626531383261613539633365366631623238 32396637623866633135363231346664303730353230623439633666386662346432363164393438

CREATING AN ENCRYPTED FILE

If the user wants to create a new file instead of encrypting an existing one, the user can use the create command:

ansible-vault create defaults/extra.yml > New Vault password: > Confirm New Vault password:

EDITING A FILE

Once the user encrypts a file, the user can only edit the file by using ansible-vault. Here is how to edit the file after it is been encrypted:

ansible-vault edit defaults/main.yml > Vault password:
This will ask for the password used to encrypt the file.
You’ll lose your data if you lose your password!

ENCRYPTING SPECIFIC VARIABLES

The user does not have to encrypt a whole file! The user can track the changes in git, where the user will not have an entire file changing for just a small change.

The most basic use case is, to run it interactively on the CLI to get the formatted YAML as output:

ansible-vault encrypt_string > New Vault password: > Confirm New Vault password: > Reading plaintext input from stdin. (ctrl-d to end input) > this is a plaintext string > !vault | > $ANSIBLE_VAULT;1.1;AES256 >

39393766663761653337386436636466396531353261383237613531356531343930663133623839
>
3436613834303264613038623432303837393261663233640a363633343337623065613166306363
>
37336132363462386138343535346264333061656134636631326164643035313433393831616131
>
3635613565373939310a316132313764356432333366396533663965333162336538663432323334
> 33656365303733303664353961363563313236396262313739343461383036333561 >
Encryption successful

DEEP LEARNING IN MACHINE LEARNING

Deep Learning in Machine Learning

Deep Learning is a sub-division of machine learning consists of algorithms stimulated by the structure and function of the brain called artificial neural networks.

If the user is just starting out in the field of deep learning or the user had some experience with neural networks, then the user might get confused.

The experts in the field have idea of what deep learning is and these exact and refined perspectives shed a lot of light on what deep learning is all about.

In this article, the user will discover exactly what deep learning is by hearing from a range of experts in the field.

DEEP LEARNING

Deep Learning has evolved hand-in-hand with the digital eon, which has brought about an eruption of data in all forms and from every region of the world. This data, known simply as Big Data, is drawn from sources such as social media, internet search engines, e-commerce platforms, online cinemas, and much more. This massive amount of data is readily accessible and can be shared through FinTech applications such as cloud computing. However, the data, which usually is unstructured, is so huge that it could take decades for humans to understand and extract relevant information. Organizations realize the incredible potential that can result from unravelling this wealth of information, and are increasingly adapting Artificial Intelligence (AI) systems for automated support.

One of the most common AI techniques used for processing Big Data is Machine Learning, a self-adaptive algorithm that gets progressively better analysis and patterns with experience or with new added data. The computational algorithm built into a computer model will process all the transactions happening on the digital platform, find patterns in the data set and identifies glitches detected by the pattern.

Deep learning, a subdivision of machine learning, utilizes a hierarchical level of artificial neural networks to carry out the process of machine learning. The artificial neural networks are built with neuron nodes connected together like a web. While traditional programs build analysis with data in a linear way, the hierarchical function of deep learning systems allows machines to process data with a nonlinear approach. A traditional approach to identifying fraud might depend on the amount of transaction arises, while a deep learning nonlinear technique would include time, geographic location, IP address, and other features that is likely to point to a fraudulent activity. The first layer of the neural network processes a raw data inputs the amount of transaction and passes it on to the next layer as output. The second layer processes the previous layer’s information by including additional information like the user’s IP address and passes on its result. The next layer takes the second layer’s information and includes raw data like geographic location and makes the machine’s pattern even better. This continues across all levels of the neuron network.

DEEP LEARNING

Using the fraud detection system with machine learning, the user can create a deep learning example. If the machine learning system creates a model with parameters built around the amount of dollars a user sends or receives, the deep learning method can start building on the results offered by machine learning. Each layer of its neural network builds on its previous layer with added data such as retailer, sender, user, credit score, IP address and a host of other features that may take years to connect together if processed by a human being. Deep learning algorithms are skilled to not just create patterns from all transactions, but to also know when a pattern is signalling the need for a fraudulent investigation. The final layer transmits a signal to an analyst who may freeze the user’s account until all pending investigations are confirmed.

Deep learning is used across all industries for a number of different tasks. Commercial apps that use image recognition, open source platforms with consumer recommendation apps that explore the possibility of reusing for new ailments are a few of the examples of deep learning incorporation.

WHAT IS A NAMESPACE IN KUBERNETES?

What Is A Namespace In Kubernetes?

Namespaces are intended for use in environments with many users spread across multiple teams, or projects. Namespaces are a way to divide cluster resources between multiple uses (via resource quota). In future versions of Kubernetes, objects in the same namespace will have the same access control policies by default.
 
 
 
 
 
 
 
 

WHAT IS THE DIFFERENCE BETWEEN FLUX AND REDUX ?

What is the difference between Flux and Redux?

Redux does not have a dispatcher. It relies on pure functions called reducers. It does not need a dispatcher. Each action is handled by one or more reducers to update the single store. Since data is immutable, reducers return a new updated state that updates the store Flux makes it unnatural to reuse functionality across stores in Flux, stores are flat, but in Redux, reducers can be nested via functional composition, just like React components can be nested. Redux store your state at only one place. While you can have many in Flux

WHAT IS THE DIFFERENCE BETWEEN SUPERVISED LEARNING AN UNSUPERVISED LEARNING?

What is the difference between Supervised Learning an Unsupervised Learning?

If an algorithm learns something from the training data so that the knowledge can be applied to the test data, then it is referred to as Supervised Learning. Classification is an example for Supervised Learning. If the algorithm does not learn anything beforehand because there is no response variable or any training data, then it is referred to as unsupervised learning. Clustering is an example for unsupervised learning.

 
 
 
 
 
 
 
 
 
 
 
 

WHY DATA CLEANING PLAYS A VITAL ROLE IN ANALYSIS?

Why data cleaning plays a vital role in analysis?

Cleaning data from multiple sources to transform it into a format that data analysts or data scientists can work with is a cumbersome process because – as the number of data sources increases, the time take to clean the data increases exponentially due to the number of sources and the volume of data generated in these sources. It might take up to 80% of the time for just cleaning data making it a critical part of analysis task.
 
 
 
 
 
 
 
 
 
 
 

WHAT’S NEW IN ANGULAR 6

What’s New in Angular 6

65
As many of you know Angular 6 is already out. At outset, this release of Angular 6 is lighter, faster, and easier. Developers will start loving it more as it makes their development future much easier. In this article we are going to cover the latest major release, Angular 6, which focuses on making Angular smaller and faster to use.

Let’s go through the major changes in Angular 6.

IMPROVED SERVICE WORKER SUPPORT

Angular 6 now supports the configuration of navigation URLs in Service Workers. The service worker will readdress navigation requests that don’t match any asset or data group to the specified index file.

By default, a navigation request can have any URL and URLs containing a file extension in the last path segment. Sometimes it is great to be able to configure different rules for the URLs of navigation requests (e.g. ignore specific URLs and pass them through to the server).

Now, the developer can specify an optional navigationUrls list in ngsw-config.json. Before that, the service worker would enter a degrade mode where only current clients would be served if either the client or server was offline while trying to fetch ngsw.json. In Angular 6, the service worker remains in the current mode till connectivity to the server is restored.

NG UPDATE

The new CLI command analyzes your package.json and uses its knowledge of Angular to recommend updates to users application. It will help the developers to adopt the right version of dependencies, and keep dependencies in sync. In addition to updating dependencies and earl dependencies, ng update will apply needed transforms to your project.

CLI WORKSPACES

CLI v6 now offers support for workspaces containing various projects, such as numerous applications or libraries. CLI projects will now use angular.json instead of .angular-cli.json for build and project configuration. Each CLI workspace will have projects, each project will have targets, and each target can have configurations.

FORMS VALIDATION IN ANGULAR 6

Before, ngModelChange was always emitted, earlier the underlying form control was updated.

If the user had a handler for the ngModelChange event that checked the value through the control, the old value would be logged instead of the simplified value. This is not the case if the user passes the value through the $event keyword directly.

TOKEN MARKING FOR RUNTIME ANIMATION CONTEXT

In Angular 6, it’s now possible to define which animation context is used for a component at runtime. A token is provided as a marker to determine whether the component is running a BrowserAnimationsModule or NoopAnimationsModule context at runtime.

SCHEMATICS

Schematics is a new shell that is used by Angular CLI to create custom templates. The Angular team has always been keen on improving developer productivity which explains the birth of schematics. With schematics the developer can easily create Angular libraries.

First, install the necessary schematic tools:

npm i -g ng-lib-schematics @angular-devkit/core @angular-devkit/schematics-cli

Next, create a new angular-cli project:

ng new avengers –skip-install // avengers is the name of the new library I’m trying to create

Finally, the developer can just run schematics like so:

schematics ng-lib-schematics:lib-standalone –name avengers

A new lib directory will be generated inside the src folder. The lib directory ships with a sample demo and then build tools necessary for a typical Angular package.

THE VERDICT

Angular 6 came full with new features and significant improvements. Thanks to the Angular team on making Angular faster and better to use.

Have you upgraded to Angular 6 yet? What are your opinions? Did you notice any major improvement? Let us know!