<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Basti's Buggy Blog</title><link>https://blog.hiebl.cc/</link><description>Recent content on Basti's Buggy Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>Copyright &amp;copy; 2020</copyright><lastBuildDate>Sat, 31 Dec 2022 00:00:00 +0100</lastBuildDate><atom:link href="https://blog.hiebl.cc/index.xml" rel="self" type="application/rss+xml"/><item><title>Practical Type Punning in C++11 and higher</title><link>https://blog.hiebl.cc/posts/practical-type-punning-in-cpp/</link><pubDate>Sat, 31 Dec 2022 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/practical-type-punning-in-cpp/</guid><description>&lt;p>Type punning (treating an object as if it were another one) is common in C++ code bases, yet most of the time it &lt;em>technically&lt;/em> is undefined behavior.
Typically it is used when reinterpreting bytes received from a network socket as a POD-struct.
This article tries to answer two questions: &lt;em>&lt;strong>Why should I not use &lt;code>reinterpret_cast&lt;/code>?&lt;/strong>&lt;/em> and &lt;em>&lt;strong>What to use instead?&lt;/strong>&lt;/em>
It is heavily inspired by &lt;a href="https://www.youtube.com/watch?v=_qzMpk-22cc">Timur Doumler&amp;rsquo;s talk at CppCon 2019&lt;/a>.&lt;/p></description></item><item><title>Setting up Docker in Docker (dind/socket) with GitLab Runners</title><link>https://blog.hiebl.cc/posts/gitlab-runner-docker-in-docker/</link><pubDate>Thu, 02 Jun 2022 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/gitlab-runner-docker-in-docker/</guid><description>&lt;p>GitLab&amp;rsquo;s Continuos Integration / Delivery (CI/CD) workflow utilizes &lt;em>GitLab Runners&lt;/em> which can be registered with the GitLab instance to execute individual CI/CD jobs.
Depending on the Runner configuration, the jobs are executed in a different environment.
Whereas in the &lt;em>Shell&lt;/em> Runner commands are executed directly on the runner host, the &lt;em>Docker&lt;/em> Runner spawns a new Docker container for each job.
This post describes &lt;strong>how to setup a &lt;em>Docker&lt;/em> Runner that is able to build and run Docker images with bind-mounts&lt;/strong>.&lt;/p></description></item><item><title>The Curious Case of the Impossible Checksum</title><link>https://blog.hiebl.cc/posts/impossible-checksum/</link><pubDate>Sun, 30 Jan 2022 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/impossible-checksum/</guid><description>&lt;p>Naturally, as a software developer being confronted with less-than-optimal software, the threshold for annoyance-caused re-implementation of proprietary apps is quite low.
In this particular instance I wanted to use my phone to control the resistance of my stationary exercise bike (&lt;a href="https://web.archive.org/web/20220125194700/https://www.kettlerusa.com/fitness/exercise-bikes/23677">Kettler Racer S&lt;/a>).
Proprietary Android apps can be used to automatically regulate the resistance of the trainer via Bluetooth according to an exercise plan you pick.
To quote GitHub user &amp;ldquo;kaegi&amp;rdquo;, the usability of aforementioned apps ranges from &lt;a href="https://github.com/kaegi/kdri/issues/2#issuecomment-276795476">&amp;ldquo;bad-user experience&amp;rdquo; to &amp;ldquo;non-functional&amp;rdquo;&lt;/a>.
I decided to take matters into my own hands and implemented the Bluetooth protocol for controlling the trainer, causing me to uncover a surprisingly stupid implementation bug in the firmware.&lt;/p></description></item><item><title>Why Your Samba Configuration Does Not Work</title><link>https://blog.hiebl.cc/posts/why-your-samba-config-does-not-work/</link><pubDate>Fri, 22 Oct 2021 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/why-your-samba-config-does-not-work/</guid><description>&lt;p>Bending the Samba/smbd configuration to enable file sharing between Linux-Linux or Linux-Windows desktop has always been a personal pain point of mine.
Unsurprisingly few other topics on Linux desktop are being discussed so frequently among Linux desktop enthusiasts.
Most users end up with a patchwork of smbd configuration options, leaving them with a dysfunctional and insecure system.
This post intends to provide an overview of a basic smbd configuration that is compatible with Windows 10 systems.&lt;/p></description></item><item><title>urxvt and Emacs - The Ultimate Guide</title><link>https://blog.hiebl.cc/posts/urxvt-and-emacs-ultimate-guide/</link><pubDate>Tue, 03 Aug 2021 01:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/urxvt-and-emacs-ultimate-guide/</guid><description>&lt;p>One of the major advantages of Emacs is that in addition to working on graphical interfaces, it can be used from a terminal as well.
However, some features (such as many keybindings) are not available when using Emacs in terminals, due to ancient protocol limitations.
This post shows how to make the most of Emacs on a terminal (urxvt).&lt;/p></description></item><item><title>Don't Trust Java's Method Overloads</title><link>https://blog.hiebl.cc/posts/do-not-trust-javas-overloads/</link><pubDate>Sun, 16 May 2021 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/do-not-trust-javas-overloads/</guid><description>&lt;p>Whatever your opinion on inheritance vs composition is, I am confident you agree that unexpected behavior not desirable and the &lt;a href="https://en.wikipedia.org/wiki/Principle_of_least_astonishment">Principle of least astonishment&lt;/a> should not be violated.
The otherwise very verbose and honest programming language Java however managed to fool me with an innocent looking method overload.&lt;/p></description></item><item><title>When to Use C++17 std::string_view?</title><link>https://blog.hiebl.cc/posts/how-to-use-std-string-view/</link><pubDate>Sun, 27 Dec 2020 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/how-to-use-std-string-view/</guid><description>&lt;p>C++17 brings &lt;a href="https://en.cppreference.com/w/cpp/17">many new fancy things&lt;/a>, many of which significantly improve the readability and expressiveness of code (&lt;code>if constexpr&lt;/code>, &lt;code>std::optional&lt;/code>).
However, there are features like &lt;code>std::string_view&lt;/code>, which can be footguns in disguise.
This article gives a short overview over the possible (mis-)uses of this &amp;ldquo;new&amp;rdquo; class.&lt;/p></description></item><item><title>Quick and Beautiful Figures in LaTeX without TikZ</title><link>https://blog.hiebl.cc/posts/quick-beautiful-figures-latex-without-tikz/</link><pubDate>Sat, 05 Dec 2020 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/quick-beautiful-figures-latex-without-tikz/</guid><description>&lt;p>TikZ figures in LaTeX documents offer precise control over graphic output, while allowing for a consistent look-and-feel.
But especially for figures which require a lot of manual positioning, programmatically creating TikZ figures can be a tedious task.
If you do not require publishing-quality graphics (although I have seen worse pictures there), this workflow might be suitable for you.&lt;/p></description></item><item><title>Reverse Engineering OruxMaps' Preference Encryption - Part 2</title><link>https://blog.hiebl.cc/posts/reverse-engineering-oruxmaps-encryption-2/</link><pubDate>Sat, 26 Sep 2020 01:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/reverse-engineering-oruxmaps-encryption-2/</guid><description>&lt;p>In &lt;a href="https://blog.hiebl.cc/posts/reverse-engineering-oruxmaps-encryption-1">part 1&lt;/a> we covered how to identify an encrypted file and how to look for an entry point for reverse engineering.
In this part we will look at the Android app itself and try to develop a tool for encrypting and decrypting files.&lt;/p></description></item><item><title>Reverse Engineering OruxMaps' Preference Encryption - Part 1</title><link>https://blog.hiebl.cc/posts/reverse-engineering-oruxmaps-encryption-1/</link><pubDate>Sat, 26 Sep 2020 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/reverse-engineering-oruxmaps-encryption-1/</guid><description>&lt;p>I&amp;rsquo;m an avid user of the Android app &lt;a href="https://www.oruxmaps.com/cs/en/">OruxMaps&lt;/a>.
I use it to navigate on pre-made tracks while cycling.
It is able to show directions, altitude diagrams, live-track other people and much more!
Sadly it isn&amp;rsquo;t open source and has some &amp;mdash; in my opinion &amp;mdash; anti-features.
Let&amp;rsquo;s see if we can do something about those.&lt;/p></description></item><item><title>Citrix: Opening Skype Causes Mouse Freeze</title><link>https://blog.hiebl.cc/posts/skype-via-citrix-workspace-causes-usb-bus-freeze/</link><pubDate>Wed, 08 Jul 2020 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/skype-via-citrix-workspace-causes-usb-bus-freeze/</guid><description>&lt;p>Every once in a while I encounter a bug which is annoying, but not annoying enough for me to put effort into solving it.
But when \( frequency \times annoyance \times time \) reaches a critical threshold, I always feel tempted to at least have a shot at solving the underlying issue.&lt;/p></description></item><item><title>Finding Corrupt Files on a Raspberry SD-Card</title><link>https://blog.hiebl.cc/posts/find-corrupt-files-raspberry-sd-card/</link><pubDate>Sun, 05 Jul 2020 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/find-corrupt-files-raspberry-sd-card/</guid><description>Every second &amp;mdash; somewhere &amp;mdash; a SD-Card in a Raspberry Pi dies.1 In my experience SD-Cards fail after about 2 years of heavy usage (constant database writes). At first, you might not notice the symptoms as non-essential files could be corrupted. The corruption becomes apparent when binaries or shared libraries become corrupted, as this can impact the system behavior.</description></item><item><title>Wemos D1 Mini Pro Digital Interrupt Pins</title><link>https://blog.hiebl.cc/posts/wemos-d1-mini-pro-digital-interrupt-pins/</link><pubDate>Mon, 08 Jun 2020 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/wemos-d1-mini-pro-digital-interrupt-pins/</guid><description>I was observing weird behavior when trying to handle interrupts from certain pins on a WEMOS D1 mini Pro.
Goal Register ISRs for rising and falling edges on as many pins as possible Keep a stable system Keep I²C functionality TL;DR The pins D5, D6, D7 work without restrictions D3 and D4 work, but can not be low on boot, otherwise the WEMOS freezes12 D1 and D2 are used for I²C by default3, not changed for compability D04 and D85 have no support for interrupts Implementation ICACHE_RAM_ATTR void my_isr(){ /* .</description></item><item><title>Extracting Thunderbird Unread Emails Count</title><link>https://blog.hiebl.cc/posts/extracting-thunderbird-unread-count/</link><pubDate>Fri, 01 May 2020 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/extracting-thunderbird-unread-count/</guid><description>I wanted to display my unread email count in my i3bar.
I use Thunderbird as mail client I don&amp;rsquo;t want my i3bar to query some IMAP servers Thunderbird Persistence Thunderbird stores all its configuration in ~/.thunderbird in different files. The folder &amp;lt;profile name&amp;gt;/ImapMail contains non-binary *.msf files The header of the files conveniently contains a description of the values // &amp;lt;!</description></item><item><title>My Experience with systemd-homed</title><link>https://blog.hiebl.cc/posts/my-experience-with-systemd-homed/</link><pubDate>Wed, 29 Apr 2020 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/my-experience-with-systemd-homed/</guid><description>I read about systemd-homed and I found the concept behind it interesting. There was no personal need for it, but I wanted to try it out.
The points that peaked my interest:
Portable home directory? Meh Encrypted home directory locked during sleep? Sounds good! Setup systemctl enable systemd-homed.</description></item><item><title>Comfortable Screen Recording</title><link>https://blog.hiebl.cc/posts/comfortable-screen-recording/</link><pubDate>Sun, 19 Apr 2020 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/comfortable-screen-recording/</guid><description>All-in-one screen recording solutions always lacked some configuration option:
OBS: Awkward selection of area to record, output size has to be changed every time ffmpeg: Area to record has to be passed as a string Others: Ancient output formats, missing quality configurations I just replaced simple screen recording tasks with a combination of these tools:</description></item><item><title>How To Write Unmaintainable Makefiles - Part 1</title><link>https://blog.hiebl.cc/posts/how-to-write-unmaintainable-makefiles-1/</link><pubDate>Sat, 18 Apr 2020 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/how-to-write-unmaintainable-makefiles-1/</guid><description>Makefiles can be really useful outside the context of building plain old C/C++ applications. The built-in dependency management makes it possible to avoid a lot of boilerplate bash code when writing some build scripts. They also provide quite sophisticated ways to implement abstractions and logic, which often makes the files hard to read.</description></item><item><title>Read and Write SPI Flash on a ESP8266 based board</title><link>https://blog.hiebl.cc/posts/esp8266-modify-flash/</link><pubDate>Thu, 26 Dec 2019 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/esp8266-modify-flash/</guid><description>I found myself in the situation of having a proprietary firmware for an ESP8266 based chip (Wemos D1 mini pro) which was unable to escape special characters in the configuration web interface. When trying to set the local WiFi password &amp;mdash; containing some special characters &amp;mdash; the firmware would not accept the input.</description></item><item><title>Using Multiple Node Versions Without nvm</title><link>https://blog.hiebl.cc/posts/multiple-node-versions-without-nvm/</link><pubDate>Fri, 13 Dec 2019 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/multiple-node-versions-without-nvm/</guid><description>Managing projects on different versions of node can be a bit annoying. Some Linux distributions ship ancient node versions that have never even heard of big arrow functions.
Table of Contents Node Version Manager (nvm) The prettier alternative TODO Linux signal handling TL;DR Node Version Manager (nvm) Some years ago I tried the &amp;ldquo;Node Version Manager&amp;rdquo; nvm &amp;mdash; a shell script that downloads and installs node versions on demand.</description></item><item><title>Bundling Dynamic Dependencies in Webpack</title><link>https://blog.hiebl.cc/posts/bundling-dynamic-dependencies-webpack/</link><pubDate>Thu, 12 Dec 2019 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/bundling-dynamic-dependencies-webpack/</guid><description>Webpack is the de-facto solution for combating the ugly mess that people like to call the web.
Building modern web applications (not to be confused with websites1) sometimes feels like trying to get your Python code running on a BASIC interpreter.
The Problem Some (thirdparty) code requires other files with expressions that cannot be resolved by webpack at compile-time.</description></item><item><title>Motivation for this Blog</title><link>https://blog.hiebl.cc/posts/blog-motivation/</link><pubDate>Tue, 10 Dec 2019 00:00:00 +0100</pubDate><guid>https://blog.hiebl.cc/posts/blog-motivation/</guid><description>It&amp;rsquo;s not complicated to explain why I started this pile of loosely connected articles. Up until now, my workflow of learning new things was as follows:
Find a new Idea by… …reading something interesting …encountering a unique problem Attempt to find a solution based on the stuff I already know Read as much as it requires me to realize my self-set task, create a minimal working example (MWE) [Optional] Create a more elaborate project to see how useful the idea is Acquire deeper technical knowledge by reading articles and sometimes even books based on the obstacles I hit on when trying to solve the problem Now, there is nothing wrong with the approach described above, but one can&amp;rsquo;t help but notice that the last step isn&amp;rsquo;t really connected to anything.</description></item></channel></rss>