Siyuan's Blog

Read(); Think(); Try(); Repeat();

Migrating to a new Mac

I recently bought a new MacBook Pro 13-inch (2017, w/o TouchBar) to replace my aging MacBook Air 13-inch (mid-2013). My old machine only has 4GB memory and 128GB SSD, and it’s slowing things down sometimes. When I was setting up my new Mac, I decided to have a fresh install of macOS. This allows me to think about what should be migrated from an old Mac to a new Mac.

Linux-like key binding in iTerm 2

I work regularly on both Linux and Mac. When I work in terminal on Linux, I use the Alt key very often. Alt is the prefix of many terminal shortcuts and I also use the Alt key in tmux to switch between panes within a window. This key, however, behaves differently on Mac. In this post, I will describe how to have Linux-like key binding in iTerm 2 for the Alt key.

Using Let's Encrypt for NGINX on CentOS 7

Recently, I set up several web apps on my VPS. As these apps requires user credentials to access, I have to make sure they are secure. Therefore, I decided to enable HTTPS on these sites. Also, since Chrome shows HTTP sites as “Not secure” starting from Chrome 56, it’s a good idea to enable HTTPS support on every website you are running. In this post, I will describe how to enable HTTPS support in NGINX with SSL/TLS certificate from Let’s Encrypt on CentOS 7.

Initialization forms in C++11

Recently I was learning C++ and I got to know the new brace initialization in C++11. Therefore, I decided to take a look at various initialization methods and the reason behind this new syntax. According to my research, in C++03, the initialization methods are a bit tricky and have certain restrictions. Let’s take a look at how you initialize objects in C++03 and how it could be improved with C++11.

C/C++ project organization

In the past few years, I’ve written some very small C/C++ programs. Back then, I didn’t pay much attention to project organization as one project is just a few source files, headers, and a Makefile. Recently I’ve been doing a lot of development with C++ in a larger project. This got me into thinking how a C/C++ project should be organized. In this blog post, I wanna talk about how a moderate size C/C++ project could be organized to keep things in order.