Using Git for Managing a Live Site

Uploading files to production level after every change in code can be quite a hassle. Most people would use an automated deployment system instead of doing it manually. We can create an automated deployment system ourself by just using a version control like Git, which would also only take a few seconds to set up. […]

Postfix and SMTP Relaying on CentOS 7

One way to transmit mail within a local server is by sending them directly through third party mail servers on the Internet using the SMTP protocol. Postfix is a free and open-source mail transfer agent (MTA) and available in most Linux distributions (including CentOS 7!). This guide will outline the basic steps on how to […]

SSH and Port Knocking

It turns out that SSH brute-force attacks, dictionary attacks or combinations of those are daily routines nowadays. Server logs are quickly filled with login attempts, in the hopes that one of them is right. The best prevention against these kind of attacks is to have a good password, or even better to force key-based authentication. […]

Server Migration and Blog Update (2016)

The server transfer has been completed without any major problems. As I have moved from Octopress to WordPress, all posts from the old site will be available again in the following weeks.

Shannon-Fano Coding

Shannon-Fano coding is another compression technique used to reduce the number of bits needed to store a message, however unlike Huffman coding, it does not use a bottom-up approach and neither does it generate minimal codes. The following section summarizes the simple encoding process. Example sentence: This_is_an_example Step 1: Preparing Count the frequencies of existing […]

Python Script as Systemd Service

Running a python script on a remote machine can be achieved by using a terminal multiplexer (see GNU screen). Another rather convenient alternative to that would be systemd. Creating our Service The following python script acts as a single-threaded server, which does not have much functionality besides receiving and sending back (the same) data. #!/usr/bin/python3 […]

Huffman Coding

Huffman coding is a compression technique used to reduce the number of bits needed to store a message. Codes are basically generated by building a tree from bottom up (as opposed to Shannon-Fano coding), using the occurrence amount of input entities (letters in the following example). This leads to the codes being prefix-free, meaning that […]

Introduction to C

C Preprocessor C preprocessor code will be executed before compiling the actual c code. Preprocessor lines start with # and do not end with a semicolon (in contrast to usual code instructions). #define MAX_SIZE = 1 #undef MAX_SIZE The first instruction replaces instances of MAX_SIZE with 1. The second instruction undefines the previous made call. […]

Rechenbeispiele zu Caching und Paging

Cache Beispiel direkt-abbildender Cache Hauptspeichergröße: 4MiB Einträge des Caches: 4096 Blockgröße: 16 Byte Cachezeilen/Einträge des Caches = Cachegröße / Blockgröße Cacheadresse = Gültigkeitsbit + Tag + Index + Byteblock Wie viel Bit benötigt man um den kompletten Hauptspeicher anzusprechen? 4 MiB = 4 * 2^20 = 2^22 => 22 Bit Wie viel Bit besitzt der […]

Introduction to SQL

SQL (Structured Query Language) is used for retrieving and managing data in relational databases. This page will give you an overview of the general syntax. Some useful data types are: INT[EGER], SHORTINT, FLOAT [REAL], DECIMAL(a, b), VARCHAR(n), CHAR(n), BIT(n), BOOLEAN, NULL, DATE, TIME, TIMESTAMP which should be self-explanatory. Basic SQL Query SELECT <Attribute(s)> — What? […]