systemd-logo

How to create custom systemd service – Example of OS monitoring Python service

If you want run your application as a systemd service, using systemctl, you can do that easily by creating service file. As example, we are going to run Python Flask to show basic info about OS. Project structure: Let’s create file monitor_app.py: from flask import Flask, render_template import os app = Flask(__name__) @app.route(‘/’) def index(): return […]

Read More

IntelliJ IDEA – Import plugin module from existing source

If you are trying to import module, which contains IntelliJ Platform Plugin, you would like to have it imported like plugin. How to fix imported plugin module: Open Module settings Import module Apply changes Open .iml file for your module Look for <module type=”JAVA_MODULE” version=”4″> Change it to <module type=”PLUGIN_MODULE” version=”4″> I was not able to find […]

Read More

joinus-java

How to disable weak cipher suites in Java

If you want to set up used cipher suites in your Java application, you can do it by property jdk.tls.disabledAlgorithms for TLS ciphers and jdk.certpath.disabledAlgorithms for SSL certificates, in security policy file java.security. This file is located in {APP_HOME}/jre/lib/security folder. If you want to set which TLS will be used, you can do it in the same […]

Read More

Docker_(container_engine)_logo

Docker – Useful commands

Here are few useful commands for Docker which I am using. So I summarized them here: How to get another part of docker version? You can get everything from docker version result which looks like this: Client: Version:      1.12.1 API version:  1.24 Go version:   go1.7 Git commit:   23cf638 Built:     […]

Read More

hibernate

Hibernate – CASE WHEN in HQL – ParameterNode cannot be cast to SelectExpression

If you want to use SQL USE … WHEN … ELSE expression in HQL (Hibernate Query Language), you may faced to this: java.lang.ClassCastException: org.hibernate.hql.internal.ast.tree.ParameterNode cannot be cast to org.hibernate.hql.internal.ast.tree.SelectExpression This exception is raised during parsing SQL to HQL. If you will check method getFirstThenNode() from class CaseNode.java in package org.hibernate.hql.internal.ast.tree, you are able to see casting to SelectExpression. And there is […]

Read More