Google Cloud Platform : Enable Authentication with SSH and Password using AuthenticationMethods option

Here I am going to explain, how to enable Key and Password based authentication in linux instances of Google Cloud. This can be applied on other Cloud or standalone Linux instances. But do check manuals ūüôā

When i say Key + Password, I am not referring passphrase which we give while created Private/Publich SSH key. I am referring to multiple auth methods where system will be first authenticated via PubKey and then via Password.

If your Pubkey is not matching it won’t allow you to login. If password not matching then also it won’t allow you to login. You must use exact same credentials which you configured.

I am not explaining here how to create SSH keys or password, I am assuming you already know that.

Continue reading

Posted in Cloud, Google Cloud, linux | Leave a comment

Angular Js: ng serve doesn’t listen remote machine

If you are working on Angular Js and trying to run it form remote machine, you will face this issue of site not opening.

ng serve

above command binds to with port 4200 by default.

In order to open this up for all IP address you can use below command while running ng serve.

Posted in angularjs | Leave a comment

TFSBuild – Custom Fields

Last week i was working on TFSBuild using TFS Buildserver to build a java project and there was one major challenge¬†managing TFSBuild.proj file created when build definition was done. You can only have one proj file and you can’t use it in flexible way by changing lifecycle based build files, drop location etc.


Continue reading

Posted in Articles | Tagged , , | Leave a comment

Oracle Constraint Exceptions

ADD/ENABLE constraint exception like ORA-02437, ORA-02299 etc

Today while working on one assignment I came across situation where I have to enable a unique key constraint on the table which some one disabled and forget due to which many duplicate records get entered and started creating problem for the application.

Now challenge is to find out all those records there are ways to  find duplicates by writing some queries but this is easiest and faster way by using Oracle Exceptions table.

Continue reading

Posted in debug, Oracle | Tagged , , | Leave a comment

Bulk file copy in unix with custom name

In Unix I have to copy bulk files from one folder to another they are in below form

FILE1_547804_550484_2013-12-19 21.15.32_913.pdf
FILE2_518868_616944_2014-01-03 21.10.49_718.pdf

but while copying to the destination want to remove time part and copy as below:


Continue reading

Posted in unix | Tagged , , | Leave a comment

Copy First N files from current directory to other directory

I was working today on one production issue where a requirement came to restore files from a archive directory in batch of 250, so i created this command to run in unix, have a look might be helpful for you.

Continue reading

Posted in unix | Tagged , | Leave a comment

com.jcraft.jsch.JSchException: reject HostKey: serverName

Today I was working on a Ant target to upload file to server using SCP task which using jsch-0.1.49.jar API. Below is the syntax for same in Ant build.xml. You need to add the API file in class path.

<target name=”copyFileToServer”>
        <echo>::::::::copyFileToServer Example::::::::::::</echo>
¬†¬†¬† <scp file=”Sample.txt” todir=”${svn.username}:${svn.password}@${hostname}:/tmp/” verbose=”true” port=”2222″¬† failonerror=”true”/>

When I tried this I faced “reject HostKey” error. Reason of error was server was not listed in my known hosts list. So in order to fix this you have two options either add that server to known host list or

Continue reading

Posted in ant | Tagged , | 6 Comments

Download sequence of files using Curl

In day to day life we used to download useful stuff from world wide web, sometime requirement to download sequence of files, one way is to do it manually by clicking individual links or automate the download using Curl.

Showing you that next, how we can do it.

grab Curl from :

Curl has the ability to set sequences (including with leading zeroes, and alphanumeric sequences) as part of the download command which makes it a lot easier. This is all covered in the man page so I suggest reading it for a complete understanding of the options available.
Continue reading

Posted in unix | Tagged | Leave a comment

How to get XML from body of soap using XSLT

It happens sometime you want to extract XML body from SOAP message. In order to do that use below mentioned XSLT.

Continue reading

Posted in HowTo, xml | Tagged , | Leave a comment

jQuery: Problem with id containing a period or asterisk

Today I was writing a code to get error text from spring generated span field using jQuery. Where I noticed that name is having a period and asterisk which is not directly supported by selectors.

<div id=”test1″><span id=”*.errors“>The information you entered is invalid. Try again.</span></div>

Continue reading

Posted in jQuery | Tagged | Leave a comment