Skip to content

Instantly share code, notes, and snippets.

View spacewander's full-sized avatar
🏢
working

罗泽轩 spacewander

🏢
working
View GitHub Profile
@spacewander
spacewander / manpage效果
Created March 20, 2014 12:36
使用ronn来将文档从ronn格式(一种类似于markdown的文本标记格式)转换成man page
SPACEWANDER(1) SPACEWANDER(1)
NAME
spacewander - A Humble Programmer
SYNOPSIS
spacewander -e|-eat food
spacewander -s|-sleep
@spacewander
spacewander / OpenResty.repo
Created November 4, 2016 06:12
OpenResty rpm package
[openresty]
name=Official OpenResty Repository
baseurl=https://copr-be.cloud.fedoraproject.org/results/openresty/openresty/epel-$releasever-$basearch/
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/openresty/openresty/pubkey.gpg
enabled=1
enabled_metadata=1
@spacewander
spacewander / list_dependencies.py
Created January 4, 2017 11:04
Quick and dirty script for git-extras
#!/usr/bin/env python
# coding: utf-8
"""
Run this quick-and-dirty script to list dependencies used in git-extras/bin.
With -t option, print result with markdown table syntax.
With -v option, grep usage to filter out false positive result.
"""
from collections import defaultdict
import os
import re
@spacewander
spacewander / Murmur2A
Last active November 21, 2017 08:21
SMHasher result for md5_32a Murmur3A Murmur3F and more...
-------------------------------------------------------------------------------
--- Testing Murmur2A (MurmurHash2A for x86, 32-bit)
[[[ Sanity Tests ]]]
Verification value 0x7FBD4396 : Passed!
Running sanity check 1..........PASS
Running sanity check 2..........PASS
[[[ Speed Tests ]]]
@spacewander
spacewander / install-rock-scm-0.sh
Created April 6, 2018 15:06
install luarocks scm-0 version
#!/usr/bin/env bash
# luarocks install $1 scm-0 doesn't work, but you could run this instead:
wget https://luarocks.org/$1-scm-0.rockspec && sudo luarocks build $1-scm-0.rockspec
@spacewander
spacewander / a.sql
Created May 15, 2018 03:15
my pgsql collection
-- drop all table in a database
select string_agg('drop table "' || tablename || '" cascade', ';') from pg_tables where schemaname = 'public';
-- copy the ouput and execute it
@spacewander
spacewander / release_info.rb
Last active June 22, 2020 03:11
git-extras release script
#!/usr/bin/env ruby
# encoding: UTF-8
require 'set'
# usage: $SCRIPT <dir_of_git_extras>
Dir.chdir ARGV[0]
puts <<EOS
The git-extras $version ($release-name) is released now!
Here's a list of all the changes made in this release; the full changelog can be found in [History.md](https://github.com/tj/git-extras/blob/master/History.md):
@spacewander
spacewander / run.sh
Created July 27, 2020 02:37
kafka Mirror Maker configure for SASL PLAIN user/password authenciation
./kafka-run-class.sh kafka.tools.MirrorMaker \
--consumer.config ../config/source.consumer.configure \
--producer.config ../config/target.producer.configure \
--num.streams 4 \
--new.consumer \
--whitelist=xxx
@spacewander
spacewander / fault-injection.ts
Created November 16, 2021 06:36
WASM plugin for apisix
export * from "@solo-io/proxy-runtime/proxy"; // this exports the required functions for the proxy to interact with us.
import {
RootContext, Context, registerRootContext, log,
LogLevelValues, FilterHeadersStatusValues,
FilterTrailersStatusValues, GrpcStatusValues,
send_local_response
} from "@solo-io/proxy-runtime";
class FaultInjection extends RootContext {
@spacewander
spacewander / output
Created June 19, 2022 16:08
Can we hide real filename due to https://t.co/LMiYsdIltI?
type: application/x-stuff
filename: This is ***fun***
type: application/x-stuff
filename: a