All posts by nsyed4

About nsyed4

I like to find.

Setup VPN with Amazon EC2

  1. Setup the desired EC2 with SSH Server running which will be known as remote-host.
  2. On your Desktop, ssh to the EC2 using: ssh -D 8080 username@remote-host, you will be prompted for password of remote-host. Enter it. ORssh -D 8080 -I “private-key.pem” username@remotehost.
  3. Now go to your browser’s proxy settings, and configure it to use a SOCKS proxy with host name and port 8080
  4. Or if you are on a MAC, you can configure the SOCKS proxy in system preferences.
  5. Open any website, this now goes through the remote machine.


Simple Single Sign On with Spring Security OAuth2

In this tutorial, we’ll discuss how to implement SSO – Single Sign On – using Spring Security OAuth and Spring Boot. Very simply put, when a user tries to access a secured page in the client app, they’ll be redirected to authenticate first, via the Authentication Server.

from Pocket

Alexa’s New Avatar: Financial Adviser

Some UBS Group AG clients can pose any economic question to a machine: “Alexa, how would a Fed rate increase impact the U.S. economy?” A partnership with Inc. allows select UBS wealth-management clients in Europe to ask the virtual-assistant financial and economic questions.

from Pocket

Non-Functional requirements

  • Capacity – current and forecast – We determine based on current JVM traffic and response times.
  • Compliance – PCI that used credit card data. PII that should not appear in the logs.
  • Documentation – Wiki. I know that we can use Swagger
  • Disaster recovery – Data centers,
  • Extensibility – Plugins, Jars, kind of functional
  • Fault tolerance – Data centers, multiple JVMs
  • Interoperability – JSON, XML – REST
  • Maintainability – Code
  • Portability – Using Spring as it works with many containers and not using container specific features. If you put log4j in standalone.xml then it is not easily changeable. You should instead use log4j properties.
  • Reliability – Up time
  • Resilience – Flags / Contingency
  • Scalability – Same as capacity. Can we add two JVMs.
  • Security – Digital Signature.
  • Supportability – Can a restart fix the issue?
  • Testability – Are all the JUNIT test written and code covered.
  • Storage – Capacity related. HDD Size
  • Growth Requirements – Capacity related – RAM, HDD
  • Usability – From average user’s perspective

Two Phase Commit

Two Phase Commit in Distributed Transactions:

Unlike a transaction on a local database, a distributed transaction involves altering data on multiple databases. The database ensures the integrity of data in a distributed transaction using the two-phase commit mechanism. There are three phases in a two phase commit transaction and a commit point site involved. The job of the commit point site is to initiate a commit or roll back operation as instructed by the global coordinator.

  1. Prepare Phase: The initiating node, called the global coordinator, asks participating nodes other than the commit point site to promise to commit or roll back the transaction. If any node cannot prepare, the transaction is rolled back.
  2. Commit Phase: If all participants respond to the coordinator that they are prepared, then the coordinator asks the commit point site to commit. After it commits, the coordinator asks all other nodes to commit the transaction.
  3. Forget Phase: If all participants respond to the coordinator that they are prepared, then the coordinator asks the commit point site to commit. After it commits, the coordinator asks all other nodes to commit the transaction.

Spring Advantages with testing and Mocking

An application geared towards dependency injection is typically more testable because resources are easily replaced with test-oriented resources. Consider a service object that uses a data access object; in production, you’d inject a DAO that talked to a backend data store. But for each test you could create a DAO that returned specific, known data; this allows you to focus on the object being tested.


  1. Soap has overhead such as body, envelope and payload. Rest just has the payload.
  2. Using Soap allows you to use web services standards around transaction management and security out of the box. For example, you can use username/password in the soap header. In Rest, we have to come up with the implementation of non-functional requirements such as transaction management, security.
  3. SOAP supports XML by default and REST comes with XML and JSON by default.