Skip to content

Instantly share code, notes, and snippets.

View vanhtuan0409's full-sized avatar

Tuấn Vương vanhtuan0409

View GitHub Profile
0FFFFFFFFFFF
1FFFFFFFFFFF
2FFFFFFFFFFF
3FFFFFFFFFFF
4FFFFFFFFFFF
5FFFFFFFFFFF
6FFFFFFFFFFF
7FFFFFFFFFFF
8FFFFFFFFFFF
9FFFFFFFFFFF
from pprint import pprint
import sqlglot
from sqlglot.expressions import Select, Subquery, Table
def get_acl_permission(table: Table) -> str:
# given a specific table
# should query gondor for a list of accessible row for this table
# after that, transform the result into duckdb temp table to query `IN`
@vanhtuan0409
vanhtuan0409 / aarch.patch
Last active May 28, 2025 03:18
Mtproxy aarch patch
diff --git a/Makefile b/Makefile
index 78d6688..f6f70cf 100644
--- a/Makefile
+++ b/Makefile
@@ -16,8 +16,8 @@ endif
ARCH := $(shell arch)
# Default CFLAGS and LDFLAGS
-COMMON_CFLAGS := -O3 -std=gnu11 -Wall -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"${COMMIT}\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64
-COMMON_LDFLAGS := -ggdb -rdynamic -lm -lrt -lcrypto -lz -lpthread -lcrypto
//> using dep dev.zio::zio::2.1.7
//> using dep dev.zio::zio-logging::2.3.0
import zio._
object Program extends ZIOAppDefault {
override val bootstrap: ZLayer[ZIOAppArgs, Any, Any] = {
Runtime.removeDefaultLoggers >>> zio.logging.consoleLogger()
}
package main
import (
"errors"
"testing"
)
// run test
// go test .
//
const formatValueForSQL = require("./formatValue");
class Visitor {
constructor() {
this.context = {};
}
// conditions as an object
visit(conditions) {
return Object.entries(conditions)
use std::io::{Read, Write, Seek};
trait DataSink: Read + Write + Seek {}
trait Encoder<R: Read, W: Write> {
fn read_record(&self, input: R) -> Result<Entry, ()>;
fn write_record(&self, output: W, entry: &Entry) -> Result<(), ()>;
}
struct WAL<T: DataSink> {
use serde::{Deserialize, Serialize};
use std::fmt;
use std::io::Cursor;
#[derive(Serialize, Deserialize)]
struct Entry {
key: Vec<u8>,
value: Vec<u8>,
}

Keybase proof

I hereby claim:

  • I am vanhtuan0409 on github.
  • I am vanhtuan0409 (https://keybase.io/vanhtuan0409) on keybase.
  • I have a public key ASCO-jUhRiI4MlKmceq5GWEMHcvpYJ4Snnkxznpp9dImWgo

To claim this, I am signing this object:

...
<ServerList>
<!-- FIO config with 2 servers -->
<!-- Each server will be responsible for 8 bucket -->
<Name>fio</Name>
<Policy>hash</Policy>
<Servers name="fio1">
<Addr>{addr1}</Addr>
<Bucket>0 1 2 3 4 5 6 7</Bucket>
<Proto>beansdb</Proto>