enjoy coding, enjoy life.

Code

Gracefully shutdown a http server in golang

To gracefully shutdown a http server requires a few steps.

The http library's serving function will block over there when getting started, until we call http.Server.Close(). As for us, we can invoke the starting function in a goroutine, and call close in another one.

Code

VIM: No protocol specified

After installed vim-gnome, every time I execute "sudo vim", it will print one line

Bash
$ sudo vim # doing something, and quit it
No protocol specified

Code

Install Node.js and Yarn

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. It could used to create front-end project easily. Yarn is a fast dependency management tool. npm is great, but yarn could make the management better.

Code

Install CUDA 9.2 on Ubuntu 18

CUDA is a parallel computing platform and application programming interface (API) model created by Nvidia. I am supposed to install this package in my system.

Code

Guake hangs when exit on Ubuntu 18

Guake is a dropdown terminal made for the GNOME desktop environment. Guake's style of window is based on an FPS game, and one of its goals is to be easy to reach. Recently, my new Ubuntu 18.04 LTS is meeting a bug. When I was trying to exit a shell, the Guake would hang over there, which makes this application even unable to use.