Skip to content

Instantly share code, notes, and snippets.

View nykma's full-sized avatar
🎸
git-blaming

Nyk Ma nykma

🎸
git-blaming
View GitHub Profile
{
"version": "1",
"comment": "Here's an NextID proof of this Github account.",
"comment2": "To validate, base64.decode the signature, and recover pubkey from it using sign_payload with ethereum personal_sign algo.",
"persona": "0x03947957e8a8785b6520b96c1c0d70ae9cf59835eec18f9ac920bbf5733413366a",
"github_username": "nykma",
"sign_payload": "{\"action\":\"create\",\"created_at\":\"1647329242\",\"identity\":\"nykma\",\"platform\":\"github\",\"prev\":null,\"uuid\":\"ea7279e4-b00c-4447-b784-c8f45895fdc8\"}",
"signature": "p4kb/P2uuKCU40zZTs+jk6/ARAO5ZcXErvJU/8oXNVt3+b6SUzpauBW6wNT2N8fwQeXYGgFHCTEGon4qZbK3IQE=",
"created_at": "1647329242",
"uuid": "ea7279e4-b00c-4447-b784-c8f45895fdc8"
@nykma
nykma / README.md
Last active April 8, 2024 11:36
Clash linux iptables local redir config

Let Clash handle all local network traffic.

Setup

# Create a separate user to run Clash
useradd clash
# Note down UID
id clash
# Use rest of the file in this gist as usual.
@nykma
nykma / maildir_utf7_symlink.rb
Last active July 14, 2022 23:20
Symlink UTF-7 directory name into an UTF-8 version
@nykma
nykma / README.md
Last active October 9, 2017 05:22
Shadowsocks-libev-redir @ linux w/ iptables

Nykma's magic scripts

  • ss_redir_iptables:
    • Generate iptables redir rules to ss_redir
    • Auto load and unload ipset of china IPs using chnroute.txt
    • Test if an IP is in china IP set.
  • ss_ctl:
    • Switch shadowsocks profiles with systemctl --user
  • chnroute_refresh:
  • Download and parse china IPs based on APNIC record
@nykma
nykma / XD75.kbd.json
Last active August 21, 2017 03:01
XD75
[
{
"name": "XD75"
},
[
"Esc",
"!\n1",
"@\n2",
"#\n3",
"$\n4",
@nykma
nykma / Ergodone.kbd.json
Last active January 7, 2019 10:18
Ergodone
[
{
"name": "Ergodone",
"author": "Nyk Ma <moe@nayuki.info>"
},
[
{
"x": 3.5
},
"#\n3",
@nykma
nykma / Nyks-Planck.kbd.json
Last active December 16, 2016 10:06
Nyk's Planck
[
{
"name": "Nyk's Planck",
"author": "Nyk Ma <moe@nayuki.info>",
"background": {
"name": "Carbon fibre 3",
"style": "background-image: url('/bg/carbonfibre/carbon_texture1869.png');"
},
"switchMount": "cherry",
"switchBrand": "gateron",
@nykma
nykma / pointer.rb
Last active July 8, 2016 07:59
Pointer for Ruby array
class Pointer
attr_reader :count, :array, :current, :index
def initialize(array)
raise unless array.is_a?(Array)
@array = array.clone
@count = @array.count
@current = @array.first
@index = 0
end
@nykma
nykma / subdomain_of_rack_test.rb
Last active September 5, 2018 03:53
Set subdomain of rack-test
def subdomain!(sub="test")
::Rack::Test::DEFAULT_HOST.replace "#{sub}.your_domain.com"
end
@nykma
nykma / My-ErgoDox-keymap.kbd.json
Last active December 16, 2018 12:43
My ErgoDox keymap
[
{
"name": "My ErgoDox keymap",
"author": "Nyk Ma",
"switchMount": "cherry",
"switchBrand": "gateron",
"switchType": "KS-3-Yellow",
"pcb": false,
"plate": true
},