More Weblog Features

There wasn't much publishing going on here since I switched from Drupal to python-based Kukkaisvoima. On one hand that was because of a new job situation. Just didn't have the time to write alot. On the other hand I still wasn't satisfied by the security (anti-spam) mechanisms offered by the minimalistic software. So, during the holidays I started enhancing this thing a little with a sweet anti-spam mechanism based on respectively mimetex (I hope you like math! :)).
Today I finished the second feature which you can see on the right: the microblog badge. It fetches my identi.ca statuses via status.net api using the command line microblogging client pyTwerp written in Python. Since it is developed for output to stdout no HTML is generated. Hence no hyperlinks to users, tags, groups and other locations are formatted. So, I had to refresh my regular expression skills to make the hyperlinks show up. To integrate the script into the blog layout I used the example code snippet of Michael Gangolf's PHP-based laconi.ca badge. Two into one... badge done!
I guess from now on there aren't any more serious reasons to excuse the low frequent blog post situation here... poor me!

Kategorien: Software, Weblog
Datum: 2010-01-09 19:51:57

Suchen und Ersetzen mit sed

Ich bin kein Freund von emacs, vi und eierlegenden Wollmilchsau'ditoren dieser Art. Zweifellos - sie können wahrscheinlich alles! Auch das, was ich nun aber mit einem kleinen Bash-Skript realisiert habe.
Nachdem ich auf mein neues python-befeuertes Blog umgestiegen bin, schreibe ich meine Blogartikel im Texteditor. Da ich die automatische Umwandlung von z.B. Umlauten in HTML-Entities nur von WYSIWYG-HTML-Editoren kenne und diese nicht ausstehen kann, hab ich nach einer Lösung gesucht, sämtliche Umlaute in einem Rutsch ersetzen zu lassen. Per Suchen-/Ersetzen-Befehl des Editors muß dies für jede Art Umlaut separat ausgeführt werden, was ziemlich nervig ist.
Doch unixoide Betriebssysteme bieten mit dem Streameditor sed ein mächtiges Tool, um Text-Ströme automatisch zu manipulieren. So schreibe ich meine Texte wie gewohnt mit Umlauten und setze danach folgendes Bash-Skript auf die Textdatei an:
 #!/bin/bash
for item in $*
do
   cp $item $item.bak
   sed -f ~/scripts/sedfile $item.bak > $item
   rm $item.bak
done
Wobei das sedfile folgende regulären Ausdrücke beinhaltet:
 s/ä/\ä/g
s/ö/\ö/g
s/ü/\ü/g
s/Ä/\Ä/g
s/Ö/\Ö/g
s/Ü/\Ü/g
s/ß/\ß/g
Man beachte, dass die &'s mit Backslashes "escaped" sind. Das kaufmännische Und hat für sed normalerweise eine Steuerfunktion. Ohne Backslash geht's schief. Der Umweg über eine Kopie der zu bearbeitenden Textdatei ist übrigens notwendig, da die direkte Variante eine leere Datei zur Folge hätte.
Als htmlentities.sh abgespeichert kommt das Skript, wer hätt's gedacht, folgendermaß zur Anwendung:
./htmlentities.sh textdatei.txt

Kategorien: Software
Datum: 2009-10-03 03:24:02

Transfer EXIF Data

To present pictures in my photoblog I sometimes just cut a certain section out of the original picture. In detail it means that I create a completely new picture with a different size using The GIMP. The bad thing: EXIF data isn't copied doing that kind of manipulation (of course!).
Since I'm really interested in the camera settings people used to take certain pictures I definetly wanna have a look at the EXIF data. To transfer this data from the original picture to the newly created one GIMP doesn't offer the needed functionality. But there's hope - it's called jhead, an EXIF jpeg header manipulation tool which is available for all popular platforms like Linux, FreeBSD, OS X and Windows. The debian repositories offer a package as well.
To transfer the EXIF data this simple command line does the job:
jhead -te ORIGINAL.JPG COPY.JPG
There's even a special command for batch operations. This would be
jhead -te originals/&i *.JPG
where the parameter &i substitutes the original filename for this name.
Of course this operation invalidates the EXIF size values of the picture but that's not the point in most cases anyway.

Datum: 2009-09-29 13:38:56

Photoblog

Finally I started my own photoblog at gelbersprudel.de after having found this neat software named "pixelpost".
I'm gonna publish the best shots I took over a longer period. I still consider myself as a bloody beginner concerning photography so I'm looking forward to constructive criticism. Check it out every once in a while. :)

Kategorien: Software, Weblog
Datum: 2009-09-29 12:49:19

Weightloss... the Python Style - New Blog Software

