Skip to main content

a silhouette of a person's head and shoulders, used as a default avatar

Email Consolidation

I’ve got too many email addresses.

I have:

  • 2 for work
  • 1 alias for opensuse.org
  • 1 paid account with protonmail with 5 addresses shared in that account
  • 1 very old gmail account (I signed up the first day I heard about it).
  • 1 seznam account (Czech provider)
  • 1 installation of mail-in-a-box with 4 domains that I own but only one real account that I use
  • 1 librem.one account (this is a mistake and a disappointment)

The goal is to change all of the services, mailing lists, etc that I use to point to a single email account either directly or through aliases so that all of my email is in one place with the exception of my work email which should always stay separate. Also, to get people to only email me at the one account.

to be continued…

the avatar of Hans Petter Jansson

Chafa 1.2.0: Faster than ever, now with 75% more grit

For all you terminal graphics connoisseurs out there (there must be dozens of us!), I released Chafa 1.2.0 this weekend. Thanks to embedded copies of some parallel image scaling code and the quite excellent libnsgif, it's faster and better in every way. What's more, there are exciting new dithering knobs to further mangle refine your beautiful pictures. You can see what this stuff looks like in the gallery.

Included is also a Python program by Mo Zhou that uses k-means clustering to produce optimal glyph sets from training data. Neat!

Thanks to all the packagers, unsung heroes of the F/OSS world. Shoutouts go to Michael Vetter (openSUSE) and Guy Fleury Iteriteka (Guix) who got in touch with package info and installation instructions.

The full release notes are on GitHub.

What's next

I've been asked about sixel support and some kind of interactive mode. I think both are in the cards… In the meantime, here's a butterfly¹.

A very chafa butterfly

¹ Original via… Twitter? Tumblr? Imgur? Gfycat? I honestly can't remember.

the avatar of Bernhard M. Wiedemann

Debugging jenkins

We had strange near-daily outages of our internal busy jenkins for some weeks.

To get to the root cause of the issue, we enabled remote debugging with

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=ci.suse.de -Dcom.sun.management.jmxremote.password.file=/var/lib/jenkins/jmxremote.password

and attached visualvm to see what it was doing.
This showed the number of threads and memory usage in a sawtooth pattern. Every time the garbage collector ran, it dropped 500-1000 threads.

Today we noticed that every time it threw these java.lang.OutOfMemoryError: unable to create new native thread errors, the maximum number of threads was 2018… suspiciously close to 2048. Looking for the same time in journalctl showed
kernel: cgroup: fork rejected by pids controller in /system.slice/jenkins.service

So it was systemd refusing java’s request for a new thread and jenkins not handling that gracefully in all cases.
That was easily avoided with a
TasksMax=8192

Now the new peak was at 4890 live threads and jenkins served all Geekos happily ever after.

a silhouette of a person's head and shoulders, used as a default avatar

Adding timestamps to bash scripts with ts

I don’t know when I started writing a lot of bash scripts. It just seemed to happen over the last few years, possibly because bash is pretty much universally available, even on newly installed Linux systems.

Despite its benefits, one of the things I really hate about bash is logging. Rolling my own timestamps can be a real PITA, but they’re so useful that I can’t live without them (optimising software performance for a living gives you a rather unhealthy obsession with how long things take). Every script I write ends up using a different timestamp format because I just can’t seem to remember the date command I used last.

At least, that was the old me. The new me has discovered the perfect tool: ts from the moreutils package.

ts prepends a timestamp to each line it receives on stdin. Adding a timestamp in your log messages is a simple as:

$ echo bar | ts
Jul 28 22:27:51 bar

You can also specify a strftime(3) compatible format:

$ echo bar | ts "[%F %H:%M:%S]"
[2019-07-28 22:34:48] bar

But wait, there’s more! If a simple way to print timestamps wasn’t enough, ts can also parse existing timestamps in the input line (by feeding your ts-tagged logs back into ts) and preprend an additional timestamp with cumulative and relative times between consecutive lines.

This is fantastic for answering two questions:

  1. When was a log message printed relative to the start of the program? (-s)

  2. When was a log message printed relative to the previous line? (-i)

The -s option tells you how long it took to reach a certain point of your bash script. And the -i option helps you which parts of your script are taking the most time.

$ cat sleeper.sh && ./sleeper.sh 
#!/bin/bash
FMT="[%H:%M:%S]"
for i in 1 2 3; do
	echo "Step $i"
	sleep $((i*10))
done | ts $FMT | ts -s $FMT | ts -i "[+%s]" | awk '
BEGIN { print "Timestamp | Runtime | Delta";
	print "---------------------------" }

{
	# ts(1) only prepends. Rearrange the timestamps.

	printf "%s %s %s ", $3, $2, $1;

	for (i=4; i <= NF; i++) {
		printf "%s ", $i;
	}

	printf "\n";
}'
Timestamp | Runtime | Delta
---------------------------
[23:15:22] [00:00:00] [+0] Step 1 
[23:15:32] [00:00:10] [+10] Step 2 
[23:15:52] [00:00:30] [+20] Step 3 
$

Beat that, hand-rolled date timestamps.

the avatar of Hans Petter Jansson

desktop-file-utils 0.24 released

One thing one can do in this amazing summer heat, is cut the 0.24 release of desktop-file-utils. It's rather a small thing, but since the last few releases have been happening at roughly three-year intervals I felt it merited a quick post.

Changes since 0.23

