Tuesday, June 2, 2020

Create new branch in GitHub

Note: OS Windows
Way 1:
Create new branch from the current branch and automatically switch to it.
$ git checkout -b <branch_name>

Way 2:
1. Create a new branch on the repository
$ git branch <branch_name>
2. Switch to the new branch from current branch.
$ git checkout <branch_name>

Way 3:
1. Create new branch and can specify a different branch which want to create the new branch.
$ git checkout -b <branch_name> <branch-name_which_creates_the_new_branch>

List all the branches in the repository
$ git branch

Saturday, May 9, 2020

Create new repository and add existing project to GitHub in command line

Note: OS Windows
1. Create new repository on GitHub. Do not add README and gitignore files, can add it after push the project to GitHub.

2. Open Git Bash.
3. Change the current working directory to your local project.

4. Initialize the local folder as a git repository.
$ git init
5. Add file to the local repository(Stages) to first commit.(To unstage a file, use 'git reset HEAD YOUR-FILE')
$ git add .
6. Commit files staged in the local repository.
$ git commit -m "First commit"
7. Copy the remote repository URL on GitHub.
8. Add/set the URL for remote repository
$ git remote add origin <copied remote repository URL>
(Optional : To verify remote URL - $ git remote -v)
9. Push changes.
$ git push origin master

Reference:
[1] https://help.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line

Sunday, October 13, 2019

Adding multiple folders to Git

Use below command (in git bash) for add multiple folders to Git.

$ git add -A 

Then can commit changes and push it to the repository.

Wednesday, October 31, 2018

Find the process running on specific port

On Windows cmd:

Syntax : netstat<space>-ano<space>|<space>find<space>":<port>"

When run the command related to the port 8006 the output will give as below,
Ex:
C:\Users\hal>netstat -ano | find ":8006"
  TCP    127.0.0.1:8006         0.0.0.0:0              LISTENING       5380

Related to the example, "5380" is the process id(PID), then can check the PID through the Task Manager.

Sunday, December 10, 2017

Maven build failed with "Fatal error compiling: invalid target release: 1.8 -> [Help 1]"

The below build failed error popped-up  when I try to build (use mvn clean install) the project with Maven.

Error log:

INFO] ------------------------------------------------------------------------
INFO] BUILD FAILURE
INFO] ------------------------------------------------------------------------
INFO] Total time: 3.390 s
INFO] Finished at: 2017-12-09T16:33:24+05:30
INFO] Final Memory: 9M/150M
INFO] ------------------------------------------------------------------------
ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2
:compile (default-compile) on project dpc-portal: Fatal error compiling: invalid
 target release: 1.8 -> [Help 1]
ERROR]

The reason was, I set JAVA_HOME to the JDK 1.7 (as in below image) but try to build using JDK 1.8. So after change the JAVA_HOME to JDK 1.8 version, project was built successfully.



Reference:
https://stackoverflow.com/questions/28291691/fatal-error-compiling-invalid-target-release-1-8-help-1

Wednesday, November 8, 2017

Enable Wire Logs in WSO2 ESB

In Some situations need to check the incoming(to ESB) or outgoing(from ESB) HTTP headers and the messages. The Wire log functionality is there to handle this requirement. Main underlying transport mechanism of ESB is Passthrough HTTP Transport which handles the HTTP and HTTPS messages. Hence, it can enable wire logs for Passthrough HTTP Transport as below.


WSO2 ESB 4.7.0 or higher versions.


1. Open log4j.properties file.
log4j.properties file is located in <EBB_HOME>/repository/conf directory.

2. Un-comment the following entry.
log4j.logger.org.apache.synapse.transport.http.wire=DEBUG

3. Save the file and restart the server to affect the changes.

In the older versions, it is bit different than the new versions.


For ESB 4.6.0 :
log4j.logger.org.apache.synapse.transport.passthru.wire=DEBUG

