Archive for December, 2014

Samsung Galaxy S5 Mini

December 23rd, 2014 subogero 1 comment

Just a few photos of this stunning December moning with my new S5 Mini.

Hármashatár hegy

Hármashatár hegy

Hármashatár hegy közel

Hármashatár hegy közel

Mátra a háttérben

Mátra a háttérben


A'ég keleten

Categories: Uncategorized Tags:

Compiz is Back

December 20th, 2014 subogero Comments off

It’s been four long years since Ubuntu 10.04 Lucid Lynx. It was the perfect desktop OS. It was extremely easy to use for both mouse and keyboard junkies. And I remember showing off wobbling transparent terminal windows on a rotating desktop cube to baffled Windows and Mac fans.

And then Red Hat’s and Canonical’s brain-dead corporate fighters just had to destroy everything. Yes, step forward, William Jon McCann, project lead of the tasteless and dysfunctional Gnome 3. You don’t even know what XFCE is. If you’re interested, it is a means of survival in the dystopian world you created.

Fortunately, there were always silver linings in the clouds. Mainly thanks to Linux Mint. And now, with Linux MInt 17.1 Rebecca MATE, Compiz, our favourite compositing window manager, is back.

And what I’m most happy about is not Wobbly Windows. Not the Desktop Cube. Nor the Ring Switcher.

It’s the Place Windows plugin.

The world’s one and only sane window placement algorithm. It does not pile new windows on top of the old ones, but places them in the furthest corner of the screen to utilize real estate and keep many windows visible. Bliss.

RemotePi REST

December 3rd, 2014 subogero Comments off

I’m constantly bombarded with RESTful stuff at work. So much so, that I’ve started rewriting RemotePi as a REST API. Lots of learning and reading, then.

As usual most of the literature was written by people who studied computer science. They just love abstractions. Solving problems is OK, as long as they get their daily hit of abstractions. So there are resources, verbs and routers. Very nice.

You’re supposed to refer to a resource without ugly queries in the URL. Instead, it should be just http://pi/remotepi/home/ for the media root directory. But how the hell does such an URL generate a query that can be processed by a CGI or FastCGI app?

The computer scientists are silent on the issue.

So I had to dig deeper and discover mod_rewrite of Apache2. There is a lot in a name. It rewrites incoming URL requests and is able to turn them into proper queries. Thank you Ludovico Fischer.

So here is my “resource router”.

First enabled mod_rewrite:

a2enmod rewrite
service apache2 restart

And the router config in /etc/apache/sites-available/default

RewriteEngine On
RewriteRule /remotepi/(.+) /remotepi/$1

Very Perly, ain’t it? It’s because it uses the Perl regex engine.

RemotePi FastCGI

December 3rd, 2014 subogero Comments off

RemotePi, the remote-control webb-app of my Raspberry Pi media center, felt sluggish. Until I measured the response time with Firefox WebDeveloper/Network. It’s now official: it was sluggish: it took 800 ms to respond. That’s nearly one second.

So it was time to turn the original CGI solution into a FastCGI one. Instead of firing up a new Perl process upon each request, the app keeps running in the background and replies requests in a main loop. I’m using Apache2 mod_fcgid.

The improvement is shocking: File browsing is about 25 ms, requests involving an omxd call take 80 ms. And that’s basically the pure runtime of the omxd command.

FastCGI is fast indeed.