Thursday, 16 November 2017

Github: How to keep Your Forked Repo Up-to-Date?

Sometimes, when we don't have "write" access to your working repository, we cannot create a new branch to apply your changes or we cannot push our changes to master.

We cannot create PR (Pull Request) to review your changes by peers.

In this case, we cannot use "Cloning", should use "Forking" concept.

Github Forking:

Forking is different from Cloning. Login to your github.com profile and click on "Forking" button or link available at top right corner.



It creates same repository into your github profile. Then fork it and work on changes.

Now we don't need to create a Branch as we are working on forked repository.

Just pull your changes to your forked master:   

$ git pull

Forking Problem:

Above procedure works as long as you don't see the following message:





Resolution:

Lets us ORIGINAL_REPO  is main repository and FORKED_REPO is our forked repo created from ORIGINAL_REPO.



1. Clone your fork:

git clone git@github.com:<user-name>/FORKED_REPO.git

2. Add remote from original repository in your forked repository:

cd FORKED_REPO_PATH
git remote add upstream git://github.com/<user-name>/ORIGINAL_REPO.git
git fetch upstream

3. Updating your fork from original repository to keep up-to-date changes:

git pull upstream master


4. Push changes to your forked repository:
git push


Thank you 










Wednesday, 8 November 2017

Install Firefox old version in Ubuntu (Linux)

Sometimes, we need to use old version to test some kind of testing like Acceptance tests, Performance tests, Browser Stack Testing etc.

My Linux system has default latest version of Firefox 55 and my automation tests required Firefox version 45.

In this case, we can NOT use our default latest version of browser.

I faced same issue with my current project with Firfox browser in Ubuntu (Linux) and fixed it by doing the following steps:

ram:~$ apt-cache show firefox | grep Version
Version: 55.0.2+build1-0ubuntu0.16.04.1
Version: 45.0.2+build1-0ubuntu1


It list out all available Firefox browser versions in your system.

To deploy the required version, please use this command:

ram:~$ sudo apt-get install firefox=45.0.2+build1-0ubuntu1


Now, we can continue our testing using firefox version 45.

Thank you so much for reading my tutorials.

PS:- Please support my blog by clicking some ads.


Thursday, 2 November 2017

Play 2.6.x: Joda DateTime Format not working

In Play Framework 2.6.x, Joda DateTime Format (that is READs and WRITEs) is not working. When we use something like below:

(JsPath \ "joiningDate").read[LocalDate] 

We will see the following error message:

No Json deserializer found for type org.joda.time.LocalDate. Try to implement an implicit Reads or Format for this type.

To fix that issue, we need to do the following two setps:

1. Add the following entry into your build.sbt file

libraryDependencies += "com.typesafe.play" % "play-json-joda_2.12" % "2.6.6"

Or

scalaVersion := "2.12.2"
libraryDependencies += "com.typesafe.play" %% "play-json-joda" % "2.6.6"

2. Add the following imports to your Model file
import play.api.libs.json.JodaWrites._
import play.api.libs.json.JodaReads._

Description:
They have separated the Joda Date and Time library into a separate module:
play-json-joda

That's it.

Thank you for reading my tutorials.

Thursday, 20 July 2017

Linux: Know PID running at a specific port number

To know the process id which is running on a specific port number


$ sudo netstat -nlp | grep :1212
   tcp6       0      0 :::1212        :::*   LISTEN      21341/java 


$ lsof -i 

It displays the information of all currently running process like PID, port number, user etc.


Example:-

$ lsof -i
COMMAND     PID    USER   FD   TYPE DEVICE      SIZE/OFF NODE NAME
java       60729   ram  7188u  IPv6  121212      0t0  TCP *:1291 (LISTEN)
java       60850   ram  7181u  IPv6  1212        0t0  TCP *:1195 (LISTEN)
java       60949   ram  8173u  IPv6  1212        0t0  TCP *:2272 (LISTEN)
java       70040   ram  1971u  IPv6  1213        0t0  TCP *:2230 (LISTEN)
java       70142   ram  9072u  IPv6  11111       0t0  TCP *:4449 (LISTEN)
java       70232   ram  1365u  IPv6  111         0t0  TCP *:5585 (LISTEN)
java       70318   ram  1476u  IPv6  111         0t0  TCP *:6514 (LISTEN)
python     70400   ram    43u  IPv4  2222        0t0  TCP *:1232 (LISTEN)
java      180595   ram  3402u  IPv6  22222       0t0  TCP *:3232 (LISTEN)



Then run kill command to kill it.

$kill -9 <PID>

Thanks you.

Wednesday, 17 May 2017

Activator will be EOL-ed on May 24, 2017.

Activator will be EOL-ed on May 24, 2017.

We’re making it easier and simpler for developers to get started with Lightbend technologies.


This unfortunately means that future releases of Play, Akka and Scala will no longer include Activator support, and Lightbend’s Activator server will be decommissioned by the end of 2017. Instead of supporting Activator to create and set up development projects, we'll be supporting standard Giter8 templates for sbt users and Maven archetypes for Maven users.

