Sync up Docker container time with Host’s

I’ve had some issues with my application’s user session being expired as soon as it got created. After further investigation, it was due to the fact that docker container’s time was far behind the current PDT(which is where I am and a default timezone for all my servers).

Easiest solution was to mount these two files from host to any containers:

After the two lines of docker volume, viola. Time synced between host and container.

Bye bye data-only container! Hello named volume!

Persistent data practice that I’ve been using with Docker has been the host volume although I knew that data-only container pattern existed.

So this time around, I was going to start utilizing data-only container pattern for some of db containers. However, I got to know that after docker version 1.9.0.

For example with data-only container pattern, we would have a docker-compose file like this:

However, a better approach would be:

New way of web application deployment: “Bakery” process

I have been quite interested in continuous deployment and working on ‘bakery’ process using OpenStack (which is another cloud environment comparable to AWS).

A traditional way of deployment is normally:

  • pull source code from source management on production env
  • create a tar file and then scp it & remote execute a script to untar
  • create a debian or rpm package, and then remote install it

They are ok ways, but main issue with them seems to be ability to keep multiple environment consistent and slow deployment processes.

Continue reading

Weekend Project – Backyard Makeover #1

I’ve been living in my place for little more than 3 years and have not done anything to my backyard except regular mowing and trimming some branches.

Now California weeds took over my grass and it got already out of my hand. Facing the backyard challenging, I’ve set a resolution for 2016 although it’s already past the new year: Backyard Makeover!

Without further due, this is the current state of my backyard.
Continue reading

merging two git repos with history

I needed to merge two repos with history so that the target repo has merging repo’s history. This answer at stackoverflow had solved my issue.

So that was to merge project-a into project-b.

One thing I need to note is that project-b and project-a have to be git-cloned already, so prerequisite for the above the order of execution was as follows:

Also, don’t forget to commit your changes after the merge.

Simple Http Server on Mac

While working on html/css/js, it’s convenient to view those pages from http server. However, I don’t want to use MAMP or Virtual machine to set up nginx/apache.

I found this pro tip from this.

So I ended up with adding an alias to my .bash_profile file as follows:

Note that port number below 1024 cannot be bound as a normal user. This is meant to simply run a http server for development purpose. Do not use it to run your web application.