Skip to content

Instantly share code, notes, and snippets.

View jetz's full-sized avatar
🎯
Focusing

大毛 jetz

🎯
Focusing
View GitHub Profile
@jetz
jetz / w11arm_esd2iso.sh
Last active April 15, 2024 13:15
Command line utility to create Windows 11 ARM ISOs from Microsoft ESD. See https://github.com/Technogeezer50/esd2iso
#!/bin/bash
#
# w11arm_esd2iso - download and convert Microsoft ESD files for Windows 11 ARM to ISO
#
# Copyright (C) 2023 Paul Rockwell
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@jetz
jetz / keybase.md
Created October 19, 2021 11:20
Keybase proof

Keybase proof

I hereby claim:

  • I am jetz on github.
  • I am jetz (https://keybase.io/jetz) on keybase.
  • I have a public key whose fingerprint is 9A99 FC5C 5618 35B8 6909 0843 3672 0033 3E2A D77C

To claim this, I am signing this object:

@jetz
jetz / flatten_json.py
Created September 1, 2021 06:41
Flatten JSON to kv format (v is array)
from pprint import pprint
from typing import Union, TypeVar
fields = [
{
'a': 'a',
'b': [1, 2, 3],
'c': {
'd': 'd',
@jetz
jetz / byegfw.go
Created April 22, 2020 07:53
Keep GFW out with iptables
package main
import (
"fmt"
"github.com/coreos/go-iptables/iptables"
"log"
"net"
"net/http"
)
@jetz
jetz / ljfs.lua
Created March 12, 2019 03:07
lua ffi binding for file system
local bit = require('bit')
local ffi = require('ffi')
local band = bit.band
local ffi_new = ffi.new
local ffi_str = ffi.string
local table_insert = table.insert
ffi.cdef([[
void free(void *ptr);
@jetz
jetz / etlua.lua
Created December 7, 2018 05:24
handwriting lua-version of etlua. see https://github.com/leafo/etlua
local VERSION = "1.3.0"
local load = load
local type = type
local error = error
local assert = assert
local tostring = tostring
local tonumber = tonumber
local setmetatable = setmetatable
local insert = table.insert
@jetz
jetz / git_author_rewrite.sh
Created November 13, 2018 08:32
Git scripts
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
@jetz
jetz / goto.py
Created October 29, 2018 08:49
A function decorator, that rewrites the bytecode, to enable goto in Python. See https://github.com/snoack/python-goto
import dis
import struct
import array
import types
import functools
class _Bytecode:
def __init__(self):
code = (lambda: x if x else y).__code__.co_code
@jetz
jetz / 2fa.go
Created October 29, 2018 08:47
Two-factor authentication on the command line. See https://github.com/rsc/2fa
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// 2fa is a two-factor authentication agent.
//
// Usage:
//
// 2fa -add [-7] [-8] [-hotp] name
// 2fa -list
@jetz
jetz / lulip.lua
Last active October 25, 2018 06:25
Line-level profiler for code running in LuaJIT, see https://github.com/jgrahamc/lulip
-- lulip: LuaJIT line level profiler
--
-- Copyright (c) 2013 John Graham-Cumming
--
-- License: http://opensource.org/licenses/MIT
local io_lines = io.lines
local io_open = io.open
local pairs = pairs
local print = print