For ESB 4.5.1 or previous versions :
log4j.logger.org.apache.synapse.transport.nhttp.wire=DEBUG

To see HTTP headers and messages of Callout mediator/MessageProcessor.


1. Open log4j.properties file.

2. Un-comment the following two entries.

log4j.logger.httpclient.wire.header=DEBUG
log4j.logger.httpclient.wire.content=DEBUG

3. Save the file and restart the server to affect the changes.

NOTE: Wire logs should enable only for a troubleshooting purposes, not recommended for the systems in the production environment.

Monday, August 22, 2016

Changing User Passwords In WSO2 ESB.

In this blog, I will explain the way to change the password [1] of the WSO2 ESB (or User Passwords in the Carbon Database). Here I used ESB 4.9.0 version.

What you need to do is run the chpasswd script inside the <PRODUCT_HOME>/bin/ directory.
For an example, I need to change the admin password. So I pass the "username" command line argument also. If we do not provide these as command line arguments, it will be prompted for it during the execution time.

These are the steps you need to follow.

1. Extract the fresh ESB 4.9.0 instance.
2. Start the server.
3. Shutdown the server.
4. Run the below command and set the new password.
  • For Linux: ./chpasswd.sh --username "admin" --db-url "jdbc:h2:repository/database/WSO2CARBON_DB"
  • For Windows: chpasswd.bat --username "admin" --db-url "jdbc:h2:repository/database/WSO2CARBON_DB"
5. Start the server.
6. Login from the new password and it will log you into the Management Console.

Reference:

Monday, October 5, 2015

Install SoapUI using .sh file in Ubuntu.

* Download SoapUI<version>.sh file (linux installer) and try out following commands in the Terminal.

$ sudo chmod +x SoapUI<version>.sh
$ ./SoapUI<version>.sh

* Note : Replace the name of the file according the downloaded version of the SOAP UI.

* It will run as following screen shot and prompt you to the installation window.

Sunday, October 4, 2015

'OPTION SQL_SELECT_LIMIT=DEFAULT' MySQL Error

I got this 'OPTION SQL_SELECT_LIMIT=DEFAULT' error when I try to mount the WSO2 ESB registry partitions into MySQL.

In here I used the mysql-connector-java-5.0.8-bin.jar version as a jdbc connector for MySQL. It seems like a bug in MySQL.
As it said in this stackoverflow link [1] mysql-connector-java 5.1.22 and newer versions are fine. So I download mysql-connector-java-5.1.34-bin.jar version and used.

Note: Before restarting the ESB server, have to clear 'dropins' folder in <ESB_HOME>/repository/components/dropins

Cool... Then it's working fine.

Reference links :
[1] http://stackoverflow.com/questions/15669270/option-sql-select-limit-default

Sunday, August 25, 2013

How to Install Oracle Java JDK1.6 on Ubuntu Linux

Hi all,
In this post I hope you to explain how to install JDK 1.6 on your Ubuntu OS. There are several ways to achieve it, if you are interested try to find other ways and tell others how it can do.

So first of all you have to download Java Development Kit(JDK). Use following link to find it

  1. Then select Java SE 6u45's JDK download.
  2. Check the Agreement
  3. Select self-extracting binary file(.bin file)Make sure you select the correct compressed binaries for your system architecture 32-bit or 64-bit

  • For example, if you are on Ubuntu Linux 32-bit operating system download 32-bit Oracle Java binaries.(for more instructions see)
  • For example, if you are on Ubuntu Linux 64-bit operating system download 64-bit Oracle Java binaries.(for more instructions see)

Set execute permissions.
  • in 32-bit run this command in terminal
    • chmod a+x jdk-6u <version>-linux-i586.bin
  • in 64-bit run this command in terminal
    • chmod +x 6u <version>-linux-x64.bin

Copy your downloaded Jdk file where you want to install it.
  • I create install folder inside my home folder and then create java6 folder inside install folder then copy the file

