Skip to content

Instantly share code, notes, and snippets.

@ratazzi
ratazzi / gist:4239543
Created December 8, 2012 09:33
OpenVPN packet header
src/openvpn/ssl.c
2598-
2599- /* get opcode and key ID */
2600- {
2601- uint8_t c = *BPTR (buf);
2602- op = c >> P_OPCODE_SHIFT;
2603: key_id = c & P_KEY_ID_MASK;
2604- }
<?php
/**
* 用于 Mac OS X 系统的 Automatic Proxy Configuration
* 因为 Firefox,Chrome 需要使用 SOCKS5 而 Safari 及其他程序只认 SOCKS,所以这样区分
* 也可以简单的使用 return "SOCKS5 127.0.0.1:7777;SOCKS 127.0.0.1:7777"; 这种方式
*/
$proxy = 'SOCKS';
$matches = array();
preg_match('/(Firefox|Chrome)/', $_SERVER['HTTP_USER_AGENT'], $matches);
if (!empty($matches)) {
--- src/openvpn/options.c.orig 2012-12-17 17:36:07.000000000 +0800
+++ src/openvpn/options.c 2013-03-07 23:21:26.230153027 +0800
@@ -62,6 +62,10 @@
#include "memdbg.h"
+extern char* _socket_obfs_salt;
+extern int _socket_obfs_salt_len;
+extern int _socket_obfs_padlen;
+
@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
# ASIA
_ = '173.194.36.%s' # del 印度 新德里
SG3 = '173.194.38.%s' # 新加坡
TW3 = '173.194.72.%s'
SG4 = '173.194.117.%s'
JP2 = '173.194.120.%s'
_ = '173.194.123.%s'
JP1 = '173.194.126.%s'
HK1 = '173.194.127.%s'
TW1 = '74.125.23.%s'
#!/bin/bash
## 2019, phoenix
## Start Raspberry Pi in QEMU instance
##
#
# 1. Get the Raspian image: https://www.raspberrypi.org/downloads/raspbian/
# 2. Get Raspberry Kernel and dtb: https://github.com/dhruvvyas90/qemu-rpi-kernel
# 3. Extract Raspbian and put the Kernel and the dtb into a directory
# 4. Convert the IMG to a QCOW2: qemu-img convert -f raw -O qcow22019-09-26-raspbian-buster-lite.img 2019-09-26-raspbian-buster-lite.qcow
# 5. Make some more space: qemu-img resize 2019-09-26-raspbian-buster-lite.qcow2 +5G