So going forward,
To create new Lightbend projects
Instead of using the Activator command, make sure you have sbt 0.13.13 (or higher), and use the “sbt new” command, providing the name of the template.

For example, “$ sbt new akka/hello-akka.g8”. You can find a list of templates here.

Also, as a convenience, the Lightbend Project Starter allows you to quickly create a variety of example projects that you just unzip and run.

To create new templates

If you want to create new templates, you can now do that in Giter8.

To migrate templates from Activator to Giter8
If you created Activator templates in the past, please consider migrating them to Giter8 with this simple process.

Thank you!

Friday, 21 April 2017

Akka 2.5.0 Framework Features

Akka 2.5.0 Released!
we—the Akka committers—are proud to be able to announce the availability of Akka 2.5.0. Since the release of Akka 2.4.0 (already 18 months ago) we have incrementally added many new features to the 2.4.x release series, including Akka Streams and HTTP. That has worked well and we think you appreciate the API stability of all those patch versions. As always, there are some changes one cannot do in patch versions and therefore it is time for Akka 2.5. One of these changes is to promote some of the experimental modules to fully stable modules and incorporate some API improvements before declaring them stable.
Akka 2.5 is binary backwards compatible with 2.4 with the ordinary exceptions listed in a separate section below. Read the migration guide as the first step.
The key features of the 2.5.0 release are:
  • The Java API for AbstractActor was promoted to fully stable API. While doing this we made some small, yet important, improvements to the API that will require some mechanical changes of your source code.Thanks to @ortigali for help.
  • Faster and more flexible Akka Streams materializer, which matters for short lived streams, such as HTTP requests.
  • Distributed Data was promoted to a fully stable module. Several improvements were also included, such as:
    • Support for delta-CRDTs in Distributed Data to reduce the amount of data that is replicated, thanks to help from @gosubpl.
    • Generic type for the key in Distributed Data ORMap, thanks to jgordijn
  • Coordinated shutdown to facilitate ordered stopping of actors and services and perform registered tasks during the shutdown process. This greatly simplifies tasks involved in graceful leaving of Akka Cluster.
  • Support remembering entities in Cluster Sharding with the Distributed Data (ddata) mode. ddata is now also the default mode for Cluster Sharding.
  • New Java API for Testkit taking advantage of lambas, thanks to @Hawstein
  • Fix performance regression for Scala 2.12, due to change in scheduling fairness of the JDK8 ForkJoinPool implementation
  • We added @ApiMayChange and other annotations which can be used to mark experimental API inside stable modules, primarily for use in Akka HTTP.
  • API improvements of Akka Typed, including Java API

Binary Compatibility

Akka 2.5.x is backwards binary compatible with previous 2.4.x versions (exceptions listed below). This means that the new JARs are a drop-in replacement for the old one (but not the other way around) as long as your build does not enable the inliner (Scala-only restriction). It should be noted that Scala 2.12.x is is not binary compatible with Scala 2.11.x, which means that Akka’s binary compatibility property only holds between versions that were built for a given Scala version—akka-actor_2.12-2.5.0.jar is compatible with akka-actor_2.12-2.4.17.jar but not with akka-actor_2.11-2.4.17.jar.
Binary compatibility is not maintained for the following:
  • akka-testkit and akka-multi-node-testkit
  • modules and API marked as “may change”, such as akka-typed and akka-contrib
  • features, classes, methods that were deprecated in 2.4.0 or earlier and removed in 2.5.x
We had to make two additional exceptions:
  • Custom Mailbox implementations. Scala 2.12 is using the standard JDK8 ForkJoinPool, which may cause performance regression for some Actor messaging scenarios. Therefore we have embedded the ForkJoinPool from Scala 2.11 in Akka. This breaks binary backwards compatibility for custom Mailboximplementations that were compiled with Akka 2.4.
  • To make the Java APIs AbstractPersistentActor and AbstractPersistentActorWithAtLeastOnceDelivery to work with Scala 2.12 we could find no other solution but to break the binary compatibility of the Scala versions (which the Java ones were based on).
Being binary backwards compatible means that applications and libraries built on top of Akka 2.4.x continue to work with Akka 2.5.x without recompilation (subject to the conditions below), which implies that Akka HTTP as well as Play Framework 2.5 can be combined with Akka 2.5.

Tuesday, 4 April 2017

Play Framework 2.5.13 New Features

Play 2.5.13 “Streamy”

  • #7040: Add @helper.repeatWithIndex(…) helper
  • #7033: Fix XHTML mime type
  • #7013: Add note to Migration25 about Lucidchart blog
  • #6966: Fix documentation code NPE
  • #6954: Update Typesafe Config to 1.3.1
  • #6934: Update docs with more information about sbt new
  • #6948: Remove images that related to activator
  • #6944: Add Scalate as a library for Play support documentation
  • #6933: Add immutable header to aggressiveCacheControl
  • #6925: Upgrade sbt-native-packager to latest stable version
  • #6874: Update Deploying.md
  • #6908: Remove unnecessary println call
  • #6906: added play-guard (Scala) to module directory
  • #6850: Reference to play-redis module in Module directory in the documentation