Feng's Notes Isn't coding fun?

Cache on the edge with Cloudflare Workers

I recently found a nice project which offers iframe line to display stars of any github repo. I found it could be useful on my another building website which aims to track the trending repos on github. So I tried to put it on and it worked well…at first. How when I put several repos on one page the tool stopped working and don’t show the star number. I checked its source code https://github.

Streamlit app to manage your cloudflare images

In my previous article I introduced how to build a sql chatbot with langchain and streamlit. I was then thinking if I can use streamlit to manage my image gallery on cloudflare. I found it was as easy as I thought, of course with a bit help of chatgpt.. Why I need this I have been using cloudflare images service for a while and satisfied with its speed. However, it doesn’t have a good UI tool.

How to queue up jobs in nodejs

I have a service written with nodejs when I found some requests took too long to process. so I decided to queue up the requests and process them one by one. I used Celery in python projects before, so I was looking for something similar in nodejs. Then I found Bull which is a Redis-based queue for Node. Here are some essential notes that would be helpful if you want to use Bull in your project.

How to Build An Browser Extension Plugin 2023

I use several browser extensions in my daily work. One of the most useful one is youtube-playback-speed-co it is so simple yet so powerful and saved me a lot of time on adjusting the playback speed of youtube videos. Then I wonder how it works and if I can make one myself. So I did some research and here is what I found.

Github Action Manual Approval Practice

Our team has been using github action for CI/CD for a while. It’s very convenient and easy to use. We use it to build docker images, push to docker registry and deploy to kubernetes cluster. But there is one thing that we are trying to improve, that is we want to have a manual approval step before deploying to production. We tried many methods but none of them works well until we found this manual-workflow-approval action.

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