Skip to content

Instantly share code, notes, and snippets.

@dolfly
dolfly / zygisk.md
Created March 13, 2024 09:34 — forked from 5ec1cff/zygisk.md
Zygisk 源码分析 #Magisk #Zygisk

Zygisk 源码分析

以下分析基于 Magisk 76ddfeb93a8b3612cd68988323f422e996751e16

由于 Magisk 更新太快了,决定弃坑,自己去看源码罢!

Zygisk 注入到 Zygote 进程

Zygisk 加载是通过替换 app_process ,修改 LD_PRELOAD ,再执行原 app_process 实现的。

@dolfly
dolfly / openwrt-in-docker.md
Created February 3, 2024 01:19 — forked from mcxiaoke/openwrt-in-docker.md
Run OpenWrt in Docker

OpenWrt Docker镜像构建

为了在Docker中运行OpenWrt系统,我们需要用到OpenWrt的docker镜像,网上有很多人分享已经制作好的镜像。但是,每个人都有自己不同的需求,自己学会制作镜像就显得特别重要了。

其实使用OpenWrt的固件, 可以很方便的构建Docker镜像,这里的固件不光是官方固件,也可以是经过自己定制编译生成的固件。

直接使用

@dolfly
dolfly / GitConfigHttpProxy.md
Created January 7, 2024 00:43 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@dolfly
dolfly / macuser
Created February 19, 2019 05:38
Mac User Account Create & Delete
mac user account create and delete
### Keybase proof
I hereby claim:
* I am dolfly on github.
* I am dolfly (https://keybase.io/dolfly) on keybase.
* I have a public key ASAePSh2PbjI52HzTgmHU8Kv0OTqeU_1PwQYIn0tuyLeswo
To claim this, I am signing this object:
@dolfly
dolfly / leaky_bucket.lua
Created October 19, 2018 08:04 — forked from florentchauveau/leaky_bucket.lua
Redis script (Lua) to implement a leaky bucket
-- Redis script to implement a leaky bucket
-- see https://medium.com/callr-techblog/rate-limiting-for-distributed-systems-with-redis-and-lua-eeea745cb260
-- (c) Florent CHAUVEAU <florent.chauveau@gmail.com>
local ts = tonumber(ARGV[1])
local cps = tonumber(ARGV[2])
local key = KEYS[1]
-- remove tokens < min (older than now() -1s)
local min = ts -1
-- Redis script to get the size of a token bucket
-- see https://medium.com/callr-techblog/rate-limiting-for-distributed-systems-with-redis-and-lua-eeea745cb260
-- (c) Florent CHAUVEAU <florent.chauveau@gmail.com>
local ts = tonumber(ARGV[1])
local key = KEYS[1]
-- remove tokens < min (older than now() -1s)
local min = ts -1
@dolfly
dolfly / bucket_add.lua
Created October 19, 2018 08:02 — forked from florentchauveau/bucket_add.lua
Redis script (Lua) to add an event to a token bucket
-- Redis script to add an event to a token bucket
-- see https://medium.com/callr-techblog/rate-limiting-for-distributed-systems-with-redis-and-lua-eeea745cb260
-- (c) Florent CHAUVEAU <florent.chauveau@gmail.com>
local ts = tonumber(ARGV[1])
-- set the token bucket to 1 second (rolling)
local min = ts -1
-- iterate overs keys
<!DOCTYPE html> <!-- HTML5 doctype 不区分大小写 -->
<html lang="zh-cmn-Hans-CN"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- 优先使用IE最新版本和 Chrome -->
<!-- width=device-width 会导致 iPhone 5 添加到主屏后以 WebAPP 全屏模式打开页面时出现黑边 http://bigc.at/ios-webapp-viewport-meta.orz -->
<meta name ="viewport" content ="initial-scale=1.0, maximum-scale=3, minimum-scale=1, user-scalable=no">
@dolfly
dolfly / crf.py
Created November 15, 2013 11:05 — forked from neubig/crf.py
#!/usr/bin/python
# crf.py (by Graham Neubig)
# This script trains conditional random fields (CRFs)
# stdin: A corpus of WORD_POS WORD_POS WORD_POS sentences
# stdout: Feature vectors for emission and transition properties
from collections import defaultdict
from math import log, exp
import sys