Run the self-extracting binary.
            Go to copied folder run,
                        cd install/java6
            in 32-bit run this command in terminal
                        ./jdk-6u <version>-linux-i586.bin
            in 64-bit run this command in terminal
                        ./jdk-6u <version>-linux-x64.bin
            when exaction is finish set the path variable

Path setting.
            Open .bashrc file,run this command in terminal
                        sudo gedit ~/.bashrc
            Add lines bottom of the page
                      #Java configuration:
(put a readability comment.this is only topic if you don't want it, ignore this line)
                     export JAVA_HOME=/home/hal/install/java6/jdk1.6.0_45
(setting environmental variable for Java.this is the path of jdk1.6.0_45 folder change it as yours )
                     export PATH=$JAVA_HOME/bin:$PATH
(setting path variable for java bin folder)
            Then save the file and source it ,run this command in terminal
                     source ~/.bashrc
           Close the file(ctrl+c) run this command in terminal
                    java -version

           It will give you following screen
screen shot

Saturday, October 6, 2012

Set Table Borders in BIRT

Set Table Borders in BIRT.

hi,
In here i try to give you  a brief  description about add uniform table borders.when you create a table some times it disappears its borders.its very tedious work to add it again.

a.when mouse pointer goes on the table it appears "Table" handle in the bottom left corner.Click on it to get the row / column handles.


b.Click on the top-left corner and this will select the whole table (although in the Properties window you will see “Cell”!).

 c.Now set the desired border setting in the Properties window and they will be applied uniformly (Excel style) on all cells in the table.






Monday, February 13, 2012

Hi all...
This is my first blog post.It is about a illustration of GIS practical paper first question.If there is any mistake please tell me.I would like to get know your comments.
Ok lets start our practical session.
Question;01.Prepare the layout map of Sri Lanka to compare district populations for 1981,2001,2010

  •  Use Dist_Pop.shp shape file and Pop_Data.dbf database.(this files are given)
  • Insert a title,north arrow,legend and scale bar to the map.
  • Insert index number as a text at bottom right coner of the map.
  • Save the layout as a jpeg file with index number.


To start ArcMap, choose Start-Programs-ArcMap (or the equivalent on your computer). It will take a minute to start
Now appear ArcMap-Getting Started window,then click OK,then you come in to blank window. In here you can add data to Layer.
figure-01

By clicking this plus sign you can shape files.
figure-02


 Using ctrl button can select many files at once. Then click ADD.
figure-03



This data appear in the Table of Contents, on the left side of the screen,  it should only say "Layers". If you do not see this separate area, choose Window - Table of Contents. Again, sometimes this gets turned off by a previous user.
Now you can see the window like this;
figure-04


Then you have to make a join between Dist_Pop and Pop_Data files.so right click on the Dist_Pop and select Joins and Relates- Join… as following figure.
figure-05


Then Join Data window will appear (fig-06).then you have to select IDnew to 1, Pop_Data for 2 and Idnew for 3, others keep as default settings. Then click OK.
figure-06

Then again right click on the Dist_Pop and select properties. Then appear Layer properties window.
figure-07







Then appear Layer Property window
figure-08



In this window we select Symbology- Charts-Bar/Column. By using Field Selection window select which field we want to add our map. In this problem tells us to select population of 1981, 2001, 2010.
And also In here u can change the features of graph.

And put district names we use Labels tab and mark the check box then press OK.
In here u can change font colour size and etc.
figure-09
Now you can see the graph as follows. This is Data View
figure-10
Now we going to Layout View by clicking bottom left corner tab (mark in red circle)
figure-11
By using insert tab we can add title, north arrow, legend and scale to the map After all map appear like figure-13
figure-12                                                 



















figure-13

When it saves as jpeg format select File-Export Map .then appear Export map window. In here we can select file type and give file name and click save button.

If you have any comment leave here it can be good or bad,i will kindly accept it.
Tanks for all... :)