Skip to content

Instantly share code, notes, and snippets.

@QuantumGhost
QuantumGhost / ssl.md
Created November 3, 2023 14:53 — forked from clowwindy/ssl.md
为什么不应该用 SSL 翻墙

SSL 设计目标:

  1. 防内容篡改
  2. 防冒充服务器身份
  3. 加密通信内容

而翻墙的目标:

  1. 不被检测出客户端在访问什么网站
  2. 不被检测出服务器在提供翻墙服务
@QuantumGhost
QuantumGhost / DefaultKeyBinding.dict
Last active January 31, 2023 15:04
xcode keybindings for emacs emulation
{
/* Override symbols so other apps can bind */
/* ~ stands for option, ^ stands for control */
"~j" = "noop:";
"~i" = "noop:";
"~;" = "noop:";
"~a" = "noop:";
"~2" = "noop:";
"~g" = "noop:";
"~y" = "noop:";
{ pkgs, sumFile }:
with pkgs;
let
mod2prefix = path: version: hash:
let
fullpath = "${path}@${lib.strings.removeSuffix "/go.mod" version}";
manifest = runCommand "${fullpath}.manifest"
{
outputHashMode = "flat";
outputHashAlgo = "sha256";

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

朴素VPN:一个纯内核级静态隧道

由于路由管控系统的建立,实时动态黑洞路由已成为最有效的封锁手段,TCP连接重置和DNS污染成为次要手段,利用漏洞的穿墙方法已不再具有普遍意义。对此应对方法是多样化协议的VPN来抵抗识别。这里介绍一种太简单、有时很朴素的“穷人VPN”。

朴素VPN只需要一次内核配置(Linux内核),即可永久稳定运行,不需要任何用户态守护进程。所有流量转换和加密全部由内核完成,原生性能,开销几乎没有。静态配置,避免动态握手和参数协商产生指纹特征导致被识别。并且支持NAT,移动的内网用户可以使用此方法。支持广泛,基于L2TPv3标准,Linux内核3.2+都有支持,其他操作系统原则上也能支持。但有两个局限:需要root权限;一个隧道只支持一个用户。

朴素VPN利用UDP封装的静态L2TP隧道实现VPN,内核XFRM实现静态IPsec。实际上IP-in-IP隧道即可实现VPN,但是这种协议无法穿越NAT,因此必须利用UDP封装。内核3.18将支持Foo-over-UDP,在UDP里面直接封装IP,与静态的L2TP-over-UDP很类似。

创建一个朴素VPN

@QuantumGhost
QuantumGhost / AnIntro.md
Created October 10, 2019 03:46 — forked from chrisdone/AnIntro.md
Statically Typed Lisp

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

Rust in Large Organizations

Initially taken by Niko Matsakis and lightly edited by Ryan Levick

Agenda

  • Introductions
  • Cargo inside large build systems
  • FFI
  • Foundations and financial support
@QuantumGhost
QuantumGhost / chez-future.ss
Created August 31, 2019 08:28 — forked from yinwang0/chez-future.ss
experimental implementation of future with Chez Scheme threads
(define-record fitem (result ready mutex cond))
(define future
(lambda (thunk)
(let ([item (make-fitem #f #f (make-mutex) (make-condition))])
(fork-thread
(lambda ()
(let ([result (thunk)])
(with-mutex (fitem-mutex item)
(set-fitem-result! item result)
@QuantumGhost
QuantumGhost / how-clowwindy-design-Shadowsocks.md
Created March 12, 2017 14:24
clowwindy设计Shadowsocks的思路分析以及设计理念

clowwindy设计Shadowsocks的思路分析以及设计理念

鄙人不才,尝试站在原作者clowwindy的角度,来分析一下原版协议的设计思路和理念。 没参与过最初开发,不过设计了AEAD这个协议。读了一些资料,评论。

7:58 PM, 31 Aug 2015 作者发了这么一段话,我很好奇其中的指代内容,遂有本文。

眼睁睁看着一群人把一个东西搞错然后朝着错误的方向走了。不过懒得管了 =。=

@QuantumGhost
QuantumGhost / hosts
Created June 17, 2019 23:38 — forked from alswl/hosts
hosts for OpenWRT, for disable AD in xiaomi TV
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com