Skip to content

Instantly share code, notes, and snippets.

View auxten's full-sized avatar
🛠️
Coding

auxten auxten

🛠️
Coding
View GitHub Profile
#!/usr/bin/env bash
# Names of latest versions of each package
export VERSION_PCRE=pcre-8.39
export VERSION_ZLIB=zlib-1.2.8
export VERSION_LIBRESSL=libressl-2.4.2
export VERSION_NGINX=nginx-1.10.1
# URLs to the source directories
export SOURCE_LIBRESSL=http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/
@auxten
auxten / yamux.go
Created June 27, 2018 08:03
simple yamux io multiplexer demo
package main
import (
log "github.com/auxten/logrus"
"net"
"github.com/hashicorp/yamux"
"sync"
)
const LoopCount = 1000
@auxten
auxten / Golang Elliptic Curve benchmark.md
Last active December 22, 2021 03:41
Golang Elliptic Curve benchmark
@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));
}
@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:
#
group:Name of the group (imported from SQL)
depts = {
deptno:number, deptname:string
}
locations = {
locationid:number, state:string
}
@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'
@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 / 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 / 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'