This is just a personal backup, but if it helps you, that's even better.
- Make linux work as a router.
- For domestic targets, connect them directly.
- For traffic that need to bypass the firewall, use VPN.
.editor-group-watermark > .letterpress{ | |
background-image: url("https://raw.githubusercontent.com/Aikoyori/ProgrammingVTuberLogos/main/VSCode/VSCode.png") !important; | |
opacity: .75; | |
} |
FROM alpine:latest | |
ENV DEV_PACKAGES="build-base make zlib-dev lzo-dev libressl-dev linux-headers ncurses-dev readline-dev" | |
ENV TINC_VERSION=4c6a9a9611442f958c3049a566ac4369653978e9 | |
RUN cd /tmp && \ | |
wget https://github.com/gsliepen/tinc/archive/${TINC_VERSION}.tar.gz && \ | |
tar -xzf ${TINC_VERSION}.tar.gz && \ | |
cd tinc-${TINC_VERSION} && \ | |
.ci/deps.sh && \ |
//! A generic but simple pool implemention. | |
use std::sync::{Arc, Weak}; | |
use parking_lot::Mutex; | |
/// A Vec based buffer pool. | |
#[derive(Default)] | |
pub struct Pool<T, F = fn() -> T> { | |
cached: Vec<T>, |
My note for trying rust-for-linux.
Here I take arch linux as an example, and I assume you already installed rust and put ~/.cargo/bin
inside your PATH
.
cd /some/where
# Install requirements
sudo pacman -Syuu --noconfirm bc bison curl clang diffutils flex git gcc llvm libelf lld ncurses make qemu-system-x86 cpio
export MAKEFLAGS="-j32"
物理端口映射:eth0 - WAN, eth1~4 - LAN4~1。
默认梅林会将 eth1~7 组成 br0。要做独立的网络就要将 Guest 网络需要用到的 eth 接口从 br0 里摘掉,然后加入到新的 br 里。 这里摘掉了 eth1(对应 LAN4)、wl0.2(第二个 2.4G 访客网络)和 wl1.2(第二个 5G 访客网络)。
之后利用 iptables 允许 Guest 网络访问公网,但禁止其向 br0 主动通信即可。
三个脚本 +x 后放 /jffs/scripts
里(管理页面也要开启 jffs 功能),dnsmasq.conf.add
放 /jffs/configs
里。
use std::{borrow::Borrow, cell::UnsafeCell, hash::Hash, ptr::NonNull, sync::RwLock}; | |
use fxhash::FxHashMap; | |
// const CACHE: Cache = unsafe { Cache::new() }; | |
struct Cache<K, V> { | |
data: UnsafeCell<NonNull<RwLock<FxHashMap<K, V>>>>, | |
} |