Skip to content

Instantly share code, notes, and snippets.

Avatar

Alvin Ye 叶冬开 alvin2ye

View GitHub Profile
View register_centos_https
#!/bin/bash
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 127.0.0.1:3000;
}
server {
listen 80;
root /app/public;
gzip on;
gzip_types text/plain text/xml application/xml application/xml+rss
View app.conf
[program:app]
command=/bin/bash -lc "bash /tmp/boot_production.bash"
@alvin2ye
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
Usage:
-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
alvin2ye / upload_aliyun_sso_private.bash.erb
Last active Jun 27, 2019
upload_aliyun_sso_private.bash.erb
View upload_aliyun_sso_private.bash.erb
#!/usr/bin/env bash
export LC_ALL=C
PROJECT_PREFIX=<%= prefix %>
OSS_BUCKET_NAME=<%= bucket %>
LOCALFILE=<%= file %>
OSS_ACCESS_KEY_ID=<%= ak %>
OSS_ACCESS_KEY_SECRET=<%= sk %>
ENDPOINT=<%= endpoint %>
@alvin2ye
alvin2ye / generate_test_file.rb
Last active Jan 28, 2019
generate_test_file.rb
View generate_test_file.rb
# curl -sSL https://git.io/generate_test_file | 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")
FileUtils.mkdir_p(File.dirname(test_file))
View gist:fcfbe49a4a63d70e737fa81ada56c5c7
<!DOCTYPE html>
<html>
<head>
<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">
<title></title>
View oufei-template-1.html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>瓯飞</title>
<link rel="stylesheet" href="https://cdn2.agideo.com/181127/bfdb80de8200.css" type="text/css">
<style>
.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
alvin2ye / install_nginx_on_ubuntu_1604
Last active Oct 29, 2017
install_nginx_on_ubuntu_1604
View install_nginx_on_ubuntu_1604
#!/bin/bash
# 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 docker.io
# intall nginx
You can’t perform that action at this time.