clsung is reading

[GCP] Create disk from snapshot of another project

Step 0: create snapshot from desired disk, example name: disk-snapshot-20171026


[docker] Multi-stage builds

Consider the following scenario: you are going to rolling update your cluster, and it turns out your network bandwidth is limited for some reason and size of built docker image is not small enough. What’s worse, every instance of cluster will need to pull the docker image before start-up…


CoreOS remove early-docker since 1284.0.0

It happens the docker daemon wasn’t alive when I login to the console.


Update salt from 2015.5.3 to 2016.3.2

When reading salt’s source code, it seems we have a ‘source_hash_update’ option on “archive.extracted”, however when I added so, salt complains:

Warnings: 'source_hash_update', 'group' and 'user' are invalid keyword
              arguments for 'archive.extracted'. If you were trying to pass
              additional data to be used in a template context, please populate
              'context' with 'key: value' pairs. Your approach will work until
              Salt Carbon is out. Please update your state files.

Developing with consul on Macbook

For development use, we need to have consul running on localhost. When using a Macbook (Air), we need to specify the “-bind=0.0.0.0” and “-client=0.0.0.0” in order to have programs (tests) access to the consul agent in the container: 


重整 Exif 資料

多想幾天,可以不用重新發明輪子。 :p


Install docker on Centos 7

Perform a yum search docker, we can see two docker available:


EPEL 7 for Centos 7

To install EPEL-7

% rpm -ivh http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm

Also, enable it by default, edit /etc/yum.repos.d/remi.repo and set ‘enable=1’ under section of [remi] and [remi-


Install GNU gcc 4.8.2 on CentOS 6.4

Install pre-requirements:

% yum install gmp-devel mpfr-devel  libmpc-devel

Download and extract gcc 4.8.2 source tar ball:


Crop image in golang

In python, for cropping  image I use PIL. However the dependencies of PIL is huge, also need to install some lib*-dev packages.