Programming / Software development

Android ADB ├╝ber TCP/IP

How to use ADB over TCP/IP instead of USB

Android development on FreeBSD

How to get started with Android development on FreeBSD (using Android Studio)

Linear stepper motor control - A summary

A short summary of the algorithms required for linear accelerated and decelerated stepper motor control on microcontrolers.

Adding tags for indexing webpages with Jekyll

An easy method to add tags to your static Jekyll generated pages and blogs

How to handle LoRA messages from thethingsnetwork from JavaEE with TTNClientJ2

This article is a (really) short tutorial on how one can handle messages from LoRA nodes that are routed via thethingsnetwork inside an self-contained JavaEE application.

The Blogsphere - How pingbacks work

The blogsphere is a web of interconnected websites. As usual websites are linked like all pages in the WWW but on the other hand they provide an easy way of notifying each other of being referenced by a third party. Pingback is - besides trackbacks - the (XML-RPC based) technology used for that notification.

I2C communication between RaspberryPi and an AVR based I2C slave

04 May 2019 - tsp

This article explains how to use an AVR as I2C slave device (basically how to set registers for the TWI controller) and how to interface that to an RaspberryPi running FreeBSD

Using Git / Git Cheatsheet

07 May 2019 - tsp

A short cheat sheet on how to use the git version control system (most basic operations)

Authenticating and signing using Austrias citizen card

15 Jul 2024 - tsp

A short summary on how to embed authentication and generally signing with the Austrian citizien card

What are JSON web tokens any why would one want to use them?

15 Jul 2024 - tsp

Just a short description of what a JWT is, what it can do for one and how they are realized - and why one would want to use them to identify users in one's web application by using JWTs instead of session IDs.

OpenHantek on FreeBSD for USB oscilloscope

02 Oct 2019 - tsp

A really short description on how to build OpenHantek on FreeBSD and how to configure the system - and how to create a FreeBSD port.

Setting up the ESP32 and ESP8266 build environment

07 Oct 2019 - tsp

Short summary on how to setup the development environment for ESP8266 (Non-OS and RTOS) as well as ESP32 (RTOS) including a short shellscript that's capable of setting up the development environment.

x86 and x86-64 memory models

03 Nov 2019 - tsp

A really short *unfinished* introduction into the various memory models of the x86 architecture

Clone or pull all your github repos (possible as basis for a backup)

07 Nov 2019 - tsp

A short summary on how to use the GitHub API with access tokens to mirror all your GitHub repositories and keep them up to date.

How to use Frama-C to proof correctness of AVR microcontroller code

27 Nov 2019 - tsp

This is a short article that shows how one can use Frama-C and the WP plugin to proof correctness or some properties of ANSI C code written for AVR microcontrollers.

Using Sonoff T4EU1C non-neutral switches with own firmware

15 Jan 2020 - tsp

A short review about the T4EU1C Sonoff Switch as well as an example how to flash Sonoff basic switches with custom firmware

Selenium with Chromium and Java on FreeBSD

10 Feb 2020 - tsp

This is a short description on how to get started using Selenium with chromedriver on FreeBSD with a Java application. This can be used to develop automatic test applications for web applications or simple bots that scrape content from webpages or automate actions on the web using a full browser capable of running JavaScript, running browser plugins, etc.

Neuronal network basics

25 Feb 2020 - tsp

A short introduction into neuronal networks and backpropagation

Frama-C with wp-dynamic and function pointers

02 Mar 2020 - tsp

How to use Frama-C static analysis and proof assitant with ACSL annotations for function pointers in ANSI C.

Frama-C predicates

06 Mar 2020 - tsp

Really short primer on ACSL predicates for formal verification of ANSI C code with Frama-C.

NodeMCU based PIR motion sensor supporting WiFi and MQTT

19 Mar 2020 - tsp

Mini tutorial on how to use the NodeMCU Amica and a cheap PIR sensor module to build a pretty simple motion sensor that supports reporting via MQTT messages.

