The whole browser window but a border

Filling the whole browser window except for a border is surprisingly difficult. Here are three solutions. </head> <body> <div class="outer outer1"> <div class="inner"> </div> </div> </body> </html> Instead of outer1, there is also outer2 and outer3. The solutions use different approaches: The calc() function to do math in CSS, absolute positioning with top, left, bottom, right and the new box-sizing property. Here is the stylesheet: html, body { margin: 0px; padding: 0px; } .

Read More…

Docker trouble

Docker containers are great, and the Dockerfile build process is quite good, but there are pitfalls for newbies who come to Docker with a virtualization mindset. Docker containers are not light-weight VMs, because the abstraction happens at a much higher level. Docker is platform-as-a-service, not system-as-a-service. Here is a short list of issues I encountered migrating a couple of services from bare metal to Docker containers: Lack of kernel independence with SE Linux Lack of docker internals independence in the mount table.

Read More…

OpenSSH authorized_key options by version

This should be in the official documentation, but for what it’s worth:

All versions of OpenSSH support the following options in authorized_keys:

command=””, environment=””, from=””, no-agent-forwarding, no-port-forwarding, no-pty, no-X11-forwarding.

Starting with version 2.5.2, OpenSSH supports permitopen.

Starting with version 4.3, OpenSSH supports tunnel.

Starting with version 4.9, OpenSSH supports no-user-rc.

Starting with version 5.4, OpenSSH supports cert-authority.

Starting with version 5.6, OpenSSH supports principals.

Attention, elasticsearch counts in UTF-16

Here is a surprise. Trying to extract the text of analyzed tokens in elasticsearch, I found that it didn’t match my expectations. The positions start_offset and end_offset were not counted in bytes, and not counted in Unicode graphemes. What was going on? A hint was the behavior of the standard analyzer: $ python -c 'print "X \xf0\x9d\x9b\xbe Y"' > test.txt $ curl -XGET 'http://localhost:9200/diss/_analyze?analyzer=standard&pretty=1' -d @test.txt { "tokens" : [ { "token" : "x", "start_offset" : 0, "end_offset" : 1, "type" : "<ALPHANUM>", "position" : 1 }, { "token" : "\uD835\uDEFE", "start_offset" : 2, "end_offset" : 4, "type" : "<ALPHANUM>", "position" : 2 }, { "token" : "y", "start_offset" : 5, "end_offset" : 6, "type" : "<ALPHANUM>", "position" : 3 } ] } Apparently, the input was converted to UTF-16, and the offsets were measured in multibytes (2-byte sequences).

Read More…

Fedora 18 Beta on Thinkpad T430s

I’m dreading this post. So much nice things have happened in free software over the last decade, that it is always a huge disappointment to me when I am thrown back into the seat of a new user and get a flash back to the horrible times of abysmal failures and sloppy engineering. Let’s get it over with as quickly as possible. Linux kernel is struggeling with a desastrous SSD communication problem under workloads typical of database applications (such as the popular LAMP stack, so by no means anything extraordinary).

Read More…

Simplistic Square Wave Generator in Verilog

Doodling around with electronics, I wanted to measure the frequency response of a simple capacitor-resistor circuit. It’s easy to calculate, but usually there is a lot to learn from actually doing the experiment and dealing with the problems that pop up. The interesting part of the problem was actually how to create a driver for the input AC signal, as I don’t have a function generator here, and my analog circuit fu is not good enough to build one from scratch without help.

Read More…

Installing Fedora 16

Random notes from installing Fedora 16, focussing on the negative things, because that is what is needed to make progress. Installer failures: The default ISO image is 32 bit, and one has to search for the 64 bit version. That’s ridiculous. There is no default option to install a RAID + Encryption + LVM configuration, so the custom partitioning method must be used. There is no way to start with a degraded RAID, so a spare disk needs to be available as backup.

Read More…

User Interface Design failure common in Mac OS X, Ubuntu Unity and Gnome Shell 3

It is not news by now that Canonical Unity and Gnome Shell 3 are considered flawed by many GNU/Linux developers (such as Linus Torvalds, Eric Raymond, and many passionate people with less known names). There are many flaws that hinder the short term adoption of these. Flaws that are fixable, but make them unusable until they have been developed beyond their current pre-alpha quality. Let’s first talk about the shoddy programming quality.

Read More…

A better iterator for couchdb-python

The most used python library for CouchDB seems to be [couchdb-python][1]. It is a simple little library that makes accessing a couch database a breeze, but it has a serious limitation when using views: The first thing it always does is to fetch all rows in the view. Then it processes them and keeps them as a list in memory. Because it is using simple data types (as opposed to a C extension or at least records), these lists have a huge overhead of about 1 KB per row (ouch!

Read More…

Parsing Unicode text with Python PLY

Python PLY is quite helpful in writing a simple scanner and parser, but I had some trouble figuring out how to make it accept Unicode tokens. I kept getting weird errors like this: Getr. Zählung Syntax Error: '̈hlung' The syntax error is displayed as an h with umlaut, something that does not even exist in German. On closer inspection, the problem turns out to be the COMBINING DIAERESIS character, which prevents the regular expressions in PLY from matching.

Read More…

All Posts by Category or Tags.