Skip to content

Instantly share code, notes, and snippets.

View lewangdev's full-sized avatar
🐢
Running

LE lewangdev

🐢
Running
View GitHub Profile
@lewangdev
lewangdev / nginx.conf
Created September 24, 2019 06:13 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
{
"inbounds": [
{
"port": 1082,
"protocol": "socks",
"settings": {
"auth": "noauth"
}
},
{
@lewangdev
lewangdev / router-shadowsocks-setup.sh
Created April 26, 2019 04:55
create a transparency proxy on linux based router
## IPSET
# OR ipset create gfwlist hash:ip
ipset -N gfwlist iphash
## DNS
# gwflist 中的域名转发 dns 请求到 1.1.1.1:53 查询,并且通过 dnsmasq 存到 gfwlist ipset 中
# 启动一个本地 socks 代理给转发 DNS 使用
/opt/shadowsocks/bin/ss-local -c /opt/shadowsocks/etc/dns2socks.conf -f /var/run/ss-local.pid
# https://github.com/qiuzi/dns2socks
@lewangdev
lewangdev / bulket.py
Created August 7, 2018 09:41
Bulket insert data to MySQL by python
#coding=utf8
import MySQLdb
class Connectdb():
def __init__(self):
self._conn = MySQLdb.connect("localhost", "root", "letmein",
"db_test", charset="utf8")
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
ngx.exit(403)
end
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"
#!/bin/bash
#####
# Builds a custom nginx
#
# RELEASE_TAGS="+your+tags+here"
# RELEASE_MAINTAINER="Your Name Here"
# RELEASE_MAINTAINER_EMAIL="[email protected]"
# RELEASE_MESSAGE="Some message"
#