Null Pointer

Easily embed version information in software releases

Quite a few projects hardcode metadata in a file (or C/C++ headers), e.g. version.h with version info or defines. This can cause small problems when developers forget to update the version information inside these files. It is a lot easier to keep track of version information if your project uses git and makes use of tagging. This is one possible versioning scheme used for C/C++ releases. It depends on Make, a build automation tool, but the idea can be easily extended to other build tools such as CMake.

Nullpointer: The website

Okay, new website! HTML & Content Currently built using Hugo, a static site generator written in Go. The theme borrows heavily from spf13 to get started. Does not use any javascript (yet)! CSS The CSS is written in SASS, using a custom CSS framework called Zombie Responsive System. I currently don’t know enough about web development to fiddle with this, but it does seem quite responsive. This may be re-written at some point, once I have learnt more about CSS.

OpenCV on Arch Linux

Computer vision seems to be an interesting field to explore in. This is a simple tutorial on how to get OpenCV up and running on Arch Linux. A short C++ program is provided to confirm that OpenCV was successfully installed and compilation with OpenCV libraries actually works. To keep it simple, the provided code is quite minimal and will only load a picture, convert it to grayscale and then display both pictures in two separate windows.

Creating EPUB documents from Fictionpress stories

I consume a lot of written media on my Kindle, and I’m often frustrated when I have to use my mobile phone or computer to read online content. I needed a new project and I was hearing a lot about Node.js. In order to learn more about Node.js, I decided to write a couple of libraries to grab content from a specific website (Fictionpress) and convert it into a format that my Kindle could use.

quick-epub: Quickly generate valid EPUB 3.0.1 documents

quick-epub is a library written in Node.js that generates valid EPUB 3.0.1 documents. It is derived from cyrilis’ epub-gen as a proof of concept, rather than an actual library. It was mainly used to learn about the EPUB specification, set out by the International Digital Publishing Forum. This will generate an EPUB file with a table of contents included, which proves for easy browsing by chapter on an e-book reader. It has been tested on a Kindle Paperwhite, and should work on most e-book readers.

fictionpress-scraper: A web scraper for capturing stories

fictionpress-scraper is a web scraper written in Node.js. It makes use of promises which enable asynchronous computations in Node’s event loop. When passed a Fictionpress story ID, this library will verify that the story exists, and then fetches all the chapters for that story along with some metadata. At this stage, it will provide the story title, author’s name, summary of the story and all chapters (with chapter titles, if available).

Moving data away from Google

I kept running into issues or limitations with Google cloud services. Features would be disabled, or I was after specific functionality that was not provided. I looked into self-hosted solutions, and found out about services like Nextcloud. It snowballed pretty quickly from there. The whole idea is to move all personal data away from Google’s vast cloud. I can now host my data on my own server. The majority of this revolves around Nextcloud, which synchronises all my files, calendar & contacts between devices (desktop, laptop and mobile phone) as well as being able to access all of this online.

Creating service files for systemd

Systemd is designed to improve on the Linux startup process & init daemons by consolidating them to make them simpler. As systemd is quite new, not all Linux distributions provide systemd units for a few services as they are still using traditional init systems such as SysV init/Upstart. Included are a few service files that I’ve created for my own use. Quick Guide touch /etc/systemd/system/name.service chmod 664 /etc/systemd/system/name.service systemctl daemon-reload systemctl start name.service systemctl enable name.service tl;dr create a service file (as root) give it appropriate permissions edit service file for desired functionality start service enable service on boot ZNC The service file is taken from znc documentation with a few modifications to ensure that the daemon restarts upon failure.

Securing your server: IPTables

Setting up good firewall rules is essential for server administration. The following iptables configuration is a good starting point for IPv4. It only allows specific traffic through (ping, http/https, irc, ssh) and rejects everything else. The config is a little flexible once traffic has been established, as it will allow that traffic through. While changing iptables rules, ensure that you have an active connection to the server as you do not want to get locked out of your own server.