Skip to content

Instantly share code, notes, and snippets.

View kokororin's full-sized avatar

そら kokororin

View GitHub Profile
@kokororin
kokororin / inject.ts
Created June 1, 2020 07:13
TypeScript Miniapp
import {
createStoreBindings,
StoreBindingsOptions
} from 'mobx-miniprogram-bindings';
export function getPrototypeOf(obj: any): any {
// eslint-disable-next-line no-proto
return Object.getPrototypeOf ? Object.getPrototypeOf(obj) : obj.__proto__;
}
@kokororin
kokororin / readme.txt
Created October 21, 2017 12:02 — forked from fqrouter/readme.txt
shadowsocks 公共代理的必要设置
good, 你已经有了一个自己的shadowsocks代理了,现在想要把这个代理公布出去给所有人分享。
但是没有两个小时,代理就没法使用了,为什么?因为你需要额外注意以下事项(以下步骤需要比较高的linux技能)
本文只关注于确保shadowsocks服务还“活着”,如果你希望让其跑得更快,请参考
https://github.com/clowwindy/shadowsocks/wiki/Optimizing-Shadowsocks
1、 shadowsocks的timeout设置
超时时间越长,连接被保持得也就越长,导致并发的tcp的连接数也就越多。对于公共代理,这个值应该调整得小一些。推荐60秒。
2、 检查操作系统的各种限制
对于openvz的vps,特别需要检查一下
@kokororin
kokororin / sslocal
Created August 16, 2017 03:21
SSR init.d script
#! /bin/sh
# Works on Ubuntu 16.04.1 LTS
DESC="start sslocal service"
NAME=sslocal
OWNER=shadowsocks
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
CONFIGFILE=/etc/shadowsocks.json
@kokororin
kokororin / install.sh
Last active December 29, 2017 05:53
ngx 1.10.1 install script
#!/bin/bash
cd ..
git clone https://github.com/FRiCKLE/ngx_cache_purge
git clone https://github.com/openresty/headers-more-nginx-module
git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module
git clone https://github.com/cuber/ngx_http_google_filter_module
git clone https://github.com/newobj/nginx-x-rid-header
git clone https://github.com/openresty/echo-nginx-module
@kokororin
kokororin / twitter-proxy.md
Created August 24, 2016 08:18 — forked from JingwenTian/twitter-proxy.md
nginx反代twitter完整镜像 (原文:http://jude.me/2014/10/04/twitter-mirror-2.html

示例

需要注意的几点

  • content-security-policy这个header要去掉,或者重写进你自己的域名,不然有些浏览器不会加载外部的元素
  • 使用proxy_cookie_domain替换cookies的作用域。twitter返回的cookies作用域是.twitter.com,也就是twitter.com的所有二级域名都可以调用,为使用者的安全考虑建议替换成反代所使用的二级域名比如tt.jude.me
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person