Monday, October 24, 2022

What is Double exclamation mark in Javascript

 In JavaScript, the double exclamation operator converts an Object to Boolean. This happens such that “falsy” objects become false and “truthy” objects become true.


For example:


!! 0 –> false

!! null –> false

!! undefined –> false

!! 48 –> true

!! “hello” –> true

!! [1, 2, 3] –> true

This is a comprehensive guide on the double exclamation point operator.

references:

https://www.codingem.com/javascript-double-exclamation-operator/#:~:text=In%20JavaScript%2C%20the%20double%20exclamation,%E2%80%9Ctruthy%E2%80%9D%20objects%20become%20true.


Sunday, October 23, 2022

Major components in Alibaba Cloud

Alibaba Cloud CDN (CDN) provides widely distributed nodes and allows you to deliver content, such as websites, audio, and videos. CDN allows users to download files from the nodes nearest to them, accelerating the response to user requests and increasing the success rate. CDN also resolves the delivery latency problem usually caused by distribution, bandwidth, and server performance issues.


Alibaba Server load balancer 

Alibaba Cloud CDN (CDN) provides widely distributed nodes and allows you to deliver content, such as websites, audio, and videos. CDN allows users to download files from the nodes nearest to them, accelerating the response to user requests and increasing the success rate. CDN also resolves the delivery latency problem usually caused by distribution, bandwidth, and server performance issues.


VPC helps you build an isolated network environment based on Alibaba Cloud including customizing the IP address range, network segment, route table, and gateway. In addition, you can connect VPC and a traditional IDC through a leased line, VPN, or GRE to provide hybrid cloud services.


The Elastic Compute Service or ECS is one of the most common services within the Alibaba platform. This allows you to deploy virtual servers within your Alibaba Cloud environment. Most people will require some form of ECS Instance running within their environment as a part of at least one of their solutions.


Block storage is a form of cloud storage that is used to store data, often on storage area networks (SANs). Data is stored in blocks, with each block stored separately based on the efficiency needs of the SAN.


Alibaba Cloud Container Service for Kubernetes (ACK) integrates virtualization, storage, networking, and security capabilities. ACK allows you to deploy applications in high-performance and scalable containers and provides full lifecycle management of enterprise-class containerized applications.


Alibaba Cloud Resource Orchestration Service (ROS) provides developers and system administrators with a simple method to automate deployment and configuration of cloud resources. You can use templates in JSON and YAML formats to describe the configurations of cloud computing resources such as ECS, ApsaraDB for RDS, and SLB and the dependencies between these resources. These templates automatically deploy and configure all cloud resources in different accounts and regions to implement infrastructure as code.



OpenStack Major components


OpenStack Neutron is an SDN networking project focused on delivering networking-as-a-service (NaaS) in virtual compute environments.


What is Mistral?

Mistral is a workflow service. Lots of computations in computer systems nowadays can be represented as processes that consist of multiple interconnected steps that need to run in a particular order. Those steps are often interactions with components distributed across different machines: real hardware machines, cloud virtual machines or containers. Mistral provides capabilities to automate such processes.


Particularly, Mistral can be used, for example, for solving administrator tasks related to managing clusters of software, or for any other tasks that span multiple components and take long to complete. It can also be used as a central component for deploying distributed software in a truly large scale. In any case where the ability to track the progress of the activity becomes crucial, Mistral is a good fit.


A Mistral user can describe such a process as a set of tasks and transitions between them, and upload such a definition to Mistral, which will take care of state management, correct execution order, parallelism, synchronization and high availability. In Mistral terminology such a set of tasks and relations between them is called a workflow.


openstack heat cloudformation

Heat is the main project in the OpenStack Orchestration program. It implements an orchestration engine to launch multiple composite cloud applications based on templates in the form of text files that can be treated like code.


OpenStack Zun 

Zun (ex. Higgins) is the OpenStack Containers service. It aims to provide an API service for running application containers without the need to manage servers or clusters.



Architecture

Zun API: Process REST requests and validate inputted parameters.

Zun Compute: Launch containers and manage compute resources in localhost.

Keystone: Authenticate incoming requests.

Neutron: Provide networking for containers.

Glance: An option to store container images (another option is DockerHub).

Kuryr: A Docker network plugin for connecting containers to neutron networks.



Qinling(Function as a Service in OpenStack)

Qinling is Function as a Service for OpenStack. This project aims to provide a platform to support serverless functions (like AWS Lambda). Qinling could support different container orchestration platforms (Kubernetes/Swarm, etc.) and different function package storage backends (local/Swift/S3) by nature using plugin mechanism.



What is Swift?

The OpenStack Object Store project, known as Swift, offers cloud storage software so that you can store and retrieve lots of data with a simple API. It's built for scale and optimized for durability, availability, and concurrency across the entire data set. Swift is ideal for storing unstructured data that can grow without bound.



OpenStack Cinder 

Cinder is a Block Storage service for OpenStack. It's designed to present storage resources to end users that can be consumed by the OpenStack Compute Project (Nova). This is done through the use of either a reference implementation (LVM) or plugin drivers for other storage. The short description of Cinder is that it virtualizes the management of block storage devices and provides end users with a self service API to request and consume those resources without requiring any knowledge of where their storage is actually deployed or on what type of device.


Octavia is an open source, operator-scale load balancing solution designed to work with OpenStack.


Octavia was borne out of the Neutron LBaaS project. Its conception influenced the transformation of the Neutron LBaaS project, as Neutron LBaaS moved from version 1 to version 2. Starting with the Liberty release of OpenStack, Octavia has become the reference implementation for Neutron LBaaS version 2.


Oenstack Octavia accomplishes its delivery of load balancing services by managing a fleet of virtual machines, containers, or bare metal servers—collectively known as amphorae— which it spins up on demand. This on-demand, horizontal scaling feature differentiates Octavia from other load balancing solutions, thereby making Octavia truly suited “for the cloud.”


OpenStack Horizon 

Horizon is the canonical implementation of OpenStack’s Dashboard, which provides a web based user interface to OpenStack services including Nova, Swift, Keystone, etc.


Firebase notification sending image

 const payload = {

        notification: {

          title: "Test",

          body: message,

          image: 'https://firebasestorage.googleapis.com/v0/b/ntest.appspot.com/o/mmedia%2Fpreviews%2FNature1-min.png?alt=media&token=0241cec4-26b0-4463-8701-c94404d3ee12'

        },

      } 

let response = await admin.messaging().sendToTopic(topic, payload, options);

console.log('response for sendToTopic ',response);


references:

https://stackoverflow.com/questions/38504078/firebase-expandable-notification-show-image-when-app-is-in-background

Saturday, October 22, 2022

What is AWS Direct Connect?

 AWS Direct Connect is a network service that provides an alternative to using the Internet to utilize AWS cloud services. AWS Direct Connect enables customers to have low latency, secure and private connections to AWS for workloads which require higher speed or lower latency than the internet.



What is Hot vs Cold Storage

What Is Hot Storage and Cold Storage? Hot storage refers to fast, easy-to-access data storage like your local hard drive or a quick-access cloud storage provider like Google Drive. In contrast, cold storage is for archival data that is rarely accessed and usually stored off site



Wednesday, October 19, 2022

Postgress Database in container how to view the data

 Once enter into the container terminal,

psql -U postgres (postgres is the database name) 


Now to list the tables,


\d+


Now to view contents of a table 


TABLE upstreams;


references:

https://stackoverflow.com/questions/26040493/how-to-show-data-in-a-table-by-using-psql-command-line-interface