Journal
bsda2: pkg_validate Performance Tweaks
I am currently updating the bsda2 code for pkg_validate
with
LST.sh, this adds some overhead (however small) and to counter
that I decided to try tweak the performance a little.
Two approaches have shown benefits.
bsda2: Presenting LST.sh - A Portable Shell Array Library
Unlike the Bourne-Again Shell, the FreeBSD Almquist Shell does not have native array support. So for bsda2 I have largely resolved to storing data in strings, using the Line Feed character as a separator. Over time I have established best practices for working with these strings, which some time last year I decided to put into a small library - LST.sh. And like any small project its exploded in my face …
bsda2: 0.3.0 Release, the Return of pkg_validate
The 0.3.0 release of bsda2 reintroduces the pkg_validate
command, providing the same functionality as running
pkg check -s
(see [pkg-check(8)
]). The first BSD Administration
Scripts collection provided pkg_validate
, because at the time this
functionality was missing. With bsda2 this was considered obsolete,
but given the current state of multi core computing and fast SSDs
there is an opportunity for significant performance gains.
Embedded C++: Singletons
I develop C++ code for embedded devices, my work recently inspired me to start what hopefully will become an embedded C++ miniseries.
C++: Sane Shift Operators
Bitwise shift operators in C++ are wrought with perils. Undefined behaviour awaits those shifting negative integers or shifting too far, shifting by a negative number is implementation defined, which means the compiler cannot just pretend it didn’t happen or format your hard drive, but you still don’t have any guarantees about what exactly you get.
bsda:obj: Object Oriented Programming Dos and Don'ts
Once upon a time I wrote an OOP framework for shell scripts and in
2010 I even presented it at EuroBSDCon. Originally I was
going to use bsda:obj, the OOP shell scripting framework, to rewrite
the bsdadminscripts
. By now they have been rotting, mostly long
obsolete and abandoned, on sourceforge.
However a couple of the tools therein remain popular, which finally
got me to recode and release them. Post-release I’ve
started cleaning up bsda:obj
so I would like to share a couple of
lessons I’ve learned and applied over the years.
Type Decay, Bruce Dawson's Blog and a Mistake
This post is about why you should read Bruce Dawson’s blog, how an error crept into my last article and what the two have to do with each other.
C++: printf Style Formatting
The native way of formatting an std::string
using the C++ standard
library is creating an std::ostringstream
and streaming the formatting
flags and data into it. This can lead to surprisingly elegant solutions,
but often it is rather clunky.
For theses cases this article describes a simple abstraction for
snprintf(3)
, lifting it from an archaic C interface to something
that looks and feels like proper C++.
A Tags Page for Jekyll
The jekyll site generator used for this blog as part of the GitHub Pages hosting service offers a simple tagging mechanism. What it does not offer is generating tag pages that show all the content with a specified tag.
FSAE: Securing Sponsoring for Your Team
This post was triggered by a question in the LinkedIn FSAE group. After writing 5 posts in response (due to the comment length limitaitons) I finally concluded that this topic is worth some blog space. This has been written for Formula Student Automotive Engineering teams, but a lot of it is applicable to anyone trying to secure sponsoring for something.
powerd++: Even Better After EuroBSDcon
To create my slides for EuroBSDcon 2016, I produced a number
of graphs to illustrate the positive effects of using a low pass
filter to mitigate the noise problem powerd
is so suceptible to.
Load recording and replay were the critical tools I developed
to show this. A side effect of being able to perform load replays
was the ability to create and test arbitrary loads.
The C++ Standard Requires Proprietary Language Extensions
The C++
standard consists of two parts. The language and the library.
The latter is built upon the first, or so I thought.
Building a Cross Device Site
This isn’t the fanciest website you have or will ever have seen. But it’s a far cry from Fefes Blog and still loads fast and renders reasonably on all devices I could get my hands on. This is not an accident and I’d like to explain the how and why of it.
powerd++: Better CPU Clock Control for FreeBSD
Setting of P-States (power states a.k.a. steppings) on FreeBSD is
managed by powerd(8)
. It has been with us since 2005, a time when
the Pentium-M single-core architecture was the cutting edge choice
for notebooks and dual-core just made its way to the desktop.
/bin/sh: Writing Your Own watch Command
The command watch
in FreeBSD has a completely different function
than the popular GNU-command with the same name. Since I find the
GNU-watch
convenient I wrote a short shell-script to provide that
functionality for my systems. The script is a nice way to show off
some basics as well as some advanced shell-scripting features.
/bin/sh: Using Named Pipes to Talk to Your Main Process
You want to fork off a couple of subshells and have them talk back to your main Process? Then this post is for you.
Another day in my love affair with AWK
I consider myself a C/C++ developer. Right now I am embracing C++11 (I wanted to wait till it is actually well supported by compilers) and I am loving it.
AWK Reloaded
Last year I
compared the performance of 3 AWK interpreters,
NAWK, GAWK and MAWK. For the test I used 3 of my .awk
scripts (available
under Beerware). But the data I processed with them was confidential.
Any way, NAWK won 1/3, MAWK 2/3 (with astonishing leads), GAWK was
the clear looser with abysmal performance in 2/3 tests.
geli suspend/resume with Full Disk Encryption
This article details my solution of the geli resume
deadlock. It
is the result of much fiddling and locking myself out of the file
system.
Legacy Jails on a FreeBSD 10 Tinderbox
It has become customary to me to build libreoffice packages, whenever an update is available in the ports tree. The packages are published on the BSDForen.de Wiki. Recently I updated the Tinderbox host system to FreeBSD 10.
AWK Text Processing Speed
My default brand of AWK is the One-True-AWK also known as NAWK, coming with FreeBSD. For portability I have started supporting GNU AWK (henceforth GAWK). Because I work with people using Ubuntu, MAWK also made it into my list recently.