Skip to content

Instantly share code, notes, and snippets.

View liweitianux's full-sized avatar
🎵
Focusing

Weitian LI liweitianux

🎵
Focusing
  • Shanghai, China
View GitHub Profile
@liweitianux
liweitianux / .git-commit-template.txt
Created August 1, 2023 02:00 — forked from adeekshith/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@liweitianux
liweitianux / hexdump.lua
Last active February 21, 2024 12:05
Hexdump in Lua
-- Hexdump the input data using the same style as 'hexdump -C'.
-- Supports Lua 5.1 and above.
-- Credit: http://lua-users.org/wiki/HexDump
function hexdump(data)
if type(data) ~= "string" then
return nil, "expected string type, but given " .. type(data)
end
local pieces = {}
local i = 1
@liweitianux
liweitianux / cat-lps.pl
Last active February 21, 2024 12:05
Print lines at particular speed (line/sec)
#!/usr/bin/env perl
#
# Cat file to terminal at particular speed of lines per second
# https://superuser.com/a/526249
#
# Usage: cat-lps.pl [lps] [file]...
#
use warnings;
use strict;
@liweitianux
liweitianux / apisix-etcd.md
Last active February 21, 2024 12:05
APISIX etcd configurations
@liweitianux
liweitianux / git-getversion.sh
Created April 27, 2021 04:56
Generate version information based on Git tags/commits
#!/bin/sh
#
# Generate version information based on Git tags/commits.
#
dirty_mark='+'
usage() {
cat >/dev/stderr <<EOF
usage: ${0##*/} <full|tag|count|commit> [--dirty] [default]
@liweitianux
liweitianux / nginx.google.conf
Created July 17, 2021 03:44
Nginx Proxy to Google
#
# Nginx reverse proxy to Google Search (with images and webcache))
#
# Credit:
# * Nginx rewrite append a parameter at the end of an URL
# https://serverfault.com/a/311660/387898
# * https://github.com/tracycool/Reverse-Proxy-for-Google
# * https://github.com/caiguanhao/nginx-bypass-gfw/blob/master/google.conf
#
# References: