Quick References

As a constant learner, I get to touch upon many ideas in different areas. This category is for me to capture those ideas which I felt people may reference to get ahead of their tasks. Most of the time, I do come back to this section of my blog to remember what I had learnt in the past.

Setting up a fast git server on Raspberry Pi Zero W with Go Git Service (Gogs) and Raspbian Stretch Lite

The Go Programming Language is a compiled programming language created by Robert Griesemer, Rob Pike, and Ken Thompson from Google in 2009. With Google Go, it is possible to build programs that run efficiently on minimum hardware resources. The compiled code runs close to the speed of C. Use cases of Go Programming language includes Docker, Kubernetes and Go Git Service.

If you happen to need a self-hosted git server to track software projects that you build on the side, you can consider using Go Git Service. With the Raspberry Pi Zero W bundle set, you can set up a fast git server that does not take up too much space on your desk.

This post details how you can setup a fast git server on Raspberry Pi Zero W with Go Git Service and Raspbian Stretch Lite.

Why should programmers blog?

One of the big words on the Internet nowadays is the word ‘blog’. As a noun, this word refers to a website or web page that is updated regularly by an individual or a group, written in an informal or conversational style. What you are reading now is an example of one. As a verb, it refers to the act of adding new content to a blog.

Ever since I started this blog on 14 November 2010 on a self-hosted WordPress instance, I had never stop adding content to it.

Since then, I often came across programmers asking why they should blog. To help them get started, here are some reasons for programmers to blog.

How to setup Raspbian Stretch Lite with remote configuration over WiFi on first boot

Two of the good features of Raspbian Stretch Lite is that it allows us to enable the SSH server and connect to our WiFi network before it boots up for the first time.

Combining these two features is useful for projects based on Raspberry Pi Zero W as we can configure Raspbian Stretch Lite via SSH without connecting extra peripherals to it.

This post documents how you can enable remote configuration of your Raspbian Stretch Lite over WiFi on first boot.

How to enable authenticated MongoDB access for Flask-MongoEngine applications

After having a first look at MongoDB more than 5 years back, I told myself that I will use MongoDB to realise the next functionality of Techcoil.

With exposure to Python 3, Flask and MongoEngine in 2017, I had acquired the skills to build a microsite to recommend gift ideas. This microsite uses MongoDB to store the gift recommendation data.

With Flask and MongoEngine, development of this microsite did not take too much leisure time. With MongoDB not enforcing authentication, there were not much hindrance in setting up the development environment for this microsite.

However, this free-for-all mode of accessing MongoDB is not recommended for production environments. Without authentication, it is easier for ill-intentioned people to mess up the backend database.

To ensure that I have a go-to post for implementing authenticated access to MongoDB backed projects in the future, I document the steps needed for Flask-MongoEngine applications to access MongoDB instances with access control turned on.

How I setup a Raspberry Pi Zero W CCTV camera with motionEye and Raspbian Stretch Lite

I had previously built a Raspberry Pi Zero W CCTV camera with motionEyeOS which was connected to the Wifi network of my old DLink router.

After I started using Linksys AC1900 Dual Band Wireless Router as my home router, I could no longer connect to that Raspberry Pi Zero W CCTV camera.

After reinstalling motionEyeOS a couple of times on my Raspberry Pi Zero W, I determined that motionEyeOS is not suitable for this new Wifi network.

On the other hand, my setup of WordPress on Raspberry Pi Zero W with Raspbian Stretch Lite, nginx, mariadb and PHP was able to connect to my new Wifi network, even after multiple system reboots.

Hence, I figured that if I wanted to build a Raspberry Pi Zero W CCTV camera that can connect to my new Wifi network, I could use Raspbian Stretch Lite as the base operating system and install motionEye for the web frontend to view the camera footage.

This post documents how I setup a Raspberry Pi Zero W CCTV with motionEye and Raspbian Stretch Lite.

How I setup Jenkins on my Raspberry Pi 3 with Raspbian Stretch Lite

Jenkins is a renowned open source automation server that can help offload programmers from performing repetitive tasks like:

  • running unit tests to make sure new code does not break existing codes.
  • compiling and packaging the binaries from codes and dependencies.
  • deploying new binaries to testing servers.
  • checking whether production server is up and running.
  • and etc.

If you have a Raspberry Pi 3 and you want to automate some of the tasks for your side projects, you may want to consider setting up Jenkins on your Raspberry Pi 3 with Raspbian Stretch Lite as the operating system.

This post documents how I setup Jenkins on my Raspberry Pi 3 with Raspbian Stretch Lite.

Setting up WordPress on Raspberry Pi Zero W with Raspbian Stretch Lite, Nginx, MariaDB and PHP as the LEMP stack

A Raspberry Pi Zero W is a small and capable computer that included a Wi-Fi chip for projects that requires an Internet connection.

Apart from running client programs on the Raspberry Pi Zero W, it is equally capable of being a web server. Since I had a spare Raspberry Pi Zero W lying around the house and there are good reasons to blog as a programmer, I decided to use it as a WordPress server to collect content for a new blog project.

This post documents how I setup WordPress on a Raspberry Pi Zero W with Raspbian Stretch Lite, nginx, MariaDB and PHP as the LEMP stack.

How to construct a HTTP request to an endpoint with HTTP Basic Authentication

The HTTP basic authentication is a mechanism commonly used by web servers to authenticate the sender of a HTTP request. Such a mechanism is usually used to guard server endpoints that are meant to be accessed programmatically.

Almost every new project that I got my hands on required me to create client side coding for accessing server endpoints that use HTTP basic authentication for authenticating the HTTP request sender.

To have a quick reference on how to construct a HTTP request to an endpoint with HTTP basic authentication, I created this post to as a documentation. The steps are agnostic to any programming languages.

Types of modular interface design

After a lesson on modular architecture from a System Architecture course, I find myself referencing back to the topic of modular interface design to gather inspiration.

As described in Product Design and Development by Karl Ulrich and Steven Eppinger, there are 3 types of modular interface design.

To cater for future reference, I documented some information about 3 types on modular interface design in this post.