RSS Amplifier

Blog

George's Homepage

George's Homepage

gir.me.ukRSS feed ↗20 posts

Latest posts

Making DeaDBeeF work with Sway window manager

Making DeaDBeeF work with Sway window manager - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Making DeaDBeeF work with Sway window manager My fresh install of Debian 13 came with Wayland enabled which meant I had to switch away from my usual i3 window manager to Sway . While the change was very straginforward due to compatible configuration syntax there was one…

Validating Incoming Data Using Zod and TypeScript

Validating Incoming Data Using Zod and TypeScript - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Validating Incoming Data Using Zod and TypeScript When handling any sort if incoming data it is important to validate that the data is what it is expected to be. There are 2 types of validation: Validating the structure (i.e. the "shape" of the data) Validating the…

Building low-boilerplate backend services in Node.js

Building low-boilerplate backend services in Node.js - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Building low-boilerplate backend services in Node.js As a backend developer, I have repeatedly found myself in the position of having to build backend services that share a lot (or even all) of plumbing with existing services. In this article I talk about my…

Github Actions Workflow to Publish NPM Packages From A Monorepo

Github Actions Workflow to Publish NPM Packages From A Monorepo - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Github Actions Workflow to Publish NPM Packages From A Monorepo In a scenario where a team of developers are working on the same codebase it is desirable to centralise code deployments via some sort of Continuous Integration (CI) pipeline. Indeed,…

Node.js "for of", "forEach", "map" and "reduce" Overhead

Node.js "for of", "forEach", "map" and "reduce" Overhead - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Node.js "for of", "forEach", "map" and "reduce" Overhead This post compares the performance of the JavaScript for of , forEach , map and reduce with that of the basic for loop. It is firmly in the microbenchmark category and should be treated as such. Unless…

Performance test of async / await in Node.js 8 LTS

Performance test of async / await in Node.js 8 LTS - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Performance test of async / await in Node.js 8 LTS The recently released Node.js 8 LTS comes with async / await support, which turns promises from an ugly kludge into something actually useful. This post shows an example of using the new async / await feature and…

Setting Up a Private NPM Registry

Setting Up a Private NPM Registry - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Setting Up a Private NPM Registry While open source is great, sometimes it is not possible to make your code public and publish it to the official NPM registry. In this situation you may want to set up a private NPM registry and publish your packages there, for re-use by your…

Bootstrap 4 Page Header

Bootstrap 4 Page Header - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Bootstrap 4 Page Header For reasons that don't make much sense , Bootstrap v4 removed the useful .page-header class. Here is what I am using as a reasonably close-enough replacement: @import "path/to/bootstrap/scss/bootstrap.scss"; .page-header { @extend .mb-4; @extend .mt-5; @extend .pb-2;…

Example Socket.IO client and server

Example Socket.IO client and server - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Example Socket.IO client and server Here is a basic example of a WebSocket client and server using the popular Socket.IO framework. The main advantage of using Socket.IO vs writing your own WebSocket client and server is that Socket.IO will fall back to other protocols if your…

Reasons to use JavaScript / Node

I'm currently working on some slides for JavaScript / Node.js training I will be running for our company. Since there is plenty of material on the internet to bash JavaScript I thought I would share a few of the opening slides which try to explain why I love JavaScript. :)

Disabling BIND9 IPv6 on Debian 8.0 / Ubuntu LTS 16.04

Disabling BIND9 IPv6 on Debian 8.0 / Ubuntu LTS 16.04 - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Disabling BIND9 IPv6 on Debian 8.0 / Ubuntu LTS 16.04 If you use BIND and your system is not configured to use IPv6 then you will see the following annoying messages in your /var/log/syslog file: named[13269]: error (network unreachable) resolving 'uk/DS/IN':…

Working with binary data in Node.js

Recently I spent some time working with streams of binary data in Node.js. Here are some lessons I learned as a result. Binary length Node.js makes it easy to work with strings because under the hood everything is stored in 16-bit characters, which means it can represent ASCII and UTF-8 (and even UTF-16) characters natively. Consequently: 'Cafe'.length === 'Café'.length; // true When working with…

A simple Node.js log server using ZeroMQ

This post walks through building a simple Node.js log server that uses ZeroMQ to accept messages. Such a server could then be shared by multiple applications (or modules within a single application). In this example the log server is launched as a stand alone process, but in practice you could launch it as a thread from a parent application using require('child_process').fork() .

Notes in building the deadbeef player on Debian

Notes in building the deadbeef player on Debian - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Notes in building the deadbeef player on Debian This is mainly a reminder for myself if I ever need to re-build the deadbeef player (which really is the ultimate music player for GNU/Linux) from source. :) sudo aptitude -q update sudo aptitude -q install pulseaudio…

Nginx + PHP-FPM with chroot

This document covers the process of setting up Nginx and PHP-FPM, with the latter running in chroot mode. It is assumed that the reader is familiar with what chroot is and its limitations. These instructions were tested on a freshly installed Debian GNU/Linux (Wheezy, 7.7) system and require root privileges.

A simple Node.js TCP proxy

I'm working on an interesting project that required the use of a TCP proxy. I haven't really worked with TCP sockets before, so it is lucky that Node.js makes it quite so easy. :) The following is a basic example of such a proxy.

Greylisting clients based on a DNSBL (Debian+Exim+Greylistd)

I have recently implemented greylisting on my email servers in order to reduce the amount of spam that has to be processed by my MailScanner content filtering server (and consequently reduce the load on that server). Rather than greylisting all incoming messages, I am picking on only those senders who are listed in a blocklist. This largely works around the biggest complaint about greylisting: the…

Making Kvass

Kvass is an awesome drink that is widely consumed in Russia and a lot of people there make it at home. While there are many recipes and HOWTOs available on the subject in Russian there is not so much information available for English speakers. Here follows my attempt to improve the situation.

Compile LESS CSS and Markdown files with Make

Compile LESS CSS and Markdown files with Make - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts Compile LESS CSS and Markdown files with Make Here is a simple example Makefile to automatically compile any changed LESS CSS, or Markdown files and then update a remote server using rsync: EXCLUDE = --exclude=.* --exclude=node_modules/ EXCLUDE_MF = --exclude=Makefile…

My first GitHub project!

My first GitHub project! - George's Homepage George's Homepage Posts Tools Open Source Contact Shaolin Arts My first GitHub project! A few days ago I pushed out my first GitHub project. :) PHP CacheZero is a simple page caching library. It is basically a reimplementation of the similar functionality of the Cache_Lite library, except I have coded it for PHP 5. As nice as Cache_Lite is, the…