Raft implementation
I’ve been hoping to learn k8s in my free time, but I don’t have much free time and k8s requires very complicated preparation to learn, so I’ve been putting it off. But today I just couldn’t wait any longer, so let’s get started. To try and learn k8s, we need to install minikube. Minikube is a tool that enables users to run a single-node Kubernetes cluster on their local machine for development and testing purposes. Read more...
When I was reading some C codes from Linux kernel for the first time, I found that a compiler keyword “volatile” is commonly used in some modules. I seldom see or use compiler keywords before, so I did some research on it. From stack overflow: volatile tells the compiler not to optimize anything that has to do with the volatile variable. Actually came into existence for the purpose of not caching the values of the variable automatically. Read more...
Channels are used to communicate within different goroutines. It works like pile and it is and interesting feature from Golang. To use a channel, we need to use an arrow to point to the direction of data goes. More, we need to use make to create an new channel. ch := make(chan int) ch <- p // Send variable p into the channel s := <-ch // Read data from the channel and assign it to s Channels can be buffered. Read more...
This is an article for testing purpose. 这是一篇用来进行测试的文章 Overview 总览 Philosophy Markdown is intended to be as easy-to-read and easy-to-write as is feasible. Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions. While Markdown’s syntax has been influenced by several existing text-to-HTML filters – including Setext, atx, Textile, reStructuredText, Grutatext, and EtText – the single biggest source of inspiration for Markdown’s syntax is the format of plain text email. Read more...
My first blog was built up in 2015, and it was built by wordpress. At that time I was a newbie in programming, so it takes me a lot of time to build up the blog. I was confused by how to run a database server and connect it with wordpress at that time, tried to learn what a port or a socket is. It also takes me a lot of time debugging with nginx, to understands what a reverse proxy is. Read more...
Shadowsocks is a type of proxy server that uses an encrypted connection to redirect internet traffic. It is widely used in China to bypass the internet censorship where certain website or server are blocked e.g. Google, Twitter and network traffics are under censoring. I built up my first shadowsocks server in 2014, when I was 13 years old. Which is the first year that China started to block services from Google. Read more...