Cargo.toml
[dependencies]
anyhow = "1.0.68"
futures-util = "0.3.25"
hyper = { version ="0.14.23", features = ["full"] }
hyper-rustls = "0.23.2"
hyper-tls = "0.5.0"
tokio = { version = "1.24.2", features = ["full"] }Cargo.toml
[dependencies]
anyhow = "1.0.68"
futures-util = "0.3.25"
hyper = { version ="0.14.23", features = ["full"] }
hyper-rustls = "0.23.2"
hyper-tls = "0.5.0"
tokio = { version = "1.24.2", features = ["full"] }| fn main() { | |
| let f = move || -> anyhow::Result<()> { | |
| let url = url::Url::parse("ws://127.0.0.1:9001")?; | |
| let (mut socket, response) = tungstenite::connect(url)?; | |
| println!("Connected to the server"); | |
| println!("Response HTTP code: {}", response.status()); | |
| println!("Response contains the following headers:"); | |
| for (ref header, _value) in response.headers() { |
| pub fn quick_sort<T: Ord + Copy>(slice: &mut [T]) { | |
| if slice.len() <= 1 { | |
| return; | |
| } | |
| let p = slice[0]; | |
| let (mut left, mut right): (Vec<T>, Vec<T>) = slice[1..].iter().partition(|&x| *x < p); | |
| quick_sort(&mut left); | |
| quick_sort(&mut right); | |
| slice.copy_from_slice(&[left, vec![p], right].concat()); | |
| } |
| // tokio = { version = "1.21.2", features = ["full"] } | |
| use tokio::net::TcpListener; | |
| use tokio::io::{AsyncReadExt, AsyncWriteExt}; | |
| #[tokio::main] | |
| async fn main() -> anyhow::Result<()> { | |
| let listener = TcpListener::bind("127.0.0.1:6379").await?; | |
| loop { | |
| let (mut socket, _) = listener.accept().await?; |
127.0.0.1
[::1]
localhost
192.168.*
*.bilibili.com
*.biliapi.net
*.hdslb.com
*.bilivideo.com
*.zhihu.com
| use structopt::StructOpt; | |
| #[derive(StructOpt, PartialEq, Eq, Debug)] | |
| enum Opt { | |
| /// Fetch stuff from GitHub | |
| Fetch { | |
| #[structopt(short, long)] | |
| /// Fetch all the repository contents | |
| all: bool, |
| #! /bin/bash | |
| if [ "$#" -ne 1 ] | |
| then | |
| echo "Error: No domain name argument provided" | |
| echo "Usage: Provide a domain name as an argument" | |
| exit 1 | |
| fi | |
| DOMAIN=$1 |
install Mint
install proxy suit
| from time import sleep | |
| from bs4 import BeautifulSoup | |
| from requests_html import HTMLSession | |
| def host_port_accessable_from_china(host: str, port: int, delay: bool) -> bool: | |
| """ | |
| test if the host:port is accessable from China | |
| """ | |
| url = "https://tool.chinaz.com/port?host={}&port={}".format(host, port) |
| 140.82.112.21 central.github.com | |
| 185.199.108.133 desktop.githubusercontent.com | |
| 185.199.108.153 assets-cdn.github.com | |
| 185.199.108.133 camo.githubusercontent.com | |
| 185.199.108.133 github.map.fastly.net | |
| 199.232.69.194 github.global.ssl.fastly.net | |
| 140.82.114.4 gist.github.com | |
| 185.199.108.153 github.io | |
| 140.82.112.3 github.com | |
| 140.82.114.5 api.github.com |