Skip to content

Instantly share code, notes, and snippets.

View honmaple's full-sized avatar

honmaple honmaple

View GitHub Profile
@honmaple
honmaple / tproxy_upstream.py
Created March 16, 2022 02:11
transparent proxy with python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import select
import sys
IP_TRANSPARENT = 19
HOST = "0.0.0.0"
PORT = 10
@honmaple
honmaple / insert_and_sort.go
Last active April 6, 2023 14:57
insert new element to array and sort compare to search and sort when insert
package main
import (
"math/rand"
"sort"
"testing"
"time"
)
func randNums() []int {
@honmaple
honmaple / file_encrypt.go
Created July 16, 2023 03:25
large file compression, encryption with io.Reader and io.Writer
package main
import (
"bytes"
"compress/gzip"
"crypto/aes"
"crypto/cipher"
"crypto/md5"
"crypto/rand"
"fmt"
@honmaple
honmaple / yabai.lua
Created March 25, 2024 10:27
Like i3wm's scratchpad
local _M = {
scratchpad = {}
}
local yabai = string.gsub(hs.execute("which yabai", true), "%s+", "")
_M.init = function()
local output, status = _M.exec("query --windows")
if not status then return end