Skip to content

Instantly share code, notes, and snippets.

View auxten's full-sized avatar
🛠️
Coding

auxten auxten

🛠️
Coding
View GitHub Profile
@auxten
auxten / README.md
Last active January 17, 2024 15:18 — forked from cld4h/README.md
Bypass the GFW; clash fake-ip and tproxy; iptables and transparent proxy on Linux; 在Linux上通过 iptables 以及 clash 配置透明代理用于本机及局域网翻墙网关; Linux 翻墙路由器配置

This article show you the ultimate way to set up a transparent proxy on Linux using clash and iptables to bypass the GFW in China.

We use:

You can go to github gist to download all files mentioned in this article.

@auxten
auxten / cla.md
Last active December 5, 2023 06:21
chdb cla

chDB Individual Contributor License Agreement v1.0

Based on ClickHouse Individual Contributor License Agreement v1.0

Thank you for your interest in chDB (https://github.com/chdb-io/chdb). In order to clarify the intellectual property license granted with Contributions from any person or entity, the author of chDB, Github User Name:[auxten] (https://github.com/auxten) ("Author")must have a Contributor License Agreement ("CLA") on file that has been signed, accepted or otherwise agreed to by each contributor, indicating agreement to the license terms below.

You accept and agree to the following terms and conditions for Your previous, present and future Contributions submitted to the Author. Except for the license granted herein to the Author and recipients of software distributed by the Author, You reserve all right, title, and interest in and to Your Contributions.

  1. Definitions. "You" (or "Your") shall mean the undersigned person/entity, which is the copyright owner or legal entity authorized by the cop
@auxten
auxten / alloc.cpp
Created June 1, 2023 07:56
aws s3 download pre allocate disk space
#include <iostream>
#include <fstream>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <aws/core/Aws.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/HeadObjectRequest.h>
#include <aws/s3/model/GetObjectRequest.h>
@auxten
auxten / bench_chdb_dataframe.py
Last active May 29, 2023 02:53
Bench different impl of running chdb directly on dataframe
import os
import time
import pandas as pd
import pyarrow as pa
import chdb
import subprocess
# file size 117MB
data_path = '/home/Clickhouse/bench/hits_0.parquet'
@auxten
auxten / uniswap_v2_trading_data.py
Created May 7, 2023 12:23
chdb on uniswap_v2_trading_data
import chdb
data_path = "/home/Clickhouse/bench/uniswap_v2_trading_data/*.csv"
small_data_path = "/home/Clickhouse/bench/uniswap_v2_trading_data/v2_trading_history_14025747.csv"
print("Sample: ",
chdb.query(f"select * from file('{data_path}', 'CSVWithNames') limit 10", "PrettyCompact").data())
print("Count: ", chdb.query(f"select count(*) from file('{data_path}', 'CSVWithNames')").data())
# ret = chdb.query(
@auxten
auxten / gist:707804b51d72468ad5ecb8252f12dcb0
Created April 23, 2023 06:57
chdb on c6a.4xlarge with 500g gp2
[0.4361737529999914,0.05658163800001148,0.056433019999985845],
[0.45631013700000267,0.06661815199998955,0.06499360399999432],
[1.2878869360000067,0.12046150599996963,0.12141279399997984],
[1.0351253719999818,0.19584039699998357,0.19377196099998173],
[2.000329340999997,1.3100056389999963,1.3103087160000086],
[1.8184413650000124,0.9605992319999928,0.9637660029999893],
[0.4596347169999717,0.0655916599999955,0.06513699300001008],
[0.45521096900000657,0.07589728199997126,0.07560694400001466],
[1.4177663510000116,0.7329907230000003,0.7416720749999968],
[3.5959058509999977,0.901890944999991,0.891994880000027],
@auxten
auxten / git-alias.sh
Last active July 20, 2023 08:42
git alias
alias ga='git add'
alias gaa='git add --all'
alias gap='git apply'
alias gapa='git add --patch'
alias gau='git add --update'
alias gav='git add --verbose'
alias gb='git branch'
alias gbD='git branch -D'
alias gba='git branch -a'
alias gbd='git branch -d'
group:Name of the group (imported from SQL)
depts = {
deptno:number, deptname:string
}
locations = {
locationid:number, state:string
}
@auxten
auxten / livy-submit.py
Created October 22, 2019 09:15
Spark-submit like tool for livy
#!/usr/bin/env python
#
# Very bare bones shell for driving a Livy session. Usage:
#
# livy-shell url [option=value ...]
#
# Options are set directly in the session creation request, so they must match the names of fields
# in the CreateInteractiveRequest structure. Option values should be python-like objects (should be
# parseable by python's "eval" function; naked strings are allowed). For example:
#
@auxten
auxten / EndToEndEncryption-test.js
Last active May 22, 2019 08:27
AES-CBC-PKCS#5 (PKCS#7) with KDF and salt implementation and tests in Java, Golang, Python, JavaScript from github.com/CovenantSQL
'use strict';
var test = require('ava'),
aes = require('aes-js'),
e2e = require('..');
function from_hex(s) {
return new Uint8Array(aes.utils.hex.toBytes(s));
}