Simple JPEG image I/O with libjpeg

20 Mar 2020 - tsp

Short tutorial on how to use libjpeg for simple image I/O (to read and write JPEG files to/from disk or memory and represent them as simple in-memory bitmap for simple CV experiments)

k-Means clustering algorithm

22 Mar 2020 - tsp

Short summary about the k-means algorithm and it's usage

WebRTC Media Streams

14 Apr 2020 - tsp

This blog post is part of a short series about WebRTC. It describes the different media sources available as well as how one can do local loopback of a datastream. Note that data transfer is not described in this blog post, only access to webcam and screen sharing streams and direct pixel manipulation.

Anatomy of a typical Unix-like/Linux daemon

25 Apr 2020 - tsp

A really short introduction of the basic anatomy of a Unix-like or Linux daemon process.

A method to write objectoriented code in ANSI C

24 May 2020 - tsp

This blog post summarizes a method that can be used to develop software in the same way one would when using object oriented techniques with C++, Java or similar languages. It's based on the method used by the previously mentioned languages to implemented that stuff on bare metal.

What (in my opinion) one can learn from Erlang/OTP for other programming languages

01 Jul 2020 - tsp

Since I'm a huge fan of the Erlang programming language and the OTP toolkit but normally aren't working with projects where Erlang is suited or in case some existing code is using already other languages and so I'm not capable of using Erlang I tried to summarize some of the things that I think one can learn from programming in Erlang/OTP even when using other programming languages. Of course this stuff is not enforced by the runtimes and it's harder to achieve on other platforms but the approaches work nevertheless.

Runtime swapable and upgrade-able modules in ANSI C

09 Jul 2020 - tsp

This article describes an trick that I'm using in some of my applications to allow one to exchange modules or plugins inside an application at application runtime as well as keeping old versions active as long as they're required.

LoRA WAN stuff often not seen

18 Aug 2020 - tsp

A short summary of LoRA WAN stuff that's often not seen by device and application manufacturers and developers. This blog post tries to give a short overview of network behavior and internals.

Simple XML serialization and deserialization in C#

19 Aug 2020 - tsp

Since a student of mine struggled realizing simple structured serialization and deserialization to and from XML in C# I decided to put together a small tutorial.

LoRA WAN device activation (OTAA and ABP)

19 Aug 2020 - tsp

Minimal description of the two possible activation procedures of LoRA WAN device activation and the meaning of device activation for the network. This article has been written since the difference between OTAA and ABP as well as the reasoning seems to be a problem for some developers.

Comparison of generic data serialization methods

24 Aug 2020 - tsp

A summary and short comparison of various generic (non application specific) data serialization techniques and formats

A look at the pastry distributed hashtable

19 Sep 2020 - tsp

This blog post takes a look at the pastry distributed hashtable. This is a hashtable that allows resilient and scaling distributed key value stores and that can be used to build a variety of applications on top.

The role of message brokers in IoT and microservice scenarios

12 Oct 2020 - tsp

A short view on the role of message brokers in two different context, which problems they solve and what one should be aware of.

Automatic Jenkins udpate using Shellscripts and Jenkins

13 Oct 2020 - tsp

This article describes a simple and working solution to automatically upgrade jenkins running on a local servlet container such as Apache Tomcat by using a simple POSIX compliant shellscript (working on Linux, Unices, etc.) as well as a simple Jenkins job itself.

A simple cookie banner implementation (JavaScript)

20 Dec 2020 - tsp

The most simple implementation of a cookie banner as long as the banner is only required with active JavaScript

A simple collapsible menu for mobile devices using only CSS

03 Jan 2021 - tsp

This blog post summarizes one of the methods that can be used with CSS3 adjacent sibling selectors or general sib

Automatic sitemap generation with Jekyll

14 Jan 2021 - tsp

A short summary on how to generate a sitemap for search engines automatically when using the Jekyll static site generator

How to extrude polygons in OpenJSCAD

02 Feb 2021 - tsp

