Artikel in Kategorie "Programmierung"

I18n of Bourne Shell Scripts Using „gettext.sh“

This article shows how to make a Bourne Shell script translatable by means of the „gettext“ toolchain and how it then operates with natural language strings translated into the user’s language.

„jack-autostart“ – Setup and Start Scripts for jackd

„jack-autostart“ is essentially a start script (I use it for my XFCE sessions) that starts „jackd“ with appropriate command line parameters and configures as many applications as possible to route playback to the JACK service. For this purpose, redirect all ALSA playback to JACK, and set JACK as default audiosink/-source for GStreamer.

Adding Custom Format Buttons To tinyMCE in WordPress 4

Introduction In my technical articles I sometimes use inline fragments typed in a monospace font to highlight code or filenames that appear within floating paragraph text. Back in the days I did this with the <tt> element, nowadays I use <span class=“tt“> and a CSS style like .tt { font-family: monospace; } I wanted to […]

PHP HTTPS Streams: Explicitly Using A CA For Verification

When I tried setting my Owncloud Calendar’s ICS export URL (which uses HTTPS) as a calendar import URL in Dolibarr (currently installed are Owncloud 8.0 and Dolibarr from the version 3.6.2-3 Debian package), Dolibarr gave me these errors (taken from the error.log of the webserver, with some additional formatting): PHP Warning: file(): SSL operation failed […]

Determining The Playtime In Seconds from an OGG Vorbis File

Problem To determine the runtime in integer seconds (not including a fractional amount) of a given audio file in format OGG-Vorbis. This value is required, for example, in the EXTM3U syntax. Solution 1. Install package vorbis-tools 2. Define this shell function: ogglength() { LANG=C ogginfo „$1“ | perl -ne ‚ BEGIN { $rv = 1; […]

Support For Multiple Languages in WordPress

Introduction Foreign visitors have pointed out to me that they sometimes read my blog using translation functions in their their webbrowsing software, most notably „Google Translate“ which is directly built into Google Chrome. That translation function does a good job, but sometimes produces oddities, for example it attempts to translate my lastname, which is also […]

Utility to Generate Waveform JPG from CBR MP3

„waveform“ is a commandline utility for GNU/Linux, written in C, that takes a constant-bitrate (CBR) encoded MP3 file as input and generates waveform diagrams like this:

Using VIm’s „:v“ to Delete All Lines NOT Containing a Pattern

Addendum to my previous post „Using VIm’s „Negative Lookahead“ to Delete All Lines NOT Containing a Pattern„ I received a message from a reader who goes by the name of „bw1“ who points out that my task „to delete all lines in the current file not containing the string foo“ can easily be accomplished by […]