Auf den Spuren römischer Infrastruktur

Ein Besuch auf einem römischen Bauernhof

Die Tage habe ich die „Villa Rustica“, also den römischen Gutshof im Wiesenbacher Forst „Herrenwald“ besucht. Es handelte sich um einen landwirtschaftlichen Betrieb römischer Zeit mit Ackerbau und Viehzucht aus der Zeit von 130 bis nicht später als 260 n. Chr.

Lesen Sie mehr »

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 issuing this command

:v/foo/d

🙂 I should read the VIm documentation once in a while!

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.

Lesen Sie mehr »

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.

Lesen Sie mehr »

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).

Lesen Sie mehr »