Skip to content

Instantly share code, notes, and snippets.

@w796933
w796933 / acme_docker.sh
Created June 16, 2021 14:39 — forked from stilleshan/acme_docker.sh
基于 docker 环境 acme.sh 申请 Let's Encrypt 泛域名证书的交互式一键脚本.
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# fonts color
Green="\033[32m"
Red="\033[31m"
Yellow="\033[33m"
GreenBG="\033[42;37m"
RedBG="\033[41;37m"
@w796933
w796933 / redisdns.py
Created June 23, 2019 00:12
Python DNS server with Redis backend
# A naive dns server with a Redis backend
# Set keys in Redis you want to be authoritative for (set google.com. 127.0.0.1)
# Tip: Use Redis's ttl functions to have temporary names
# Currently only does A records, feel free to fix that
#
# Licensed under the PSF License
# Thanks to: http://code.activestate.com/recipes/491264-mini-fake-dns-server/
# Author: @Kaerast <alice@kaerast.info>
import socket
@w796933
w796933 / Dockerfile
Created November 15, 2017 03:29 — forked from gofer/Dockerfile
NSD on Docker
FROM alpine:latest
MAINTAINER Gofer (@gofer_ex) <gofer@ex-studio.info>
ARG nsd_version=4.1.14
ARG control_port=8952
ENV NSD_VERSION=$nsd_version
ENV CONTROL_PORT=$control_port
@w796933
w796933 / openssl.ssh
Created May 26, 2017 17:20 — forked from mbejda/openssl.ssh
Installing OpenSSL 1.0.2 on Ubuntu 14
openssl version -a
sudo add-apt-repository ppa:0k53d-karl-f830m/openssl
sudo apt-get update
sudo apt-get install openssl
openssl version -a
@w796933
w796933 / consul.lua
Created April 16, 2017 02:18 — forked from gmr/consul.lua
Dynamic Nginx upstream nodes using Consul
module("resty.consul", package.seeall)
_VERSION = '0.1.0'
function service_nodes(service)
local http = require "resty.http"
local json = require "cjson"
local hc = http:new()
local upstream = ""
@w796933
w796933 / nginx.conf
Created October 19, 2016 02:54 — forked from hwdsl2/nginx.conf
Actual nginx.conf for Lin's Tech Blog (http://blog.ls20.com - click for tutorial). Published with Ghost, Nginx and ModSecurity
user nginx;
# Set this to match the number of CPU cores
worker_processes 2;
events { worker_connections 1024; }
http {
server_names_hash_bucket_size 64;
types_hash_max_size 2048;
server_tokens off;
include mime.types;
default_type application/octet-stream;
@w796933
w796933 / ferm.conf output
Created September 19, 2016 15:18 — forked from timstoop/ferm.conf output
Detecting TCP SYN Flood
/usr/sbin/ipset -exist create active_connections hash:ip timeout 30
/usr/sbin/ipset -exist create offenders hash:ip
# Generated by ferm 2.1 on Fri Feb 14 10:02:12 2014
*filter
:FORWARD DROP [0:0]
:INPUT DROP [0:0]
:OUTPUT ACCEPT [0:0]
:active_connections - [0:0]
:prevent_tcp_syn_flood - [0:0]
-A FORWARD --protocol udp --jump DROP
@w796933
w796933 / shadowiptables.sh
Created August 20, 2016 05:06 — forked from qwIvan/shadowiptables.sh
自动翻墙脚本,配合shadowsocks-libev的ss-redir使用,需要ipset(sudo apt-get install ipset)
#!/bin/bash
#自动翻墙脚本,配合shadowsocks-libev的ss-redir使用。需要ipset
chnroute_file=~/.chnroute
ignore_ips=(
45.32.50.160
45.127.93.239
103.214.68.175
0.0.0.0/8
10.0.0.0/8
127.0.0.0/8
#!/bin/sh
# For debugging use iptables -v.
IPTABLES="/sbin/iptables"
IP6TABLES="/sbin/ip6tables"
MODPROBE="/sbin/modprobe"
RMMOD="/sbin/rmmod"
ARP="/usr/sbin/arp"