Posts

Showing posts with the label linux

Export public-private keys from PFX file

Image
In this blog I'll share the snippets used to export the public key & private key from a PFX file. Sometimes we have to perform the data encryption/decryption using the digital signature by taking the public key(so called as SSL certificate or public keys)  to encrypt the data and private key to decrypt the data. Let's take the sample DSCs provided by eMudhra- https://www.e-mudhra.com/Repository/ I have taken " e-Mudhra sub CA for Class 3 Individual 2014"  for this blog. This zip contains two files as- Class 3 individiual test_encryption.pfx- For data encryption/decryption Class 3 individiual test_Signature.pfx- For signing the document We'll take the file  Class 3 individiual test_encryption.pfx for this blog and follow the below steps to obtain the public key & private key. A linux machine with openssl utility Run the following command to extract the private key openssl pkcs12 -in Class_3_individiual_test_encryption.pfx -nocerts -out private_key.key If pr...

Docker run failed for apim analytics image with illegal option

Image
In this post I am going to share my experience for running the docker image of wso2 apim analytics dashboard that caused some issue while running it. Below is the summary of the same- Environment: Windows, RHEL 8.3, WSO2 Analytics 3.2.0 Problem: While executing docker run command, it gives following error- sudo docker run wso2am-analytics-dashboard:3.2.0.20 : not foundarbon/docker-entrypoint.sh: 17: /home/wso2carbon/docker-entrypoint.sh: 18: set: Illegal option - Cause:  The problem occurred due to dos2unix conversion issue. Basically the file docker-entrypoint.sh was created in a winodws machine in notepad++ utility but remained with EOL conversion as Windows (CR LF). Further this file was uploaded to a linux machine where actual execution has to be done. Solution We need to change the EOL conversion of the file ( docker-entrypoint.sh ) to Linux (LR) prior to docker image creation. I have used windows environment and notepad++ utility to do the same as- 1. Open the file doc...

AWS EC2 Ubuntu Instance VNC access

Image
In this post I'll write about how to connect to your EC2 Ubuntu linux instance via VNC Viewer app. Let's get started...... Kindly login to your AWS instance via private key through terminal/putty as shown below and follow the steps from 1 to 8 to access your Ubuntu (18.x in my case) GUI from your local machine- ssh -i your-aws-key.pem ubuntu@ec2-x-x-x-80.ap-south-1.compute.amazonaws.com Step-1 sudo apt update &&  sudo apt upgrade Step-2 sudo apt-get install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal xfce4 vnc4server Step-3 vncserver Enter the password- xxxx Confirm Password- xxxx Step-4 vi ~/.vnc/xstartup Uncomment previous and use this one in xstartup file as shown below #!/bin/sh # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc unset DBUS_SESSION_BUS_ADDRESS startxfce4 & [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup ...

Accessing remote linux machine from MacOS with key

Image
There is a scenario where I have to access a remote linux machine via MacOS. Login mechanism is allowed though key and not a password. I have provided a PPK file which I can use for authentication purpose. PPK File Not Supported by MacOS The PPK file is not directly supported by MacOS terminal, rather we need a PEM(.pem) file for authentication. So first we need to convert this *.ppk file to *.pem file then after the same will be used for authentication purpose. We need to install  PuTTYgen (windows)  first. Normally it comes with installer of PuTTY but if not installed, check this link-   PuTTYgen Converting  a .ppk file to a .pem file Start PuTTYgen. Under Actions , choose Load , and then navigate to your .ppk file. Choose the .ppk file, and then choose Open . Clear the Key passphrase and a Confirm passphrase fields. Note: The passphrase is used to encrypt the key and is an extra layer of protection. If your private key...

Oracle Linux 7.5 Error- piix4_smbus 0000:00:01.3: SMBus base address uninitialized

Recently I have come across a strange issue while working with Oracle Linux. Below are the environment details, problem summary and solution worked for my environment- Environment- Oracle Linux 7.5 Architecture- x86-64 File System- XFS Type- VM VM running on - Blade Servers VM Manager- OVM 3.4 Problem Summary- There was some issue with network and hence the blade servers that caused my oracle linux startup issue, below error shown during the startup maintenance mode- piix4_smbus 0000:00:01.3: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr Symptoms Server shows this message at the console at boot or in /var/log/dmesg   Cause The warning message is harmless and caused by the device's PCI config register 0x090 being set to 0. When the kernel module i2c-piix4 tries to read the PCI config register, it reads the 0 which causes the i2c-piix4 module's initialization to fail with -ENODEV Solution If you want to av...

Container Native Application Development Setup with Kubernetes

Image
Recently I have been involved in analysis and setup of container native application development setup using Kubernetes(k8s). Below are the steps I have done for the same- Requirements 1. A Developer with access to his/her GitHub account Developer develops an app and pushes the code to GitHub (a distributed version source code control utility) 2. Jenkins setup Jenkins setup is required for DevOps viz. creating CI/CD pipeline/ Web Hooks. For current environment, Jenkins server is running on Google Cloud platform. 3. Dockerhub account A valid dockerhub account is required for container image registery. 4. A Kubernetes(k8s) Cluster (GKE) A k8s cluster is required for running the containers /container orchestration, scaling and overall container lifecycle management. I have used Google Kubernetes Engine (GKE) @ Google Cloud. It contains 1 load balancer and 3 nodes. Conditions K8s cluster, Jenkins, GitHub should be on  the same network (if private...