It's done! My weblog is completely ported to the new blog software.
Under the hood a minimalistic lightning-fast python script with the tongue twisting name Kukkaisvoima is doing a fantastic job now.
While my former choice Drupal came with about 500 files in the default installation Kukkaisvoima consists of just one file. Yes right.. just ONE! And believe me, it isn't packed with 2 millions lines of code (roughly 1000 lines after my modifications!). I wasn't happy with Drupal anymore since it usually took a whole while until some html code was rendered in the browser. It just felt too sluggish for a simple weblog like mine. Though Wordpress wasn't an option in my opinion. Since everybody uses it the effort put into hacking that software is humongous and I already did my experiences concerning hacked root servers misused as bot drones.
I'm happy with the new minimalism so I'm writing this article in my favorite text editor Kate saving it as a simple text file and uploading it to the scripts data directory. Done! No database, no HTML form editor.
Anyway, the original software was a little too minimalistic for my taste. So I modified the python sourcecode to make it meet my demands. I wanted to have the opportunity to create static sites that don't show up in the article and category list. In addition to that I tried to port the beautiful Wordpress Theme Misty Look which worked not that bad. Though I had to modify the script again since functionality and layout isn't seperated that well. Not even talking of the CSS work that had to be done (I kinda hate that). After some code cosmetics I'm gonna publish the modified source code and the Misty Look Stylesheet file on this site. So be patient.

Oh, and as you may have figured out at this point I'm partly writing english from now on. Similar to my decision to micro-blog bilingual I'm gonna do that here as well. Germany-related topics are still gonna be posted in german though as well as some more complex ones that are just too tough (for me) to translate into english.

Kategorien: Software, Weblog
Datum: 2009-09-25 15:34:33

OpenOffice 3 erkennt Zahlen


...oder auch nicht.
Möchte man in OpenOffice Writer eine Tabelle mit Inhalt füllen, hat man unter Umständen richtig Spaß. Standardmäßig versucht OpenOffice nämlich, Zahlenformate selbständig zu erkennen.

OpenOffice.org 3 Writer: Automatische Zahlenerkennung deaktivieren
Eine Zahlen- und Punktfolge wird da schnell als Datum interpretiert. Ein enthaltenes Komma macht die Zahl zur Dezimalzahl. Soweit, so gut. Von Tabellenkalkulationsprogrammen ist man's ja gewohnt. Doch geht Writer davon aus, dass man grundsätzlich nur Daten des aktuellen Jahres in Tabellenzellen einfügt. Schließlich leben wir ja auch im Hier und Jetzt. Da kommt es vor, dass ein Datum des Vorjahres kurzerhand in das dementsprechende Datum des aktuellen Jahres umgewandelt wird. Auch werden 0er-Nachkommastellen einfach wegrationalisiert:
16.07.08 --> 16.07.09
17,00 --> 17

Allerdings kann dem Spuk ein Ende bereitet werden. Unter Extras/Optionen/OpenOffice.org Writer/Tabellen deaktiviere man die Zahlenerkennungsfunktion: Eingabe in Tabellen/Zahlenerkennung. Fertsch!
Hach, wie sehr ich doch LaTeX mag!


Kategorien: Software
Datum: 2009-07-16 13:03:08

Opera Turbo - Definiere "schnell"

Gestern mal den neuen Opera 10 beta Browser installiert und ich muss sagen: Ich bin begeistert! Die subjektiv empfundene Trägheit des Opera 9.6x in der 64-bit Variante, veranlasste mich in letzter Zeit schon fast wieder mit dem Gedanken spielen, zu Mozillas Speicherfresser Firefox bzw. Iceweasel wechseln. Die neue Presto/2.2.15 Rendering Engine fühlt sich dagegen locker, leicht und sauschnell an. Selbst Youtube macht Spaß, bremsten sonst x Flash-Instanzen des Adobe Flashplayer 10 in der 64-bit Version gepaart mit massenhaft Javascript das Surferlebnis ziemlich aus.


Bullshit Science par excellence: Shaka Shaka Technologie! Wie gut, dass ich mit Hirn gebohren wurde.
Neben dem neuen Feature, dass die Tabs ab einer gewissen vertikalen Größe Snapshots der jeweiligen Webseite anzeigen, besitzt der 10er das sogenannte "Turbo"-Feature. Ist die Bandbreite der Internetverbindung sehr begrenzt - der Breitbandausbau ist im Germanenland derzeit ja wieder rückläufig - verspricht das Feature dennoch schnelle Ladezeiten. Der, datenschutztechnisch etwas bedenkliche Clou: Seitens Opera werden firmeneigene Proxyserver zwischengeschaltet, die den Netzverkehr stark komprimieren und an den turbobefeuerten Browser weiterleiten.

Doch an der Netzwerkgeschwindigkeitserkennung sollten die Opera-Entwickler bis zum Final Release noch etwas arbeiten. So ploppte gerade folgender Hinweis ins Blickfeld:

You appear to be on a slow network. Try to enable Opera Turbo to speed up browsing.

Sind denn 20 Mbit/s noch nicht genug? Come on, guys! ;)


Kategorien: Software
Datum: 2009-06-04 13:03:08