Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀
Emmmmmm

ihc童鞋@提不起劲 ihciah

🦀
Emmmmmm
View GitHub Profile
@ihciah
ihciah / 1-Compile.md
Last active Aug 5, 2022
Try Rust for Linux
View 1-Compile.md

My note for trying rust-for-linux.

Prepare environment

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"
@ihciah
ihciah / README.md
Created Jun 5, 2022
AX88U Network Isolation
View README.md

AX88U 网络隔离

物理端口映射: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 里。

@ihciah
ihciah / README.md
Created Apr 18, 2022
Ansible playbook to upgrade all packages
View README.md

Ansible playbook to upgrade packages

Modify hosts and run ansible-playbook -i hosts upgrade.yaml.

Note: On debain to make reboot detect work, you may install unattended-upgrades.

@ihciah
ihciah / README.md
Created Apr 9, 2022
CHN Route Additional
View README.md

额外 CHN Route

主要维护额外的 CHN Route ip 段。目前仅有腾讯游戏相关。

加载

在 load 了 chn 之后,额外使用 ipset restore -f chn_additional.ipset 将这些条目加入到已有的 chn ipset 中。

腾讯游戏

软路由上使用 CHN Route 导致王者荣耀延迟爆炸,tcpdump 一通操作最后筛选出来几个腾讯游戏的 ip 段。 这些 ip 段并不是直接用于游戏对局的,但他们会影响对局服务器 ip 分配,也算是 DNS 吧。

@ihciah
ihciah / global_cache.rs
Created Jan 19, 2022
Rust Global Cache
View global_cache.rs
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>>>>,
}
@ihciah
ihciah / README.md
Last active Dec 21, 2021
V2ray with cloudflare websocket
View README.md

Configure v2ray with cloudflare with docker and docker-compose

  • caddy-*: http server related files
  • v2ray-*: v2ray related files
  • forword-*: files to relay requests
@ihciah
ihciah / README.MD
Last active May 2, 2022
V2ray MTProto through Shadowsocks
View README.MD

V2ray MTProto through Shadowsocks

Why use it

The MTProto is easy to block; shadowsocks is hard to identify but cannot work without a client.

You can deylop this docker image to run a relay inside the firewall (China/Russia etc.), it provide a MTProto and all the packets will be sent through shadowsocks protocol.

How to run

@ihciah
ihciah / portfw.go
Last active May 21, 2019
Port forward for SMB
View portfw.go
package main
import (
"flag"
"io"
"log"
"net"
"os"
"time"
)
View ss-test.py
import requests
import time
proxies_original = {
'http': 'socks5://127.0.0.1:18081',
'https': 'socks5://127.0.0.1:18081'
}
proxies_my = {
'http': 'socks5://127.0.0.1:18080',
'https': 'socks5://127.0.0.1:18080'
}
@ihciah
ihciah / README.md
Last active Apr 8, 2020
小米路由器 Pro (R3P) 配置shadowsocks透明代理
View README.md

小米路由器 Pro (R3P) 配置shadowsocks透明代理

新入了一个小米路由器,记录一下折腾过程。

首先自动分流科学上网是必须的。

因为小米的ROM本身就是基于openwrt的,所以第一步只需要先走官方途径拿到root权限。

有了权限就只需要找一个别人造的轮子部署一下即可。