Software Basic – Definitions

Manifest: A manifest file in computing is a file containing metadata for a group of accompanying files that are part of a set or coherent unit. (wiki)

Metadata: Metadata is “data that provides information about other data”.[1] In other words, it is “data about data.” (wiki)

Artifact: A software build contains not only the developer’s code also includes a range of software artifacts. A DevOps artifact is a by-product produced during the software development process. It may consist of the project source code, dependencies, binaries or resources, and could be represented in different layout depending on the technology. Software artifacts are usually stored in a repository. (Jfrog)

Snapshot: A snapshot version in Maven is one that has not been released.
It’s basically “x.0 under development”.

First month at Amazon – “Culture Shock”

It has been nearly a month since I started to work at Amazon in Seattle. To be honest, as a software developer, I kind of realize my years “dream” to work in a the top notch world class tech company.

But when in this big war ship, you find yourself quickly be educated or shocked by Amazon strong company culture and I would like to share some of them.

  1. Day 1” culture, each day should be considered as your first day at Amazon, that means you should be always passioned, motived and curious.
  2. Customer Obsession“: “We Start With the Customer and We Work Backward”. “Focus on customers over competitors”…
  3. Empty chair“: It is said early Jeff used to put an empty chair in each meeting. That empty chair represent our customer and what will he/she say or expected..
  4. Two pizzas” team rule: In the early days of Amazon, Jeff Bezos put a rule: every internal team should be small enough that it can be fed with two pizzas..
  5. Word Doc over PPT: Amazon love word document over PPT and each document should not be over 6 pages..
  6. Amazon loves writing: we have our internal wiki tools, you could find anything in that wiki site. We put design documents, any thoughts and everything useful into written wiki pages..
  7. “You own your proper career”: in amazon everyone could be leader, at least you are the leader of your self. You are given enough space and freedom to be driven by your own idea and actions. You don’t need to wait the orders by someone else.

Github Invalid username or password Problem

Using GitHub under command line and two factory authentication , we may encounter an “Invalid username or password” problem when we enable 2FA two-factor auth and try “git push“.

The solution is to instead of using your GitHub account password, you need to generate a secret token.

Here is the instruction from Github: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line

Finally, you should do is:

$ git clone https://github.com/username/repo.git
Username: your_username
Password: your_token

This blog is under category “others“.

Technology secrets behind Alibaba 11.11

This blog is inspired and based on the Alicloud WeChat article https://mp.weixin.qq.com/s/X1MtLk71LLZnsYZBVv-hHA

This year 2019-11.11, Alibaba Tmall double 11 sales event accomplished Turnover of 268.4 billion Chinese Yuan! The peak value of orders reached 544,000 units/second, and the data processing capacity per day reached 970PB! And all the system is based on Alibaba Cloud.

According to CTO Alibaba said in this blog, there were four technology secrets behind this.

  • 3rd Generation of X-Dragon Architecture. An AWS nitro similar technology.
  • OceanBase and PolarDB. Those are Alibaba’s self-made Databases.
  • Calculation and storage are separated. The storage is on remote and could be easily for expansion
  • RDMA(RemoteDirect Memory Access) in order to access the remote storage data quickly.

We could see in order to support and boost such large data requesting case, we should improve on the physical machine side and also database sides. Reading retrieving data quickly is the key.

Tips : H1b Visa Stamping in Paris France – Conseils pour préparer votre H1B visa à Paris France

  • Fill the famous DS-160 form online.
  • Take the appointment online as early as possible.
  • Arrive early on the visa stamping day because there will be a very long queue outside the US embassy.
  • Don’t bring the laptop and Ipads with you because they are not allowed and you should search the nearby hotel to store them temporarily.
  • Bring everything about the documents even they are not asked on the list. For example, your CV, offer letter, etc.
  • Speak clearly and in detail about your experiences when they are asking.
  • In the end, you should ask if your visa is approved or checked!
  • If your visa unfortunately checked, be patient and send emails to USA Paris embassy for the update regularly.

