I’ve been searching for a simple way to tunnel an SSH connection to my private server. There are many solutions to this problem, such as using a VPN service, a reverse proxy, etc. However, these often require installing additional packages and root permissions to manipulate network configurations. Cloudflare offers a tunnel service that can be easily installed by downloading the cloudflared…
I am renting a very cheap shared server with very generous specs (300 GB disk, TBs of bandwidth, etc.) for about $3/month. Though there are some limitations such as running on fairly old technology, basically a CPanel shared host, only supporting web server with Apache with PHP through CGI, no root access. However, they provide SSH access, so I can manage to run a modern framework with it. Let’s…
JavaScript modules can be a puzzling concept for many developers. In this post, I will try to gather and summarize how to use them effectively. I will split this post into two parts: covering modules in the NodeJS environment and those used in the browser environment. Module in NodeJS CommonJS Traditionally, NodeJS relied on the CommonJS module system for managing code. This system allows…
Một số ghi chép về ngôn ngữ hình thức(formal language), ngữ pháp(grammar), regular language và automata. Formal language & BNF grammar Ngôn ngữ hình thức có thể hiểu như một mô hình để mô tả ngôn ngữ(ví dụ tiếng Anh, ngôn ngữ lập trình Python, …). Một ngôn ngữ hình thức(thường ký hiệu L) bao gồm các thành phần: Bộ ký tự: tập hợp các ký tự trong mô hình, các ký tự sẽ được nhóm lại tạo thành…
The other day I needed to do some data analysis from a Microsoft Access file on my FreeBSD box. Here are the steps that I took. Goal : load data from Access into Python to perform data analysis Library/program used : Python with PyODBC UnixODBC MDBTools UnixODBC UnixODBC is ODBC an implementation on Linux/Unix. Installing it is quite easy, we can simply download the source code, run ./configure ,…
I have struggled for quite some time with setting up Cognito and integrating it into a web application as an authentication service. The documentation from AWS is not very clear on how to set it up and how the different pieces fit together. This post explains how I did it. The setup Client side 1. Create user pool A user pool is like your users’ table. It will contain user information such as…
libuv and its relation with nodejs When working with Javascript, there is the concept of event loop and the non-blocking model that we should aware of. Every Javascript runtime needs to have its own event loop implementation. An event loop is like a job queue where events will be pushed into it and be processed in time. Those events can be an IO event, a user’s input, etc. Each event will be…
This year I’ll try learning about compiler by writing a toy C compiler. I’ll roughly follow chibicc but will use C++ and target x64 on OSX. Repo is at mycc Hopefully, I won’t drop it.
Ruby 3 was just released today(2020/12/25) with a lot of new features, among them are: Static type Ractor Non-blocking fiber I’ll focus on non-blocking fiber in this post. I have written an introduction about Fiber some months ago. In case you haven’t heard about Fiber before, here it is: Event driven non blocking IO with Ruby’s fiber Notable change to Fiber in Ruby 3 is the new boolean option…