Category Archives: Articles in english

Render iOS App Icons from one SVG Image

#!/bin/sh # # Copyright (c) 2015-2016 Marcus Rohrmoser All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) […]

lighttpd +

via Three cases, a ’normal‘ www domain: a ’normal‘ subdomain where the naked domain is part of shared webspace: a proxy subdomain for a rails application (redmine):

MKTileOverlay with gdal2tiles or other TMS tiles

from iOS 7.0 onward there’s the neat MKTileOverlay::initWithURLTemplate: for tiled overlay maps. Sadly it can’t display old-school Tile Map Service maps as e.g. produced by gdal2tiles.py1) because the y-values are flipped upside down. The OSM Wiki says about this fact: „This is really just an unfortunate historical misalignment.“ But with the drop-in MKTileOverlay replacement below, you can […]

Autolayout: change constraint multiplier

the NSLayoutConstraint multiplier property is read-only. But if you need to change it, you can replace the constraint with a modified clone like @implementation NSLayoutConstraint(ChangeMultiplier) // visal form center -(NSLayoutConstraint *)constraintWithMultiplier:(CGFloat)multiplier { return [NSLayoutConstraint constraintWithItem:self.firstItem attribute:self.firstAttribute relatedBy:self.relation toItem:self.secondItem attribute:self.secondAttribute multiplier:multiplier constant:self.constant]; } @end@implementation NSLayoutConstraint(ChangeMultiplier) // visal form center -(NSLayoutConstraint *)constraintWithMultiplier:(CGFloat)multiplier { return [NSLayoutConstraint […]

hardening ssh (debian wheezy)

LogJam requires some action. (Article in german) Update (open-)ssh to a recent version (6.6)   $ echo "deb wheezy-backports main" | sudo tee -a /etc/apt/sources.list $ sudo apt-get -u update $ sudo apt-get install -t wheezy-backports ssh $ sudo apt-get autoremove$ echo "deb wheezy-backports main" | sudo tee -a /etc/apt/sources.list $ sudo apt-get -u update […]

redmine & chruby (fetch emails)

  #!/bin/bash # chruby needs bash # # # redmine email import with chruby. # # # Put this script into <redmine_dir>/script and a set crontab like # $ sudo -u www-data crontab -l # */15 * * * * <redmine_dir>/script/ # cd "$(dirname "$0")/.."   log="log/$(basename "$0" .sh).log" cat >> "$log" <<EOF   $(date […]

lua & timezones by name

A bit hard to puzzle due to scarce documentation. #!/usr/bin/env lua local luatz = require ‚luatz‘ —   local tz_name = ‚Europe/Berlin‘ local ts_loc = luatz.time({year=2014, month=12, day=31, hour=23, min=59})   — %z isn’t supported yet: local function tz_off_iso8601(tz_offset_seconds) local separator = “ — 8601 %z compliant — separator = ‚:‘ — 8601 […]

Why PHP is utterly broken

tl;dr: neither does DATE_RFC1123 produce a rfc1123-date, nor does DATE_RFC850 a rfc850-date. What sense does that make? This example may look scrupulous but seems typical. Mind the mandatory word ‚GMT‚ at the end of rfc1123-date. While DATE_RFC1123 renders something ending with +0000. Which is the same timezone but not the same string. So DATE_RFC1123 is useless for HTTP headers (RFC2616). I wonder what else […]

Validate GPX

$ xmllint –noout –schema <gpx file or url>

Key-based FTP authentication

make a strong ssh key $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa turn to RFC 4716 $ ssh-keygen -e -f ~/.ssh/ add to ~/.ssh/authorized_sftpkeys on destination host try out: $ curl -u „<username>:“ –key ~/.ssh/id_rsa –pubkey ~/.ssh/ -T <file to upload> sftp://<target host>/<target path>/ $ lftp -u <username>,xx … sftp://<target host> P.S.: Hetzner FAQ zum […]