Skip to content

Instantly share code, notes, and snippets.


Alvin Ye 叶冬开 alvin2ye

View GitHub Profile
View register_centos_https
set -e
echo "=== init folder ==="
mkdir -p /var/www/letsencrypt
mkdir -p /root/ssl
echo "=== <%= domain %>.conf ==="
View nginx-app-3000.conf
upstream app_web_services {
server {
listen 80;
root /app/public;
gzip on;
gzip_types text/plain text/xml application/xml application/xml+rss
View app.conf
command=/bin/bash -lc "bash /tmp/boot_production.bash"
alvin2ye / serve.go
Created May 16, 2019 — forked from paulmach/serve.go
Simple Static File Server in Go
View serve.go
Serve is a very simple static file server in go
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
package main
alvin2ye / upload_aliyun_sso_private.bash.erb
Last active Jun 27, 2019
View upload_aliyun_sso_private.bash.erb
#!/usr/bin/env bash
export LC_ALL=C
PROJECT_PREFIX=<%= prefix %>
OSS_BUCKET_NAME=<%= bucket %>
LOCALFILE=<%= file %>
ENDPOINT=<%= endpoint %>
alvin2ye / generate_test_file.rb
Last active Jan 28, 2019
View generate_test_file.rb
# curl -sSL | ruby - "app/controllers/wechat_platform/official_accounts/webhooks_controller.rb"
# generate spec/requests/wechat_platform/official_accounts/webhooks_controller_spec.rb
require "FileUtils"
rbfile = ARGV.first
test_file = rbfile.gsub(/^app\/controller/, "spec/request").gsub(/_controller\.rb$/, "_controller_spec.rb")
View gist:fcfbe49a4a63d70e737fa81ada56c5c7
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta name="format-detection" content="telephone=no">
View oufei-template-1.html
<!DOCTYPE html>
<html lang="zh-CN">
<meta charset="utf-8">
<link rel="stylesheet" href="" type="text/css">
.right {
text-align: right;
View nginx_3000_to_80.conf
gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_min_length 1000;
gzip_proxied any;
gzip_disable "msie6";
gzip_http_version 1.0;
alvin2ye / install_nginx_on_ubuntu_1604
Last active Oct 29, 2017
View install_nginx_on_ubuntu_1604
# install packages
sudo apt-get update
sudo apt-get install -y --no-install-recommends software-properties-common apt-transport-https ca-certificates curl
sudo apt-get remove docker docker-engine
# intall nginx
You can’t perform that action at this time.