Feng's Notes Isn't coding fun?

Self-Host Wordpress on K8s

As I mentioned in my previous post I have setup a kubernetes(k3s) cluster on my home server. I was thinking how I could use this then I decided to host a blog site using the most used CMS on the internet, Wordpress. Here I would explain how I did it.

Build Your Own Sql Chatbot with Langchain and Streamlit

I have just built a sql chatbot for local data using langchain and streamlit. I found the whole process surprisingly smooth with these two great tools, I put here how I built this and some thoughts alongside. In case you don’t know what langchain and streamlit are, here is a brief introduction. Langchain in my mind is a tool to connect to all kinds of language models(e.g. openai) and provide interfaces to easily using them.

Troubleshooting Cloudflare Image Upload with Node

I was working on testing upload images to Cloudflare using their API. The task was supposed to be simple because cloudfare have some code samples here, however I was having trouble getting it to work. As I’m using node+axios , the sample code on document is like

How to set up a full-stack home server

I will explain in this article how to deploy and serve a kubenetes cluster(k3s) using your home laptop/PC. I will also show you how to expose your services to the internet with cloudflare tunnel. I will use a simple web app as an example to show how to build a full-stack application and serve it with the home server. Here is the overview of the architecture setup. The laptop running all these stuff is a 7 year old Thinkpad with Interl i5 + 16G Mem installed with Ubuntu

A Dev's Guide to K8s Deployment

[This is a note first published internally, I copied here for backup ] Although I have deployed a couple of apps in our k8s cluster, I find it still tricky to go through the whole journey fluently. I took some notes and put them down here for a memo. Hope it helps developers like me who are still experiencing k8s issues from time to time. The deployment steps Local Test So you have a Dockerfile in your project and a docker engine running on your machine

How to Test a Kong Plugin

Kong is a popular API gateway we are proactively using. Sometimes we need to develop plugins to meet specific architecture/business needs.

再读黑客与画家

第一次读这本书竟然已经是五年前了,最近在推上看到有人提及,就又回去翻了一下。还是有很多新感受(或者说记起来很多已经忘了的点),在这里梳理一下。

配对交易简介

量化策略里有一大类叫做Pairs Trading-配对交易,是我觉得非常有趣的,其基本思路是寻找市场中表现相近的两个资产标的A和B, 当A涨得比较高的时候,卖出A买入B , 当A 跌的比较多的时候,买入A卖出B。这个思路很容易理解,因为如果两支股票确实相近,那么他们的价格有回归到相似的可能性,这也符合古老中国哲学里面“合久必分,分久必合”的朴素道理。

道理我们是都清楚的,甚至很多交易者也是模糊的按照这个思路来做的,比如当看到百事股价跟可口可乐股价偏离太远时,可能会考虑购进一些百事股票,卖出可口股票。问题是如何把这些模糊的想法进行量化分析,进而让算法捕捉到你看不到的机会,这主要需要解决两个问题:1. 如何发现符合要求的配对 2. 何时进场买卖 。 下面我们以QUANTAXIS为回测工具,以沪深市场为例来简要介绍下一个基本的配对交易策略是怎么进行的。

Kong Vs Goku

最近由于工作需要用到API网关做请求转发用,挑了目前人气较高的两款 Kong 和Goku 对比研究一下。

聊聊我喜欢的英国报刊

虽然现在已经进入了电子时代,但是在英国你还是能看到数量繁多的传统报刊,周末的时候到市中心总是习惯性走进WHS(一家连锁书刊文具店)然后在报刊栏停留很久。陈列的杂志报刊各种题材最新的事件一目了然,随便翻翻就很满足。所有这些报刊中,我有订阅的有三个,经济学人、金融时报和卫报,下面聊下我对这几份报刊的感觉。