一个程序员的辩白

13 May 2021

Oh My Zsh git status 响应过慢的解决方案

ohmyzsh/ohmyzsh内置的众多主题中大部分都支持显示git相关的信息。 比如默认的robbyrussell主题: 你可以通过 grep -IRl '$(git_prompt_info)' ~/.oh-my-zsh/...
16 Jan 2021

frp + trojan 组网提高网络质量

前段时间,家庭网络劣质化的厉害,可能是触碰到了土啬的逆鳞? 当然针对这种情况解决方法无非下面的几种情况: 光猫重新拨号,大概率获得一个新的NAT IP,也许可以满血复活。 换一个代理节点。 用IPLC线路/IPLC转发。 代理套CDN(需...
01 Jan 2021

2020年终总结

咳咳,2020年的年终总结的主题是,忆苦思甜。 几年前就有每年写一篇总结的想法,不过由于总总原因被推迟掉了。本质上还是因为太懒了,另外我觉得写博客是一件很费时间的事情。 不过这几天陆续在Twitter上看到一些推友发了他们的年终总结,我停下...
17 Feb 2019

Useful C tricks

C is undoubtedly one of my favorite programming language, as I wrote C code in recent years, I’ve collected severa...
04 Feb 2019

Tracking down a XNU printf() precision modifier panic bug

Background I’m a maintainer of the kernel extension in a project of our company, at the development stage, I notic...
07 Sep 2018

HOWTO use private KPIs in kernel extension

grep(1) kpi upon kextstat(8), you will find a special kernel extension named com.apple.kpi.private: $ kextstat | grep kp...
18 Aug 2018

HOWTO avoid memory leak in kext development

Memory leakage is a major issue in software development, let alone happens in kernel extension(kext) layer. Also, someti...
05 May 2018

Pseudorandom in chaos

Randomized data is commonly used in fuzz testing, game engine, UUID, pipelines, etc. Yet due to massive historically rea...
11 Apr 2018

Using {OpenGrok to boost up source code reading

Reading XNU kernel source(BSD portion) is one of my mainly job when I developing a generic kernel extension(in Apple&rsq...
05 Apr 2018

Perfect hashing for fixed-size string set

As aforementioned, we’ve dicussed perfect hashing for integers. It turns out that the concept can be generalized f...
12 Sep 2017

XNU kernel debugging via VMWare Fusion

Prelude Being able to debugging the XNU kernel is one of basic skill of my work. It’s not daunting, but a boring j...
31 Jul 2017

Compile shadowsocks-libev statically

(Update 2021-01-01: this article has been revised to adopt latest ss-libev) Previously I’ve discussed how to compi...
25 Jul 2017

Use BBR TCP congestion control in OpenVZ

Assumption I’m assuming you’re using Linux distribution, and in a KVM environment(Which the loop device will...
22 Jul 2017

Endianness Matters

Things happen rarely if you’re in an application-level development and want to write endian-independant code. Occa...
01 Jul 2017

Lowest Bit Set

How do you solve the question “Determine position of lowest bit set”? I’m not excepting you to solve i...