Skip to content

Instantly share code, notes, and snippets.

View LuoZijun's full-sized avatar
🎯
Focusing

寧靜 LuoZijun

🎯
Focusing
View GitHub Profile
[package]
name = "bench_neptune"
version = "0.1.0"
authors = ["luozijun <luozijun.assistant@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
lazy_static = "1.4"
package main
import "fmt"
import "math/big"
type BigInt big.Int
func one() *big.Int {
return big.NewInt(1)
}
#!/bin/bash
echo "
rdr pass inet proto tcp from any to any port 6000 -> 127.0.0.1 port 8080
" | sudo pfctl -ef -
@LuoZijun
LuoZijun / adler32.rs
Last active February 10, 2020 10:37
Rust Adler32
#![allow(dead_code)]
// Copy from https://golang.org/src/hash/adler32/adler32.go
// mod is the largest prime that is less than 65536.
const MOD: usize = 65521;
// nmax is the largest n such that
// 255 * n * (n+1) / 2 + (n+1) * (mod-1) <= 2^32-1.
// It is mentioned in RFC 1950 (search for "5552").
const NMAX: usize = 5552;
@LuoZijun
LuoZijun / test.rst
Last active January 18, 2020 02:40
测试 RST

色情片演员米娅·哈利法在 BBC Hard Talk 节目中接受史蒂文·萨克尔的采访,谈论了她对色情行业的看法

电视节目

BBC Hard Talk

节目主持人

史蒂文·萨克尔 (Stephen Sackur),BBC主持人

节目受访人

米娅·哈利法 (Mia Khalifa),色情片演员

采访视频(英文字幕)

Mia Khalifa: Why I’m speaking out about the porn industry

采访视频(中文字幕)

米娅·哈利法是著名色情片演员,她看到什么业界问题?

采访时长

00:07:11

发布日期

2019年9月7日发布

#![allow(non_camel_case_types, non_snake_case, unused_variables, unused_macros)]
// #[macro_use]
// #[path = "src/macros.rs"]
// mod macros;
macro_rules! FN {
(stdcall $func:ident($($t:ty,)*) -> $ret:ty) => (
pub type $func = Option<unsafe extern "system" fn($($t,)*) -> $ret>;
);
(stdcall $func:ident($($p:ident: $t:ty,)*) -> $ret:ty) => (
package main
import (
"fmt"
"github.com/vishvananda/netlink"
)
// Note: Add route first.
// $ sudo ip route add 8.8.8.8 dev enp0s3
#![allow(non_camel_case_types, unused_variables, non_snake_case)]
pub type c_void = ();
pub type ULONG = u64;
pub type LONG = i64;
pub type HANDLE = *mut c_void;
pub type TUN_RING_PTR = *mut u8;
pub const TUN_RING_DEFAULT_CAPACITY: usize = 8388608; // 2**23 = 8MB
pub const TUN_RING_LEN: usize = std::mem::size_of::<TUN_RING_HEADER>() + TUN_RING_DEFAULT_CAPACITY + 0x10000;
@LuoZijun
LuoZijun / w.rs
Last active August 28, 2019 10:02
#![allow(non_camel_case_types, non_snake_case)]
pub const ANY_SIZE: usize = 1;
pub type DWORD = u32;
pub type USHORT = u16;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct MIB_IPADDRROW_XP {