Category: Software

Avoid constraint errors when running parallel pg_restore

To enhance the restore speed for PostgreSQL databases, the pg_restore command running the most time-consumping steps concurrently by providing the number of jobs with -j/--jobs.

Unfortunately the parallel restore can fail when restoring foreign keys due to not yet restored tables:

pg_restore: error: could not execute query: ERROR:  there is no unique constraint matching given keys for referenced table "page"
Command was: ALTER TABLE ONLY pagecontent
    ADD CONSTRAINT "$1" FOREIGN KEY (page_id) REFERENCES page(id);

 

read more

Old Let’s Encrypt Root Certificate Expiration workaround

The expiring Let’s Encrypt DST Root CA X3 can cause problems on old servers:

root@server:/etc# wget https://www.example.com/monitoring
--2021-09-30 21:34:39--  https://www.example.com/monitoring
Resolving www.example.com (www.example.com)... 93.184.216.34
Connecting to www.example.com (www.example.com)|93.184.216.34|:443... connected.
ERROR: The certificate of `www.example.com' is not trusted.

Fortunately there is an easy workaround to ensure the expired chain is not checked.

read more

Configuring an Unify Dream Machine for Swisscom 6RD IPv6

The residential Swisscom Internet Box 2 does not allow to autoconfigure an Unify Dream Machine with IPv6.

After several hours of research I found a workaround to get IPv6 support.

read more

Workaround for missing DomainClassConverter in Spring Boot JUnit tests

In one of my projects I let Spring Boot automatically bind domain objects from the database.

This fails in the reduced unit test setup, because DomainClassConverter is not available. But it can be mocked!

read more

Avoid conversion warnings when using yedit ansible role

When I fist started to use yedit to modify YAML files I got the following warning:

[WARNING]: The value {...} (type dict) in a string field was converted to "{...}" (type string). If this does not look like what you expect, quote the entire value to ensure it does not change.

 

read more

Shrinking LVM physical volume running on software RAID

Due to a misconfiguration I had to shrink a LVM 2 volume group and its physical volume running on a software RAID.

read more

Formatting phone numbers using libphonenumber in Thymeleaf

The Google phone number parser & formatter is very helpful to ensure the same number format for user prodived data. To simplify the use in Spring Boot application with Thymeleaf I created a wrapping TagLib/ExpressionFactory.

read more

Samsung SSD as Linux Software RAID

Initially I thought adding a pair of Samsung 860 EVO as software RAID to my small home server cannot be too hard...

... but they seem to require special kernel settings to work.

read more

Setup Unifi Controller on Debian 10 / Buster

The requirements of the Unifi Controller do not allow a direct installation. But with a few manual steps a successful setup is possible!

read more

How to ensure you get a BindingResult instead of whitelabel error page when validating input

When I started to use Spring Boot I had some issues with the validation. The @Validated annotation triggered the validation as requested but the validation terminated with an org.springframework.validation.BindException instead of filling the BindingResult object.

read more

Configure Java/JDBC to connect to PostgreSQL with JRE certificate validation

Using the PostgreSQL JDBC driver since 42.2.5, the SSL behaviour changed which can cause FileNotFoundExceptions looking for .postgresql/root.crt.

read more

Configure Apache as Proxy for Thumbor

On our default setup, we use Apache as proxy and load balancer for our applications. This usually works, but caused problems with Thumbor.

 

read more

Inject Attributes to Spring Boot Controller Methods (HandlerMethodArgumentResolver)

During learning Spring Boot I noticed attributes to methods in Spring Boot controllers can be automatically injected.

To migrate my blog from Grails to Spring Boot I created an implementation to inject the current blog instance based on an session attribute.

read more

Asset Pipeline Thymeleaf Taglib

Using the asset pipline in Grails, the production CSS and Javascript files have been including with a digest appendix. This feature is not available in Spring Boot, therefore I started to create a simple Thymeleaf tag library.

read more

SSL Debugging with Arduino / ESP8266

I recently bought the 2.9″ ESPaper Plus Kit, WiFi ePaper display from ThingPulse.

To get this device working with my ansible configured SSL webproxy I had to get some additional debugging skills...

read more

How to find the cause of "deleted object would be re-saved by cascade"

Sometimes if you do not properly delete objects in a Grails/GORM/Hibernate transaction the following error might occur:

deleted object would be re-saved by cascade (remove deleted object from associations)

This message is presented by the org.hibernate.ObjectDeletedException

After some hours of investigation I found a solution to find the cause!

read more

MCabber Notifications in i3

On my new i3 setup I got no notifications of new MCabber events and messages.

read more

Setup CyanogenMod on Google Nexus 10

Due to the decreasing performance of Android on my Nexus 10 and similar reports of other user I tried to install CyanogenMod 13. This caused some resolvable problems...

read more

Seafile behind a proxy

My Seafile instance is running on a dedicated webserver behind a reverse proxy which is handling the SSL encryption.

This setup with the protocol change on one of the webservers does not work out of the box / this case is not documented in the official server documentation.

read more

BASIC Auth with Oracle WebLogic

If you would like to do the authentification in Java application running on Oracle WebLogic, you will probably wonder why the Authentification-Header does not reach the Filter.

read more

Logstash Log4j broken pipe with MDC attributes

We recently configured some applications to log with log4j's SocketAppender to Logstash.

When we startet to add MDC-Attributes we sometimes lost the connection:

| Error log4j:WARN Detected problem with connection: java.net.SocketException: (broken pipe)

read more

PDF nach Scan umwandeln

Beim Duplex-Scan mit hp-scan erstellt mir die Software ein PDF-Dokument, wo auf allen Seiten unten ein weisser Rand ist und jede zweite Seite um 180 verdreht ist.

Zum Glück gibt es Tools, welche diese Probleme in wenigen Schritten beheben können

read more

Create MS SQL Server 2008 SQL Dump

As a Linux using PostgreSQL and MySQL admin I am used to console tools. Therefore creating a sql dump (schema+data) from a MS SQL 2008 database is a challenging task.

read more

Sympa with Virtual Hosts using Exim

Setting up sympa with virtual hosts in an environment using exim requires some small modifications:

read more

BFH VPN + Dateizugriff mit Arch Linux

Wenn man nicht mit Windows, sondern gar mit etwas speziellen wie Arch Linux auf das Netzwerk der Berner Fachhochschule zugreiffen möchte, dann kann findet man leider auf anhieb keine Anleitung im Sharepoint. Daher habe ich mal einige Eckdaten zusammengestellt.

read more

Arduino and Arch Linux

I could not use the Arduino IDE (from AUR) with its default config on Arch Linux.

read more

Fix redmine CSRF / Post-Request issue

I use the squeeze-backport of redmine on Debian.

With the default setup, all the Ajax-Post-Requests cause the logout of the current user due to the missing X-CSRF-Token.

Because I could not find a complete solution, I backported the CSRF-Code from a newer relase.

read more

LXC mit Debian Squeeze

Da die aktuellen Anleitungen für LXC mit Debian Squeeze etwas spärlich und teilweise veraltet sind, notiere ich hier einige Schritte für ein aktuelles Setup.

read more

Systemstart wartet bei "Removing Leftover Files"

Nach einem Systemupdate blieb meine Workstation mit LDAP Authentifizierung beim Starten immer bei "Removing Leftover Files" stehen.

read more

Javascript Map sortieren

Die folgende Map möchte ich nach pos0 und pos1 sortieren....

var imap = {
    1: {
        name: 'Test 3',
        pos0: 30,
        pos1: 20
    },
    2: {
        name: 'Test 1',
        pos0: 10,
        pos1: 30
    },
    3: {
        name: 'Test 2',
        pos0: 20,
        pos1: 10
    }
}

read more

Von GPX zu FoxtrottGPS POI

Für unsere Norwegenferien wollte ich das Tomtom-OV2 über das GPX-Format in die POI-Datenbank von FoxtrottGPS (Fork von TangoGPS) importieren.

read more

SparkleShare auf Ubuntu 11.04

Auf der Suche nach einer Dropbox Alternative, wo man einen eigenen Server verwenden kann, bin ich auf SparkleShare gestossen.

read more

Problem mit unvollständigen Objekten

Im Blog verursachte der folgende Code beim generieren der Tag-Seiten Probleme:

${Article.withCriteria{ tags{like('id',tagInstance.id)  } }}

Die hier geladenen Artikel-Objekte hatten bei der anschliessenden Anzeite nur einen Tag, den von der Tag-Seite.

 

read more

CSS Selektoren

Mit Selektoren lässt sich mehr machen, das man denkt...

read more

Firecookie

Das Firefox-Add-on Firebug ist wohl den meisten Web-Entwicklern bekannt, das Firebug-Addon-on Firecookie aber wohl nicht...

read more

TinyMCE und Modal Dialog

Wenn man die Pluginliste selber zusammenstellt und den Compressor verwendet, kann es sein, dass der Konfigurationsparameter "dialog_type : 'modal'" nicht korrekt arbeitet....

read more

Grails Blog Software

Um Grails besser kennen zu lernen und um dem Tandemblog eine optimierte Blogsoftware zu bieten, habe ich mich entschlossen ein neues Projekt zu starten....

read more

Sort 'mappedBy'

Sorting in Grails is easy, but defining the sort order of 'hasMany' children of an object is not obvious...

read more

© 2015 - 2022 Moritz Kobel

Theme by Anders NorenUp ↑