desktop-file-validate

  • Allow desktop file spec version 1.2 (Severin Glöckner).
  • Add Budgie, Deepin, Enlightenment and Pantheon to list of registered desktop environments (fdo#10, fdo#11, fdo#16, oldfdo#97385) (Ikey Doherty, sensor.wen, Joonas Niilola, David Faure).

update-desktop-database

  • Sort output lines internally to conserve reproducibility (fdo#12) (Chris Lamb).
  • Use pledge(2) on OpenBSD to limit capabilities (fdo#13) (Jasper Lievisse Adriaanse).

Common

  • Fix missing ; when appending to a list not ending with one (oldfdo#97388) (Pascal Terjan).
  • Add font as valid media type (Matthias Clasen).
  • Fix broken emacs blocking compile (fdo#15) (Hans Petter Jansson, reported by John).

About

desktop-file-utils contains command line utilities for working with desktop entries:

  • desktop-file-validate: Validates a desktop file according to the desktop entry specification.
  • desktop-file-install: Installs a desktop file to the applications directory after applying optional modifications.
  • update-desktop-database: Updates the database containing a cache of MIME types handled by desktop files.

Thanks to everyone who contributed to this release! And an extra big thanks to Daniel Stone for his patient freedesktop.org support.

the avatar of Federico Mena-Quintero

Constructors

Have you ever had these annoyances with GObject-style constructors?

  • From a constructor, calling a method on a partially-constructed object is dangerous.

  • A constructor needs to set up "not quite initialized" values in the instance struct until a construct-time property is set.

  • You actually need to override GObjectClass::constructed (or was it ::constructor?) to take care of construct-only properties which need to be considered together, not individually.

  • Constructors can't report an error, unless you derive from GInitable, which is not in gobject, but in gio instead. (Also, why does that force the constructor to take a GCancellable...?)

  • You need more than one constructor, but that needs to be done with helper functions.

This article, Perils of Constructors, explains all of these problems very well. It is not centered on GObject, but rather on constructors in object-oriented languages in general.

(Spoiler: Rust does not have constructors or partially-initialized structs, so these problems don't really exist there.)

(Addendum: that makes it somewhat awkward to convert GObject code in C to Rust, but librsvg was able to solve it nicely with <buzzword>the typestate pattern</buzzword>.)

the avatar of Nathan Wolf

Back In Time for Data Backups on openSUSE | Retrospective

The lack of data security is something that has recently affected some municipal governments in a negative way. Atlanta in 2018 was attacked with a ransomware and demanded $51,000 before they would unlock it. Baltimore was hit a second time this past May [2019]. I am not a security expert but in my non-expert opinion, … Continue reading Back In Time for Data Backups on openSUSE | Retrospective

the avatar of Nathan Wolf

Bodhi Linux 5.0 | Review from an openSUSE User

Linux is a fun thing and trying out other distributions can result in a myriad of experiences. Some distributions concentrate on user experience or mostly the technical underpinnings. Some distributions put their own feel while others minimize their modifications. I am a long time openSUSE user and am perfectly content with all that it has … Continue reading Bodhi Linux 5.0 | Review from an openSUSE User
the avatar of Sebastian Kügler

Desk lamp

desk lamp with mirror behind
desk lamp with mirror behind

Some time ago, I wanted to make my own desk lamp. It should provide soft, bright task lighting above my desk, no sharp shadows that could cover part of my work area, but also some atmospheric lighting around the desk in my basement office. The lamp should have a natural look around it, but since I made it myself, I also didn’t mind exposing some of its internals.

desklamp-ledstrips
SMD5050 LED strips

I had oak floor boards that I got from a friend (thanks, Wendy!) lying around. which I used as base material for the lamp. I combined these with some RGBW led strips that I had lying around, and a wireless controller that would allow me to connect the lamp to my Philips Hue lighting system, that I use throughout the house to control the lights. I sanded the wood until it was completely smooth, and then gave it an oild finish to make it durable and give it a more pronounced texture.

Fixed to the ceiling
Fixed to the ceiling
Internals of the desk lamp
Internals of the desk lamp

The center board is covered in 0.5mm aluminium sheets to dissipate heat from the LED strips (again, making them last longer) and provide some extra diffusion of the light. This material is easy to work with, and also very suitable to stick the led strips to. For the light itself, I used SMD5050 LED strips that can produce warm and cold white light, as well as RGB colors. I put 3 rows of strips next to each other to provide enough light. The strips wrap around at the top, so light is not just shining down on my desk, but also reflecting from walls and ceiling around it. The front and back are another piece of wood to avoid looking directly into the LEDs, which would be distractive, annoying when working and also quite ugly. I attached a front and back board as well to the lamp, making it into an H shape.

Light reflects nicely from surrounding surfaces
Light reflects nicely from surrounding surfaces

The controller (a Gledopto Z-Wave controller, that is compatible with Philips Hue) is attached to the center board as well, so I just needed to run 2 12V wires to the lamp. I was being a bit creative here, and thought “why not use the power cables also to have the lamp hanging from the ceiling?”. I used coated steel wire, which I stripped here and there to have power run through steel hooks screwed into the ceiling to supply the lamp with power while also being able to adjust its height. This ended up creating a rather clean look for the whole lamp and really brought the whole thing together.

the avatar of Nathan Wolf

Wavebox | Chat Unification Snap Application on openSUSE Tumbleweed

From time to time, I like to play around with the universal packaging available in Linux. It has mostly been AppImages and Flatpak but I wanted to Snap something into my system. After working out an AppArmor issue. Snaps were working fantastically well once again. The application I wanted to try was another Chat Message … Continue reading Wavebox | Chat Unification Snap Application on openSUSE Tumbleweed