Skip to content

Instantly share code, notes, and snippets.

View kekru's full-sized avatar

Kevin Krummenauer kekru

View GitHub Profile
@kekru
kekru / Remote API via daemon.json.md
Last active January 11, 2024 18:20
Enable Docker Remote API via daemon.json
@kekru
kekru / Springboot.Dockerfile
Last active December 20, 2023 15:51
Spring Boot Dockerfile template
FROM openjdk:8-jre
RUN echo "Europe/Berlin" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
RUN mkdir /data
WORKDIR /data
ADD myapp.jar /data/myapp.jar
ENV springprofiles="" \
MAXRAMIFNOLIMIT=4096
ENTRYPOINT MAXRAM=$(expr `cat /sys/fs/cgroup/memory/memory.limit_in_bytes` / 1024 / 1024) && \
@kekru
kekru / add CA cert on CentOS Debian Ubuntu.md
Last active October 23, 2023 08:21
Add CA cert to local trust store on CentOS, Debian or Ubuntu
  • Open a webpage that uses the CA with Firefox
  • Click the lock-icon in the addressbar -> show information -> show certificate
  • the certificate viewer will open
  • click details and choose the certificate of the certificate-chain, you want to import to CentOS
  • click "Export..." and save it as .crt file
  • Copy the .crt file to /etc/pki/ca-trust/source/anchors on your CentOS machine
  • run update-ca-trust extract
  • test it with wget https://thewebsite.org
@kekru
kekru / Oracle on localhost via Vagrant.md
Last active October 21, 2023 17:19
Run Oracle XE DB on localhost via Virtual Machine, Vagrant, Docker

This is how to easily setup an Oracle XE DB in a Virtual Machine that is accessible via localhost:1521. So you don't have to install Oracle XE locally, but inside a VM.
We use VirtualBox, Vagrant and Docker for that.

First install VirtualBox https://www.virtualbox.org/wiki/Downloads
and Vagrant https://www.vagrantup.com/downloads.html

Run vagrant version to check that vagrant is correctly installed.

Save the Vagrantfile from this gist to a local directory.

@kekru
kekru / 01-IntelliJ-Multiple-Gradle-Projects.md
Last active September 22, 2023 14:28
IntelliJ Multiple Gradle Projects

Multiple Gradle projects in IntelliJ

This is how to open multiple gradle projects in a single IntelliJ window.

  • File -> New -> Project ... -> Empty Project
  • File -> Project Structure ... -> Modules -> Plus Sign -> Import Module
    • Choose your Module -> Import module from external model -> Gradle -> Next
    • Activate Checkbox: "Create separate module per source set"
    • Activate Radio: "Use gradle wrapper task configuration"
  • Finish
@kekru
kekru / 01-sonar-aggregate-generic-testdata.md
Last active August 9, 2023 13:47
Aggregate Sonar Generic Test Data Execution

Sonarqube aggregate Generic Test Data Execution

This is how to combine multiple SonarQube test data reports in the Generic Execution format, using node js.

This can be useful, if you run multiple jest tests, exporting with jest-sonar-reporter and want to combine the results to pass it to SonarQube

We will use glob to find files and xml2js to combine them.

@kekru
kekru / Vagrant create local box.md
Last active July 19, 2023 05:58
Vagrant: Create local box

Create box

This is how to install something in a VM and export it as a Vagrant box and use it locally.

First copy the Vagrantfile from below and change the box to the box you want as a base.

Run vagrant up to create the Virtual Machine and vagrant ssh to login.
On Windows you might have to put ssh.exe to your %PATH%. If you have installed git, you can use C:\Program Files\Git\usr\bin You can also login via Putty on host: "localhost", Port "2222", login: "vagrant", password: "vagrant".

@kekru
kekru / Confluence-Server-find-broken-attachments.md
Last active May 19, 2023 13:17
Confluence Server find broken attachments

Confluence Server find broken attachments

Tested on Confluence Server 7.19.7 with MySQL DB

Based on How to determine the file paths for a page's attachments.
This is how to find out which attachments can not be downloaded, because the file is not found on the file system.

Create /tmp/query.sql

@kekru
kekru / 1-WSL and Docker for Windows.md
Last active January 21, 2023 17:12
Windows 10 Subsystem for Linux combined with Docker for Windows

Using Windows Subsystem for Linux combined with Docker for Windows

Docker CE for Windows

  • Install Docker CE for Windows
  • Go to Docker for Windows Settings -> General and enable Expose daemon on tcp://localhost:2375 without TLS.
    This will enable the Docker remote API for requests, coming from localhost, not from another computer in your network. A TLS secured version is not yet supported in Docker for Windows. See docker/for-win#453 for more information. I also tried a daemon.json file with options tlscacert, tlscert, tlskey and tlsverify, but Docker for Windows crashed on booting.

Install Windows Subsystem for Linux (WSL)

@kekru
kekru / 01-pgadmin-6.15-not-working-with-nginx.md
Last active November 9, 2022 13:10
pgAdmin 6.15 does not work with nginx reverse proxy