October 13, 2017

Install Youcompleteme with pathogen in neovim

Notes for installing YCM with pathogen, Mac environment. Prerequisites: brew cmake python3/python2 (here i use python3) # 1. Install neovim brew install neovim # 2. Install neovim python provider # https://neovim.io/doc/user/provider.html#provider-python pip3 install --upgrade neovim # 3. Install YouCompleteMe cd ~/.vim/bundle git clone https://github.com/Valloric/YouCompleteMe.git && cd $_ git submodule update --init --recursive # here i use system clang rather than downloading, and i only need c family, golang, javascript, rust completer python3 install. ... Read more

September 30, 2017

Cron need root password to be set

I am using Digital Ocean with password login disabled. I provision new machine using ansible userdata, so that every team member can login by ssh. Everything works fine until one day I find cron job doesn’t work correctly under root. The error log is pam_unix(cron:account): expired password for user root (root enforced) The tricky part is, when creating a new droplet, Digital Ocean needs you to login by initial password and reset it immediately. ... Read more

September 12, 2017

Get ready for FreeBSD

I would like to install both FreeBSD and Win10 onto my old workstation. FreeBSD offical manual is quite straight forward and smooth for beginner to complete installation. It just misses some pieces for dual boot with old BIOS, here it is. I am installing version 11.1 and still using ufs with old BIOS, most parts should be compatible to the previous versions. Now when you come to Partitioning step, choose Manual, you might probably see a divice like ada0 with MBR label followed by ada0s1 and ada0s2 with NTFS label. ... Read more

March 29, 2017

Cookie sync in programmatic advertising

Cookie is a browser mechanism to store small piece of information in client’s browser. Now days, cookie is widely used in: - Sign in. Store session in cookie for server side authentication. - User preference. It stores user preference and load them when open the site which makes the UI user friendly. - eCommerce. Remember the good in your shopping cart. - Tracking behavior. It records the user behavior for better targeting. ... Read more

March 9, 2017

yiin, free to wording

Yiin(隐) is an ancient Chinese life style which an individual tends to keep himself away from social life only focusing inside. I made this product because sometimes I just feel tired of registering and verification, password things when I want to say something. Saying to yourself or even nobody without asking for any comments or feedback should not have any barriers. It’s human nature that you are not asking for passport just for talking, you talk when you want to talk. ... Read more

December 21, 2016

Provision AWS Lightsail with Ansible

Amazon has announced a new cloud service Lightsail recently aiming at DigitalOcean, with exact same price and same spec of node. As a heavy DigitalOcean user, I am more than happy to try the alternative provided by AWS. Creating the first instance is not smooth, I got successfully created the first instance by AWS SDK after 3 weeks in and out mails with the support team. TL;DR This post is a quick guide on provisioning the instance by Ansible. ... Read more

November 18, 2016

Https for everything

HTTPS is highly recommended for every web site, as a web developer I am building both my personal and company app under https. Applying for the certificates could be a block for you to migrate/build your site to https as you need to pay for it and it could take quite a while. Thanks to letsencrypt now we can have free open certificate authorify for our sites. I will list the least steps to build a site by using certbot ... Read more

September 11, 2016

How to make ngrx/store work with HMR

In my previous post, I talked of a way to develop angular 2 app with HMR. The vendors I use are @angularclass/hmr and @angularclass/hmr-loader Later on, I thought I might need a data flow tool like redux to manage my app state and I found ngrx/store @angularclass/hmr injects some hmr prefix life cycles into the main module to let you to restore the data. But app state management is optional and you can choose your own way to implement it, so I will walk you through how I implement HMR with ngrx/store ... Read more

September 3, 2016

Angular2 HMR with backend server supported

Currenly I am developing a client + server side boilerplate with Angular 2 and Feathers. For server side, I am using ts-node with nodemon, so far so good. But I find it cumbesome that every time I need to bundle client side code. After some exploring, I find a way to solve the problem. These are the dependencies: angular2-hmr a bootload wrapper on bootstrapModule, it’s cleared classified how to use in github angular2-hmr-loader, a webpack loader to work with the previous one webpack-dev-middleware, just like webpack-dev-server webpack-hot-middleware, an express/feather middleware just like webpack-dev-server w/ hot All of their READMEs clearly walk you through, it just suprises me that few information could be connected on this while it’s a quite general practice in React