Skip to content

Instantly share code, notes, and snippets.

@simpzan
simpzan / BNRTimeBlock.h
Created March 20, 2012 15:29 — forked from bignerdranch/BNRTimeBlock.h
Timing Utility Post 20120308
CGFloat BNRTimeBlock (void (^block)(void));
@simpzan
simpzan / iperf.sh
Created June 11, 2018 10:40 — forked from madeye/iperf.sh
Bandwidth test for shadowsocks
#!/bin/bash
method=$1
ss-tunnel -k test -m $method -l 8387 -L 127.0.0.1:8388 -s 127.0.0.1 -p 8389 &
ss_tunnel_pid=$!
ss-server -k test -m $method -s 127.0.0.1 -p 8389 &
ss_server_pid=$!
iperf -s -p 8388 &
@simpzan
simpzan / Linux_DRM_OpenGLES.c
Created January 18, 2020 13:44 — forked from Miouyouyou/Linux_DRM_OpenGLES.c
An example, inspired by Rob Clark "kmscube.c" that uses Linux Direct Rendering Manager ( DRM ) and EGL to create an OpenGL ES 2 context. This is a standalone example, that just clears the screen with a blueish color. Usable with Rockchip DRM drivers and Mali Wayland/DRM userspace drivers.
// gcc -o drmgl Linux_DRM_OpenGLES.c `pkg-config --cflags --libs libdrm` -lgbm -lEGL -lGLESv2
/*
* Copyright (c) 2012 Arvin Schnell <arvin.schnell@gmail.com>
* Copyright (c) 2012 Rob Clark <rob@ti.com>
* Copyright (c) 2017 Miouyouyou <Myy> <myy@miouyouyou.fr>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
@simpzan
simpzan / vmmap.c
Created September 7, 2020 12:56 — forked from bazad/vmmap.c
A simple vmmap implementation for macOS.
// Brandon Azad (@_bazad)
#include <assert.h>
#include <errno.h>
#include <mach/mach.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@simpzan
simpzan / howto-setup-transparent-proxied-router.md
Last active April 9, 2021 14:42 — forked from snakevil/howto-setup-transparent-proxied-router.md
如何在路由器中实现透明代理?

如何在路由器中实现透明代理?

0 互联网现状

目前整个互联网环境,被破坏最严重地部分,是 Web 服务体验。当直接破坏难以实现时,就会从流程链的上下游着手,如:DNS 污染。

其它地互联网服务类型,例如:邮件,可能小部分会受到 Web 服务上下游破坏地余震,但整体上基本不受影响。