Text-Console Barchart of Storage Utilization

Written as a Bourne Shell-Script that invokes a Perl one-liner:

LC_ALL=C df -kPT | perl -ane '!/(^Filesystem|tmpfs)/ && do {
   printf("%-33s: %s\n", $F[0], "*" x int((`tput cols`-35) * $F[3] / $F[2]))
}'

 

Using VIm’s „Negative Lookahead“ to Delete All Lines NOT Containing a Pattern

UPDATE:

Please note that „bw1“ has notified me of a much simpler solution than what is described here; please see

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

Some statements have been struck through in the article below because they are false.

I want to delete all lines in the current file not containing the string foo:

:g/^.*?\@!foo/d

Explanation: Using the global command g („act on range or entire file“) like :g/pattern/d applies the command d („delete line“) to any line in the current file that matches pattern.

Since VIm generally does not support inverting RegExps (for example like sed does with the modifier !), I employ the „negative lookahead operator“ @! (that has to be escaped \@!) of VIm-RegExp-syntax.

Since, in VIm RegExp syntax, look-ahead must follow something (why? I don’t know) I precede it with ^.*, but this is not enough, since it renders the obscure error E62: Nested \@ (why? I don’t know).

But it works if I make the preceeding term optional using the ? modifier. It’s a horribly inefficient RegExp, but it’s shortest to write (which is what VI-commands are all about).

And now you know that, too. 😀

P.S.: If you know a shorter version let me know –  FYI, I already know

:%!sed /foo/\!d

and it does not count – VIm onboard stuff only! 😉

Update: YouTube “Userstyle”

I have updated my YouTube Userstyle to the latest names they have given to their BS.

You can visit the style’s entry at userstyles.org for review and installation:

See also: Original announcement (20 Nov 2013).

Web-MP3-Player with HTML5, Flash and Playlist Support

About

This project provides a JavaScript constructor MyPlayer({...options...}) that can be used to embed lists of audio files as read from an index document or an M3U into a web document.

They will be displayed in a playback GUI with a playlist that can optionally be filled from the „title“ and „artist“ values of the files‘ ID3 tags (v1 and v2 are supported).

The player is „detachable“, meaning the user can open it in a new window, preventing that playback breaks when the user leaves the page.

Download

You can read my commentary about this release below.

Weiterlesen … »

WordPress: Eigene Übersetzungen in Thematic-Child-Themes

Ich habe einige deutschsprachige Textbausteine in meinem Thematic-Child-Theme „linuxfoo“ angepasst. Dazu benutze ich eine Datei mit eigenen Übersetzungen auf Basis der „de_DE.po“ in „Thematic“ selbst und übersetze diese mit dem Gettext-Werkzeug „msgfmt“. Das Verfahren wird nachfolgend im Einzelnen beschrieben.

Weiterlesen … »

Self-Hosted Webfonts: Origin Considerations

Regarding my previous article, „Self-Hosted Webfonts„, various sources such as [1] suggest that additional measures should be taken so that unrelated web presences can not utilize the hosted fonts by simply referencing them on their own pages (thus „borrowing“ traffic by using a font file that someone else hosts).

Weiterlesen … »

Self-hosted Webfonts: An Example

For aesthetic reasons, because I consider support widespread enough and also as an exercise I have integrated several webfonts with the new appearance of this website. I think it looks OK, and it works OK in modern browsers.

Weiterlesen … »

Ich weiss, Blau nimmt man nur …

… wenn einem nichts anderes einfällt, aber ich muss dazusagen, Blau ist wirklich eine meiner Lieblingsfarben! Als ich merkte, wie blau die Seite wird, war es schon zu spät, ich hatte mich schon zu weit darauf eingelassen (mit einem blauen Planeten im Hintergrund u.a.). Da habe ich es durchgehalten. Es hat ja auch was Elegantes so.

In diesem Sinne hoffe ich, dass alle das neue Webdesign genießen! 🙂