Posts

Build React Native App (4) - Redux, Jest, and NativeBase

Image
From this blog, typescript feature will be added. There are couple of ways to implement static type checking like; flow from facebook, PropTypes and Typescript. Typescript is well integrated with Visual Studio Code and supports better linter, error messages, and intellisense. Reference site Github Sample Ex4 Currnet version D:\GitRepo\reactnative>npm --version 6.3.0 D:\GitRepo\reactnative>react-native --version react-native-cli: 2.0.1 react-native: n/a - not inside a React Native project directory D:\GitRepo\reactnative>yarn --version 1.9.4 Creating React Native App $ react-native init ex4 If you want to specify the version, add "--version 0.57.3" at the end. Add NativeBase to React Native $ npm install native-base --save ... + native-base@2.8.1 added 71 packages from 42 contributors, removed 50 packages, updated 829 packages and audited 34989 packages in 138.542s found 0 vulnerabilities $ $ yarn yarn install v1.9.4 warning package-lock.json found. You...

Add DNS using network manager in CentOS

Adding DNS using network manager in centos If you change DNS by yourself from /etc/resolv.conf, the configuration will be gone after rebooting the computer. Assuming to run all commands with "root" account. Otherwise, the command should be run with "sudo" in front of each command 1. Find connection # nmcli con NAME    UUID                                  TYPE      DEVICE ens160  4f1de527-4257-467d-8476-c5c6efdf1c74  ethernet  ens160 2. Update DNS entry Format nmcli con mod ipv4.dns dns_servers # nmcli con mod ens160 ipv4.dns "8.8.8.8 8.8.4.4" 3. Restart network # systemctl restart network After update DNS entry, check /etc/resolv.conf file and you will see the new updated record. # cat /etc/resolve.conf

ssh can't connect to remote due to REMOTE HOST IDENTIFICATION HAS CHANGED

SSH can't connect to remote: "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" After rebuilding the remote server, ssh can't make connection to remote server with following messages λ ssh -o ServerAliveInterval=60 root@10.202.0.150 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ECDSA key sent by the remote host is SHA256:cESEZr5cIIDf+uqksrYo+G34m5xm3gu6irysqQbLGN0. Please contact your system administrator. Add correct host key in /c/Users/alex.joh/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /c/Users/alex.joh/.ssh/known_hosts:13 ECDSA host key for 10.202.0.150 has changed and you have ...

Kong docker container exits with 132 error code without any message

Docker Container Exited (132) I was building entire Devops environment with ansible automation and suddenly Kong stack didn't start properly.  The problem was that the Dev server was old Dell Server and it doesn't support "sse4_2" feature from CPU. What is SSE Technology? SSE is a processor technology that enables single instruction multiple data. ... SSE is designed to replace MMX™ Technology. It expanded over the generations of Intel® Processors to include SSE2, SSE3/SSE3S, and SSE4. Each iteration has brought new instructions and increased performance. Information from CPUInfo  [root@dockerdv01 ~]# cat /proc/cpuinfo | grep sse4_ flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc...

Automation with Ansible (10) - Create VMs from VCenter with Multi Environment Architecture

Image
Introduction From this series, all folder structure will be followed from the previous Multi environment stucture. The steps to create VMs are; Create Inventory file Create Variables Shared variables Group variables Create Ansible Playbook Creating VMs from CentOS Template Set Network interface Add MAC Address to dhcpd.conf Reboot Reference Github code Folders/Files list \---ansible | CreateVMs.yaml | +---inventory | +---shared_vars | | shared-secrets.yml (empty) | | shared-vars.yml (empty) | | | \---test | +---dmz | | | vm_hosts | | | | | \---group_vars | | vcenter.yml | | | \---internal | | vm_hosts | | | \---group_vars | secrets.yml (empty) | vcenter.yml | \---tasks ...

Ansible with automation(9) - Multi Environment Architecture

Image
Introduction Until series 9, we've prepared to create Docker Cluster and to deploy microservices to the Cluster. From this series, we will start to deploy services to multiple environment. Architecture From one of our project, we want to automate from creating VMs to deploy microservices. I've looked at multiple difference options for automation. However, my choice is Ansible because it doens't need any additional installation on the remote machines. To march the entire steps, I segmented entire scopes to the following segments; Creating VMs from VMWare and manage ip addresses (CreateVMs.yaml) Creating Docker Cluster with Community edition (BuildDockerCECluster.yaml) Deploying default services such as Artifactory, Kong, etc (BuildDefaultMicroService.yaml) Build Docker private repository. Final choice is to use "Harbor" from VMware. Deploying custom solutions to Docker Cluster (DeployMicroservices.yaml) This is the entire drawing to support from the ab...

Export folder structure to file on Windows, Mac, and Linux

Introduction Most time, I make screenshot to show folder structure, but whenever there is change, it is painful to make screen capture again and agian. This is how you can export folder structure to text file. Tree on Windows "tree.exe" is installed as default and you can run it from command prompt. d:\GitRepo\github\dockeransible>tree /? Graphically displays the folder structure of a drive or path. TREE [drive:][path] [/F] [/A] /F Display the names of the files in each folder. /A Use ASCII instead of extended characters. d:\GitRepo\github\dockeransible>tree d:\gitrepo\github\dockeransible /A /F > tree.txt d:\GitRepo\github\dockeransible>notepad tree.txt d:\GitRepo\github\dockeransible> Output from the command Folder PATH listing Volume serial number is D8A7-163B D:\GITREPO\GITHUB\DOCKERANSIBLE | README.md | tree.txt | +---2-CreateVM | CreateVM.yaml | +---4-AnsibleDebug | DisplayClonedVMInfo.yaml | +---5-Ad...

Active Directory authentication using Spring and Apache Library

Recently, I started to work AD authentication again and this is little snippet of AD authentication portion. Create simple springboot and tested with it. package com.alexjoh; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.Arrays; import org.apache.http.HttpEntity; import org.apache.http.HttpHost; import org.apache.http.auth.AuthScope; import org.apache.http.auth.NTCredentials; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.config.AuthSchemes; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.entity...