Skip to content

Instantly share code, notes, and snippets.

View luginbash's full-sized avatar
😀

Luginbash luginbash

😀
View GitHub Profile
[General]
# warning, notify, info, verbose
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
bypass-tun = 0.0.0.0/8, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
loglevel = notify
# 默认 IP 和端口,不修改的话系统网络 HTTP 和 HTTPS 代理设置中就是 127.0.0.1:6152
interface = 0.0.0.0
port = 6152
@luginbash
luginbash / haproxy.cfg
Created March 6, 2016 13:31
haproxy tls termination with client authentication
# Please set $SRV_TLS_CERT, $SRV_TLS_CA accordingly.
global
maxconn 2048
log /dev/log local0
log /dev/log local1 notice
tune.ssl.default-dh-param 2048
ssl-default-bind-ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
ssl-default-bind-options no-tls-tickets
chroot /var/lib/haproxy
stats timeout 30s
@luginbash
luginbash / functions.sh
Last active May 1, 2019 00:41
Dynamic DNS endpoint IP address update script with Mikrotik router
#!/bin/bash
function snmpGetIP
{
local SNMP_HOST=$1
local SNMP_COMM=$2
local SNMP_IFID=$3
snmpwalk -Os -c ${SNMP_COMM} -v 2c ${SNMP_HOST} ipAdEntIf | grep "INTEGER: ${SNMP_IFID}" | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
}
@luginbash
luginbash / hostIp.func.rsc
Created December 9, 2015 08:02
Add interface IPv4 address to a global var
# Change to the name of interface that gets the dynamic IP address
:local inetinterface "pppoe-out1";
# use search & replace all on myEndpoint for multiple hosts
:global myEndpoint;
:if ([/interface get $inetinterface value-name=running]) do={
# Get the current IP on the interface
:local currentIP [/ip address get [find interface="$inetinterface" disabled=no] address];
@luginbash
luginbash / DNSoMatic.rsc
Last active May 2, 2022 03:48
DNS-O-Matic Dynamic IP Endpoint update script for Mikrotik RouterOS
# DNS-O-Matic Dynamic IP Endpoint update script for Mikrotik RouterOS.
#
# Author: Quan Zhou <public_zhou@outlook.com>
#
# Description:
# Update IP address of specified hostname through dnsomatic.com
# You need a dnsomatic.com account and whatsoever ddns service
# supported by them.
#
# Tested ands works with Mikrotik RouterOS 6.32
@luginbash
luginbash / surge.conf
Created October 4, 2015 07:24 — forked from janlay/README.md
Yet another config for Surge.app
[General]
# warning, notify, info, verbose
loglevel = notify
[Proxy]
# http, https, socks5
Proxy = custom, 1.2.3.4, 443, rc4-md5, password, http://server/custom.module
[Rule]
# Block privacy trackers
@luginbash
luginbash / default.yaml
Created March 24, 2015 08:12
Weasel Pinyin Config
ascii_composer:
good_old_caps_lock: true
switch_key:
Caps_Lock: clear
Control_L: noop
Control_R: noop
Eisu_toggle: clear
Shift_L: inline_ascii
Shift_R: commit_text
config_version: 0.36.custom.3025064750
@luginbash
luginbash / proxy.js
Last active September 16, 2015 07:33
my auto proxy configuration script, address stripped.
function FindProxyForURL(url, host) {
// Apple Device compatibility, they will skip SOCKS5 for SOCKS.
var local_address = "192.168.88.0";
var local_subnet = "255.255.255.0";
var PROXY = "SOCKS5 __ADDRESS__:__PORT__; SOCKS __ADDRESS__:__PORT__";
var OLDMILL = "SOCKS5 __ADDRESS__:__PORT__; SOCKS __ADDRESS__:__PORT__";
var domain_list = [ ".ytimg.com"
,".youtube.com"
,".greatfire.org"
,"gist.github.com"
daemon
pidfile /var/run/3proxy.pid
nscache 65536
nserver 208.67.222.222
nserver 208.67.220.220
config /etc/3proxy/3proxy.conf
monitor /etc/3proxy/3proxy.conf
monitor /etc/3proxy/counters
monitor /etc/3proxy/passwd
printf "%s\n" "Setting up vanilla enviroment"
# BSD
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
# OSX Server Specific
PATH="$PATH:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin"
# sanity locale
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8