Since I always have to lookup how this works in some examples or hidden deep in the manual I decided to write a short summary about linear extrude, rectangular extrude and rotate extrude

Simple webcam access from C

06 Feb 2021 - tsp

This blog post summarizes how one can access common webcams from C on operating systems supporting the video4linux (V4L) API. This information can be used to built robots, surveillance systems or simply communication applications.

Mobile user friendliness with code samples and Googles search console

05 Apr 2021 - tsp

A pretty short blog post about a small nuance that might lead to a huge hit in your search ranking when using static site generators that use nested pre and code tags and may trigger even more errors in case one doesn't use mobile first approach for one's stylesheets

ISC-DHCPD events triggering native hooks from within a chroot

15 May 2021 - tsp

Mini blog post that shows how I integrated DHCP events into my automation solution by pushing commit, release and expiry events into my message broker infrastructure

Short Kalman filter summary

19 May 2021 - tsp

A short summary about Kalman filtering

Mini note on robust serial communication with microcontrollers

04 Jun 2021 - tsp

Mini note on robust serial communication with microcontrollers (basically: use checksums and synchronization patterns)

OpenGL context creation without libraries using Xlib

13 Jun 2021 - tsp

A mini summary on how to do OpenGL context creation without using external utility libraries on X11 systems.

A less mathematical introduction to power iterations

03 Jul 2021 - tsp

This blog post is a little summary or introduction on how to calculate Eigenvalues and Eigenvectors using power iterations that tries to use a little less formal jargon to provide a short overview.

The analog digital converter (ADC) on the ATMega328p and ATMega2560

15 Jul 2021 - tsp

Mini summary about the ADC on the ATMega328p and ATMega2560

A simple system clock module for AVR

26 Jul 2021 - tsp

A description of a simple implementation of a system clock module for AVRs supporting delay, millis(), etc. This blog post tries to shed some light onto these simple and basic functions as well as some common pitfalls.

Adding Grafana annotations using HTTP API

28 Jul 2021 - tsp

Sometimes it's convenient to add annotations to Grafana dashboards and panels using Grafanas flexible HTTP API instead of writing them into a database and fetching them from there using Annotation queries. Since I lacked a complete example and it took me some minutes to find out how this works this blog post summarizes the process.

Gaussian random number generator using box-muller method

17 Aug 2021 - tsp

A short summary on how the box-mueller method works to generate normal distributed random numbers (for example for Monte-Carlo simulations, etc.)

avrdude: verification error, first mismatch at byte 0x0002

27 Aug 2021 - tsp

A common error - but the solution is easy to forget. And it's even harder when using the Arduino IDE

How to create your own Python packages

07 Oct 2021 - tsp

A mini introduction and summary on how to create own Python PyPi (pip) packages

The AD7705 dual channel analog digital converter with AVRs

07 Oct 2021 - tsp

Mini summary on how to use the AD7705 with Atmel AVRs

Writing daemons in python

09 Nov 2021 - tsp

Mini (really short) summary of one way as well as a recipe on how to write daemons in python

A short story of the migration process for The-Things-Network v2 to v3

13 Nov 2021 - tsp

This article is a mini summary of the steps that have been required to migrate from the v2 to the v3 stack of the things network, a community driven LoRA-WAN backend solution.

Rendering static two dimensional electric fields caused by point charges using Python

27 Nov 2021 - tsp

A mini summary on how one can use Python and matplotlib to calculate and render two dimensional static electric fields generated by point charges in infinitly sized space based on Coulombs law and the superposition principle.

QR decomposition using Givens rotations

08 Dec 2021 - tsp

Mini recipe and hopefully descriptive summary on how to perform QR decomposition using Givens rotations which forms the basis of many linear algebra numeric applications such as least squares, GMRES, etc.

Mini summary on how to solve linear equations in Krylov subspaces

