Skip to content

Instantly share code, notes, and snippets.

@alvin2ye
alvin2ye / .tmux.conf
Created July 24, 2021 06:13
.tmux.conf
# 改为 vim 模式
setw -g mode-keys vi
bind-key -t vi-copy v begin-selection
# 设置window的起始下标为1
set -g base-index 1
# 设置pane的起始下标为1
set -g pane-base-index 1
#!/bin/bash
set -e
echo "=== init folder ==="
mkdir -p /var/www/letsencrypt
mkdir -p /root/ssl
echo "=== <%= domain %>.conf ==="
@alvin2ye
alvin2ye / nginx-app-3000.conf
Created June 3, 2019 03:24
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
@alvin2ye
alvin2ye / app.conf
Created June 1, 2019 00:28
app.conf
[program:app]
command=/bin/bash -lc "bash /tmp/boot_production.bash"
@alvin2ye
alvin2ye / serve.go
Created May 16, 2019 05:23 — forked from paulmach/serve.go
Simple Static File Server in 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 June 27, 2019 09:06
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 January 28, 2019 03:17
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))
<!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>
@alvin2ye
alvin2ye / oufei-template-1.html
Created December 18, 2018 13:15
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;
}
@alvin2ye
alvin2ye / nginx_3000_to_80.conf
Created January 16, 2018 02:50
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;