Skip to content

Instantly share code, notes, and snippets.

@ihciah
ihciah / custom.css
Created April 20, 2024 15:22 — forked from Ynng/custom.css
vscode vtuber logo
.editor-group-watermark > .letterpress{
background-image: url("https://raw.githubusercontent.com/Aikoyori/ProgrammingVTuberLogos/main/VSCode/VSCode.png") !important;
opacity: .75;
}
@ihciah
ihciah / README.MD
Last active February 2, 2024 00:08
A reverse proxy for Telegram Bot API on Aliyun Function Compute / Cloudflare Workers

A reverse proxy for Telegram Bot API on Aliyun Function Compute / Cloudflare Workers

To help users in China mainland access telegram api stably and conveniently with low cost, this script maybe the one you need.

The server-less means you don't have to run a server to proxy the requests, just pay as you go.

Usage

Edit key_prefix, set it to the prefix of you bot address(like /bot563441998:) can avoid abusing.

@ihciah
ihciah / README.md
Last active December 31, 2023 18:53
Policy Routing VPN with Tinc and Nftables

Policy Routing VPN with Tinc and Nftables

This is just a personal backup, but if it helps you, that's even better.

Target

  1. Make linux work as a router.
  2. For domestic targets, connect them directly.
  3. For traffic that need to bypass the firewall, use VPN.

Setup

@ihciah
ihciah / README.MD
Last active December 6, 2023 01:42
科学搭建国内VPN转发服务器(国内VPN中转)

科学搭建国内VPN转发服务器

简介

  • 简单拓扑结构:国内-(ocserv)-国内中转服务器-(shadowvpn)-国外服务器
  • 实验环境:用户终端为iPhone,中转服务器及国外服务器均为Ubuntu 14.04

搭建过程

  • 搭建Ocserv
    • 打开ftp://ftp.infradead.org/pub/ocserv/找到最新版本并下载、解压
    • 安装依赖:
@ihciah
ihciah / crypto1.md
Created February 12, 2016 09:43
Pwnable.kr crypto1 writeup

Pwnable.kr crypto1 writeup

ihciah@gmail.com

In this challenge we can input username and password, then the server return an encrypted string of {username}-{password}-{cookie} in which the cookie is not known.

Since CBC is used, each 32 word in encrypted string is encrypted by last block and 16 word in original string.

So let's enter "A"*16 as username, and enter different password, the first 32 word of the encrypted data is the same.

So we can brute-force the cookie through trying each bit of cookie.

@ihciah
ihciah / Dockerfile.master
Created October 3, 2023 06:36
Tinc Dockerfile
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 && \
@ihciah
ihciah / README.md
Created April 18, 2022 08:45
Ansible playbook to upgrade all packages

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
Last active June 4, 2023 01:23
V2ray MTProto through Shadowsocks

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 / pool.rs
Last active April 23, 2023 09:57
Rust Simple Pool
//! 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>,
@ihciah
ihciah / subtitle_downloader.py
Last active March 5, 2023 10:33
Xunlei subtitle downloader
#!/usr/bin/python
# -*- coding: utf-8 -*-
# __author__ = 'ihciah'
# cid_hash_file function from https://github.com/binux/lixian.xunlei/blob/master/libs/tools.py
# Gist: https://gist.github.com/ihciah/30eda05ca36ee9f9f190067538b0ae04
import hashlib
import inotify.adapters
import os
import sys