A write up of the methods used to iteratively solve arbitrary linear equations systems. This includes the definition of Krylov subspace solvers, the Lanczos and Arnoldi algorithm to build orthogonal subspaces, a summary of the steepest descent and projective methods and then as an real world realization of projective methods the conjugate gradient (CG) and generalized minimal residual (GMRES) method.

PID control loop in a nutshell

22 Feb 2022 - tsp

Short dive into the basics of PID loops

Implementing a simple websocket server in Python

23 Apr 2022 - tsp

This is a simple short summary on how one can build a websocket server for use with ones JavaScript web application in Python using asyncio and websockets package

Dynamic imports in Python

01 May 2022 - tsp

A simple summary on how to dynamically load modules from files in Python similar to the dlopen/dldsym/dlclose semantics in C

Statistics on chat service online status

03 May 2022 - tsp

Playing around with scraping online status information from a social networks chat service and doing some statistical analysis

Controlling the Korad KA3005P using Python

15 Jul 2022 - tsp

A short summary on how to control the Korad KA3005P power supply using Python as well as some simple samples on how to use my own control library

The ID3 algorithm

09 Aug 2022 - tsp

A short summary on the inner workings of the Iterative Dichotomiser 3 (ID3) decision tree algorithm, a small Python playground implementation and application to one toy and two real world datasets out of the world of biology and medicine

Getting started with WSGI and Python as well as uwsgi application server

15 Jan 2023 - tsp

A simple summary of hat WSGI can do for one, how to use it with Python and how to run the uwsgi application server (and how to solve the deployment problem there) from the viewpoint of someone who already developed web applications in many different languages and frameworks.

The most simple Difference of Gaussian image pyramid with OpenCL

06 Aug 2023 - tsp

The following blog article summarizes a quick implementation of a Difference of Gaussian (DoG) pyramid as approximation of a Laplacian of a Gaussian pyramid. It does not utilize optimizations so performance (around 10ms for a simple 6 octave pyramid) is rather low.

Using the RaspberryPi GPIOs on FreeBSD

15 Oct 2023 - tsp

Mini summary and recipes to use the RaspberryPi GPIOs from FreeBSD

A mini recipe to fit arbitrary models to data using lmfit in Python

11 Jan 2024 - tsp

In this blog post, we navigate through an unorthodox yet effective method of building models using the lmfit library, a wrapper around scipy's fitting routines. The article dives into a hands-on approach for fitting noisy data with a custom-defined Gaussian model, while suggesting that the conventional wisdom of lmfit isn't the only path to success. The tutorial initializes by installing lmfit and swiftly moves to crafting a function for the Gaussian model, which involves defining an objective function to decipher the best parameters for data fit. It guides the reader through generating synthetic noisy data, plotting it for visual aid, and conducting the fitting process. Through this procedure, a parameters are constructed and optimized to fit our model to the noisy data, followed by a presentation of the fitting report. Finally, the results are visualized, and the article concludes by discussing the advantages of this method, especially when dealing with complex or iterative models. The full code for the exercise is accessible in a GitHub GIST, allowing readers to directly engage with the material covered.

Another quick glance on the OpenAI API to ChatGPT using function calling

03 Feb 2024 - tsp

This is a very short overview on how to use the tooling/function API of ChatGPT to call external functions to perform actions or retrieve some simple information. In addition a simple iterative problem solving process of GPTs is shown as an example in Python. It makes use of an external commercial API though.

A first quick look on different sentence embedding methods - playing with word and sentence embeddings

11 Feb 2024 - tsp

A quick overview on how one can generate word and sentence embeddings using BERT, mpnet and OpenAIs sentence embedding API in Python. The second part also includes a mini semantic search engine (with linear index that only serves demonstration purpose). This article does not offer and in depth explanation but only a quick overview glance on the APIs to play around.

Data protection policy

Dipl.-Ing. Thomas Spielauer, Wien (

This webpage is also available via TOR at http://rh6v563nt2dnxd5h2vhhqkudmyvjaevgiv77c62xflas52d5omtkxuid.onion/

Valid HTML 4.01 Strict Powered by FreeBSD IPv6 support