implement an authenticating link using nginx-module-njs

sometimes, we need an authenticated link to provent our resources form abusing.
now we will accomplish that by using nginx-module-njs. here we go.

install nginx and nginx-module-njs module

1
2
3
4
5
wget http://nginx.org/keys/nginx_signing.key -O nginx_signing.key
sudo apt-key add nginx_signing.key
echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install nginx nginx-module-njs

Read More

通过travis-ci自动部署代码到服务器

Auto-Deploying via Travis CI

Because Travis CI can automatically execute scripts after successfully (or unsuccessfully!) executing tests, it is an obvious choice for a deployment tool. In order to deploy to a Git repository on a remote server, the process generally is as follows:

  • Set up SSH keys
  • Add the server’s copy of the repository as a Git remote
  • Push to the remote
  • SSH into the server and execute any installation/compilation/miscellaneous commands

Read More

rust编译器在windows下的安装

1.编译器的安装

打开在rust官网下载的rustup-init.exe,由于rust编译器依赖于c/c++编译器,需要gcc/g++,所以如果你电脑没有这个环境控制台就会提示你安装vistual studio(最低版本2013)。
不过我嫌这个工具太大所以使用msys2来替代它。msys2是Windows平台下的包含gcc/g++的编译工具。打开msys2(https://www.msys2.org/)官网,下载后按照文档一步步安装即可。

Read More