Skip to content

Instantly share code, notes, and snippets.

bigeagle bigeagle

Block or report user

Report or block bigeagle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@huiyiqun
huiyiqun / macvlan.md
Created Nov 4, 2015
读macvlan代码的心得(为了给macvlan添加multicast支持)
View macvlan.md

Macvlan 内核代码阅读备忘

暂时没有博客,就放到这里了。

Macvlan和Macvtap的关系

Macvtap的代码没有去深读,从代码头上的注释来看,macvtap主要是在macvlan的基础上封装了一个char设备,维护一个队列,因此网络相关的主要逻辑应该在macvlan里。

Macvlan的数据结构里的逻辑关系(主要看macvlan_common_newlink)

    +--------------------------------------------------------------------------------------------------------------------------+
@klzgrad
klzgrad / Naive-VPN.md
Created Nov 17, 2014
朴素VPN:一个纯内核级静态隧道
View Naive-VPN.md

朴素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

@cirqueit
cirqueit / Flat UI directives.md
Last active Aug 29, 2015
FlatUI checkbox, radio and switch w/ AngularJS
View Flat UI directives.md

##Angular directives for Flat UI

  • checkboxes
  • radio buttons
  • switches

Check the JSFiddle

###Example

@XVilka
XVilka / TrueColour.md
Last active Oct 14, 2019
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@steeve
steeve / _readme.md
Last active Jul 29, 2019
How to cross compile Go with CGO programs for a different OS/Arch
View _readme.md

How to cross compile Go with CGO programs for a different OS/Arch

It is possible to compile Go programs for a different OS, even though go build says otherwise.

You'll need:

@bssstudio
bssstudio / TCPServer.scala
Created Jan 11, 2013
Dead simple http responder (not even echo test)
View TCPServer.scala
//scalaVersion 2.9.2
//akkaVersion 2.0.1
import akka.actor._
import java.net.InetSocketAddress
import akka.util.ByteString
import java.net.Socket
import akka.actor.IO.SocketHandle
import akka.actor.IO._
import akka.routing.RoundRobinRouter
View akka-io-tcp-echo-server-using-iteratee.scala
import akka.actor.IO._
import akka.actor.{Props, IO, IOManager, Actor, ActorSystem}
import akka.event.Logging
import akka.util.ByteString
import java.net.InetSocketAddress
class TCPEchoServer(port: Int) extends Actor {
val log = Logging(context.system, this)
val state = IterateeRef.Map.async[IO.Handle]()(context.dispatcher)
@greensea
greensea / OpenVPN-2.2.2-obfs.patch
Last active Sep 5, 2019
The obfs patch obsfucate OpenVPN traffic, make it looks like random traffic. The obfs patch add two options for OpenVPN. --obfs-salt <string> is a secret to generate the input XOR stream. To enable the obfs patch, this options must be set. --obfs-padlen <num> is a positive integer max to 255. This option tells obfs patch to padding random conten…
View OpenVPN-2.2.2-obfs.patch
--- openvpn-2.2.2.orig/options.c 2011-12-14 00:58:56.000000000 +0800
+++ openvpn-2.2.2/options.c 2012-12-21 10:44:57.683130505 +0800
@@ -54,6 +54,10 @@
#include "memdbg.h"
+extern char* _socket_obfs_salt;
+extern int _socket_obfs_salt_len;
+extern int _socket_obfs_padlen;
+
@onlytiancai
onlytiancai / python_infrastructure.md
Created Oct 12, 2012
python 基础设施讨论贴
View python_infrastructure.md

python项目通用组件和基础服务

很多公司都大量使用了python,其中有一些开发规范,code guidline, 通用组件,基础框架是可以共用的。

每个公司都自己搞一套, 太浪费人力,我想开一帖和大家讨论一下这些python基础设施的搭建。

原则是我们尽量不重新发明轮子,但开源组件这么多,也要有个挑选的过程和组合使用的过程,在这里讨论一下。

另一方面,有些开源组件虽然强大,但我们不能完全的驾驭它,或只使用其中很少的一部分,我们就可以考虑用python实现一个简单的轮子,可控性更强,最好不要超过300行代码。

You can’t perform that action at this time.