Skip to content

Instantly share code, notes, and snippets.

View ihciah's full-sized avatar

ihc童鞋@提不起劲 ihciah

View GitHub Profile
@ihciah
ihciah / 1-Compile.md
Last active June 11, 2026 06:40
Try Rust for Linux

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-ZH.md
Created December 17, 2025 21:43
Gemini API load balancer

基于 Cloudflare Workers 的 Gemini API 负载均衡器

这是一个部署在 Cloudflare Workers (Serverless) 上的轻量级 Gemini API 负载均衡器和代理。

本项目通过实现 随机密钥选择与重试 (Random Key Selection & Retry) 策略,解决了 Gemini API 免费层级严格的速率限制问题。它暴露了一个 兼容 OpenAI 的端点,允许与支持 OpenAI SDK 的客户端(如 EasyDict)集成。

部署

  1. 创建 Worker: 前往 Cloudflare Dashboard 并创建一个新的 Worker(点击"从 Helloworld 开始")。
  2. 部署代码: 将提供的代码粘贴到 Worker 编辑器中。
@ihciah
ihciah / README.MD
Last active March 14, 2026 22:17
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 October 28, 2025 10:14
科学搭建国内VPN转发服务器(国内VPN中转)

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

简介

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

搭建过程

  • 搭建Ocserv
    • 打开ftp://ftp.infradead.org/pub/ocserv/找到最新版本并下载、解压
    • 安装依赖:
@ihciah
ihciah / lib.rs
Created May 29, 2025 00:00
FuturesUnorderedRetry
use std::cell::RefCell;
use std::pin::Pin;
use std::task::Context;
use std::task::Poll;
use std::task::ready;
use futures::Stream;
use futures::TryFuture;
use futures::stream::FuturesUnordered;
use futures::stream::StreamExt;
@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 May 3, 2025 02:39
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 March 30, 2025 12:02
V2ray with cloudflare websocket

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
Created January 18, 2016 13:13
Pwnable.kr echo1 writeup

Pwnable.kr echo1 writeup

ihciah@gmail.com

At first glance, I thought there are 3 ways to exploit this problem, since it gives me 3 choices: BOF, FSB, UAF, however, the last two are not available.

In echo1, it calls get_input to input 128 input, but the buffer equals to bp-20h, so it can only save data with max length of 32.

Above the return address is the old rbp, so we can write 32 + 8 trash and an address to jump to to overflow it.

After searching with jmpcall si in peda, we found no result.

@ihciah
ihciah / subtitle_downloader.py
Last active July 14, 2024 17:23
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