Skip to main content

Posts

How to locally merge an upstream pull request in GitHub?

Use the following simple command. git pull upstream pull/<PR_ID>/head For example : git pull upstream pull/200/head
Recent posts

How to import the Public Certificate of one WSO2 product to the trust store of another?

To demonstrate this point, I will use the 2 products WSO2 API Manager 2.1.0 (referred as APIM from here onwards) and WSO2 Enterprise Integrator 6.1.1 (referred as EI from here onwards). When using EI as the Business Process Server during configuration of Workflows in APIM, one step to perform is to import the public certificate of EI to the truststore of APIM [1]. So now let's see how this can be done. Step 1: Go to <EI_HOME>/repository/resources/security/ folder and execute the following keytool command. This command is used to export the public certificate of EI as a certificate file called wso2carbon.cer. Since the default keystore in EI is wso2carbon.jks, we have specified it as the keystore and the default alias is wso2carbon. Provide wso2carbon as the keystore password when prompted as it is the default password. After executing the above command from within the security folder in EI, you will see that a file with the name of wso2carbon.cer is created...

How to switch between different java versions in ubuntu?

Assume you have java-7-oracle and java-8-oracle installed in your machine and now you need to switch between these 2 versions of java. In order to check which version you are currently using in the machine, execute the command below in the terminal. java -version You will see an output similar to the following. Now to switch to java-8-oracle, execute the below command in the terminal. sudo update-alternatives --config java You will see an output like below. It lists down all the java installations in your machine. Enter the selection number in the prompt. In this case, it will be 2 as we need to switch to java-8-oracle.  Now you should export the JAVA_HOME variable with the new version by adding the following to the .bashrc file. You can take the path from the prompt above. export JAVA_HOME=/usr/lib/jvm/java-8-oracle Then you can open a new terminal and type the following command to check whether the java version has changed. java -vers...

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

This error usually pops up when you try to grant permissions on your database in MySQL. In this case, you have two options. Option 1:  Change your password so that it satisfies the current policy requirements in your MySQL installation. You can check what conditions are required by executing the bellow command on the terminal where MySQL is running. SHOW VARIABLES LIKE 'validate_password%';   It will list down a table like this,   Option 2 : Set the password policy level lower. For example, you can change the allowed password length using the below command. You also can do this for the fields shown in the image above. SET GLOBAL validate_password_length = 6 ;  Cheers!

How to write a Cron Job in Linux?

What is a Cron Job? Cron is a Linux utility where you can setup a task in your machine to run automatically, if required in a repetitive manner at a specific time and date. Such a task that you schedule is called a Cron Job . Here we'll look into how we can setup a cron job in a Linux machine. Follow the steps bellow. Step 1 : Place the script you want to schedule as a Cron Job to one of the following directories in your machine depending on how often you need to repeat the execution of the script. /etc/cron.hourly /etc/cron.daily /etc/cron.weekly /etc/cron.monthly For example, if you want to schedule your task daily, place the script in the /etc/cron.daily directory. Step 2 : Then give correct permissions to the script as follows. Assume script.sh is the script that you need to schedule. cd /etc/cron.daily chmod 755 script.sh   Step 3 : Then you should add a new Cron Job to crontab . crontab -e   Step 4 : Then you will be prompted w...

React

Come let’s start our journey through the world of React , an efficient and flexible JavaScript Library. Today we talk about something called Single Page Applications (SPA) with respect to web based applications. This is where the web application does not use different pages to show different views of the application. The different views will be loaded into the same page so that you don’t need to reload the page every time you need a different view. This is a great improvement in terms of performance. React helps us to achieve that in an easy flexible way. Let’s learn React. They say that the view is just a function of props and state. We’ll see how easy it’s going to be. Let’s set up the React development environment and go through a beginner’s guide to React. Come let’s get started. Note that we require the Babel and Webpack Libraries to start working with react. I’m assuming here that you are in an Ubuntu/Linux environment. You’ll see it by the command...