Integration Okta with your web application

1. Introduction Okta

Okta is an amazing identity management SasS products. It provides single sign-on solution, serves as a Security Gateway and it can protect all the internal employee daily used applications.

It also provides Okta API, so you can integrate their solution into your application. For example, you can use okta authentication and authorization API to control login.

2. Create a Okta Web Application

You start by sign up in Okta Developer .  And then create a Web Application :

Specify Login redirect URIs

3. Integration Front End : okta_sign-in_widget

You could use Okta Sign-In Widget  as your login page.

var signIn = new OktaSignIn({baseUrl: 'https://dev-xxxx.oktapreview.com'});
  signIn.renderEl({
    el: '#widget-container'
  }, function success(res) {
    if (res.status === 'SUCCESS') {
      console.log('Do something with this sessionToken', res.session.token);
    } else {
    // The user can be in another authentication state that requires further action.
    // For more information about these states, see:
    //   https://github.com/okta/okta-signin-widget#rendereloptions-success-error
    }
  });
4. Integration Back End:  Implement the Authorization Code Flow

At a high-level, this flow has the following steps (copy from doc Okta):

  • Your application directs the browser to the Okta Sign-In page, where the user authenticates.
  • The browser receives an authorization code from your Okta authorization server.
  • The authorization code is passed to your application.
  • Your application sends this code to Okta, and Okta returns access and ID tokens, and optionally a refresh token.
  • Your application can now use these tokens to call the resource server (for example an API) on behalf of the user.

As mentioned in the above login widget javascript, you could get a res.session.token, you send this session token to backend controller.

Backend controller use this session token call /authorize endpoint to get a code (you might get a 302 response and in the response header you could find a location with a URI contains code param)

After that, using code to call /token endpoint to get the access and ID tokens.

Akka Actor – Scala

1. Akka Actor:

Actor Model: One of the technologies used to deal with deal with concurrent computation. (The other two are: Reactor and Event Driven).

2. Create Actor:

Actors are implemented by extending the Actor base trait and implementing the receivemethod.
Props is a configuration class to specify options for the creation of actors.


class SenderActor(message: String, receiverActor: ActorRef) extends Actor {

  var receivedMessage = ""

  def receive = {
    case WhoToSend(who) =>
      receivedMessage = s"$message, $who"
    case Message =>
      receiverActor !Print(receivedMessage)
  }
}
3. Actor communication(in scala):
  • ! means “fire-and-forget”, e.g. send a message asynchronously and return immediately. Also known as tell.
  • ? sends a message asynchronously and returns a Future representing a possible reply. Also known as ask.

object MainApp extends App {
  val system : ActorSystem = ActorSystem("MainApp")

  val receiverActor: ActorRef = system.actorOf(Receiver.props, "Receiver")

  val sender1: ActorRef = system.actorOf(Sender.props("Bob", receiverActor),"Sender1")

  sender1 ! WhoToSend("Tom")
  sender1 ! Message
}

Github Source Code

Learning Flask Python – 0

1. Install python3 (Mac)

brew install python3
2. Install PIP (Python Package Index)

curl https://bootstrap.pypa.io/get-pip.py > get-pip.py
sudo python get-pip.py
3. Install virtualenv (a tool to create isolated Python environments)

sudo pip install virtualenv
4.Create a project

$ mkdir myproject
$ cd myproject
$ virtualenv venv

$ . venv/bin/activate
5. install flask

$ pip install Flask
6. create a hello world app

create a hello.py under myproject folder


from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

run app:


$ export FLASK_APP=hello.py
$ flask run

Git Squash

When using Git on a branch of development feature, we did several commits and we want to combine all the lasts commits into one.

Git Squash

On your local dev branch:

  • git rebase -i <SHA Code: all the commits after this (include) will combine>
  • change pick to squash
  • save modification
  • git push origin <your_branch> --force

Git Reset local branch as remote master branch

  • git fetch origin
  • git reset --hard origin/master