Skip to content

Instantly share code, notes, and snippets.

View ayanamist's full-sized avatar

ayanamist ayanamist

View GitHub Profile
@ayanamist
ayanamist / dnsmasq_gfw.patch
Last active December 15, 2015 15:38
让dnsmasq额外支持bogus-gfw参数,过滤GFW产生的污染结果。 未测试。
52540f42e67b8bca7ea4fa087090ac6554d66d71
src/dnsmasq.h | 1 +
src/forward.c | 8 ++++++++
src/option.c | 19 +++++++++++++++++++
3 files changed, 28 insertions(+)
diff --git a/src/dnsmasq.h b/src/dnsmasq.h
index 21a309c..efc66b4 100644
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@ayanamist
ayanamist / .bashrc
Last active October 12, 2017 12:56
Linux Configurations
# Prevent other people access my files
umask 077
# If not running interactively, don't do anything
case $- in *i*) ;; *) return;; esac
# bash keep history
HISTFILESIZE=400000000
HISTSIZE=10000
PROMPT_COMMAND="history -a"
@ayanamist
ayanamist / min-btn.patch
Created December 6, 2013 06:21
Fix bug of xfwm4 which sometime eat minimize button. More detail please refer to https://bugzilla.xfce.org/show_bug.cgi?id=10413
Index: xfwm4-4.10.1/src/netwm.c
===================================================================
--- xfwm4-4.10.1.orig/src/netwm.c 2013-05-05 23:58:42.000000000 +0800
+++ xfwm4-4.10.1/src/netwm.c 2013-12-06 12:26:31.351436498 +0800
@@ -1325,7 +1325,6 @@
c->initial_layer = c2->win_layer;
TRACE ("Applied layer is %lu", c->initial_layer);
}
- FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_HAS_HIDE);
}
@ayanamist
ayanamist / https-proxy.js
Last active February 17, 2018 01:22
HTTPS Proxy (Polipo + stunnel)
#!/usr/bin/env node
'use strict';
var fs = require('fs');
var http = require('http');
var https = require('https');
var net = require('net');
var url = require('url');
var util = require('util');
@ayanamist
ayanamist / config.json
Last active January 6, 2017 22:58
Proxy Pac Server
{
"local": "127.0.0.1:8124",
"remote": [
{
"proxy": "direct",
"rules": [
["10.0.0.0", "255.0.0.0"],
["100.64.0.0", "255.192.0.0"],
["127.0.0.0", "255.0.0.0"],
["172.16.0.0", "255.240.0.0"],
@ayanamist
ayanamist / build-ffmpeg.sh
Last active April 3, 2016 13:46
Build libffmpeg.so for DicePlayer
#!/bin/bash
NDKROOT=~/android-ndk # insert android ndk path
DEVICE_TYPE="arm_neon" # insert device type(arm_neon, arm_tegra2, x86)
OS=LINUX64 # insert OS Version(LINUX64, LINUX32, WINDOWS_64, WINDOWS)
if [ $DEVICE_TYPE == "arm_neon" ];
then
TOOLCHAIN=toolchain-arm
ARCH=arm
@ayanamist
ayanamist / throttle.js
Created December 29, 2014 05:54
throttle function for node.js
/**
* 限制fn同时执行的个数,fn必须符合node函数规范,即参数最后一位是回调函数
* 如果有this绑定需求,需要提前bind好,否则this会变null。
*
* @param fn
* @param concurrency
* @returns {Function}
*/
function throttle(fn, concurrency) {
if (concurrency <= 0) {
@ayanamist
ayanamist / fcmproxy.go
Last active August 17, 2021 06:16
FCM proxy
package main
import (
"bufio"
"errors"
"flag"
"fmt"
"io"
"log"
"net"
@ayanamist
ayanamist / xsh6to5.py
Created December 31, 2018 09:15
Convert Xshell 6 *.xsh files to Xshell 5 *.xsh format
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import ConfigParser
import codecs
import sys
import StringIO
def main():
config = ConfigParser.RawConfigParser(allow_no_value=True)
@ayanamist
ayanamist / magisk.json
Last active February 1, 2022 16:54
Magisk downgrade channel
{
"magisk": {
"version": "23.0",
"versionCode": "23000",
"link": "https://cdn.jsdelivr.net/gh/topjohnwu/[email protected]/app-release.apk",
"note": "https://topjohnwu.github.io/Magisk/releases/23000.md"
},
"stub": {
"versionCode": "21",
"link": "https://cdn.jsdelivr.net/gh/topjohnwu/[email protected]/stub-release.apk"