Skip to content

Instantly share code, notes, and snippets.

View mikaelhg's full-sized avatar
🏠
Working from home

Mikael Gueck mikaelhg

🏠
Working from home
View GitHub Profile
@mikaelhg
mikaelhg / build.sh
Last active June 1, 2018 15:43
Building dlib with CUDA and cuDNN
mkdir build; cd build;
cmake .. -DCMAKE_PREFIX_PATH=/usr/local/cuda-9.0 -DCUDA_HOST_COMPILER=/usr/bin/g++-6 -DDLIB_USE_CUDA=1
cmake --build .
python3 setup.py bdist_wheel --set CMAKE_PREFIX_PATH=/usr/local/cuda-9.0 --set CUDA_HOST_COMPILER=/usr/bin/g++-6 --set DLIB_USE_CUDA=1 --set PYTHON_EXECUTABLE=/usr/bin/python3
pip3 install --user dist/dlib-19.13.99-cp36-cp36m-linux_x86_64.whl
@mikaelhg
mikaelhg / 01_pkcs12-cacerts-workaround.sh
Last active January 17, 2025 07:11
Workaround for java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
# Ubuntu 18.04 and various Docker images such as openjdk:9-jdk throw exceptions when
# Java applications use SSL and HTTPS, because Java 9 changed a file format, if you
# create that file from scratch, like Debian / Ubuntu do.
#
# Before applying, run your application with the Java command line parameter
# java -Djavax.net.ssl.trustStorePassword=changeit ...
# to verify that this workaround is relevant to your particular issue.
#
# The parameter by itself can be used as a workaround, as well.
<!-- This work is licensed under a Creative Commons Attribution 4.0 International License. -->
<speak>
<p>
<s>
<emphasis>Friends, Romans, countrymen,</emphasis>
lend me your ears.
</s>
</p>
@mikaelhg
mikaelhg / poc.kt
Created December 28, 2017 18:23
Spring 5 EnableWebSocket and EnableScheduling "Unexpected use of scheduler" issue workaround
package io.mikael.poc
import org.slf4j.LoggerFactory
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.scheduling.annotation.EnableScheduling
import org.springframework.scheduling.annotation.Scheduled
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
@mikaelhg
mikaelhg / SerializationCompatibilityTest.java
Created November 30, 2017 10:05
Using Jackson to emulate GSON for JSON and xstream for XML.
package io.mikael.poc.ser;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationConfig;
import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider;
import com.fasterxml.jackson.databind.ser.SerializerFactory;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
@mikaelhg
mikaelhg / churn.ipynb
Created November 1, 2017 09:49
Telco customer churn experimentation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mikaelhg
mikaelhg / build.log
Created August 28, 2017 08:52
Build RainEffect
mikael@gumibook:~/devel/temp/RainEffect$ yarn install
yarn install v0.27.5
info No lockfile found.
[1/4] Resolving packages...
warning babelify > babel-core > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning browserify > glob > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp-connect > [email protected]: connect 2.x series is deprecated
warning glslify > static-module > through2 > xtend > [email protected]:
warning gulp > vinyl-fs > glob-watcher > gaze > globule > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
@mikaelhg
mikaelhg / pom.yml
Created July 15, 2017 12:30
JVM embedded web server for integration tests
modelVersion: 4.0.0
groupId: io.mikael
artifactId: ksoup
name: ksoup
version: 1.0-SNAPSHOT
packaging: jar
parent: {groupId: org.sonatype.oss, artifactId: oss-parent, version: 9}
@mikaelhg
mikaelhg / README.md
Last active November 21, 2016 17:11
Merge properties files

Merge .properties files

pip install -r requirements.txt
python props.py a.properties b.properties c.properties

Python

@mikaelhg
mikaelhg / astlan-diff.py
Created October 15, 2016 22:39
Diff between two subsequent editions of an ebook alpha file
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import difflib
import epub
from bs4 import BeautifulSoup
def text_paras(book, href):
soup = BeautifulSoup(book.read_item(href), 'lxml')