Skip to content

Instantly share code, notes, and snippets.

View robertoschwald's full-sized avatar

Robert Oschwald robertoschwald

View GitHub Profile
@robertoschwald
robertoschwald / build.gradle.xrebel.groovy
Created November 29, 2018 10:29
Run Grails 3.x with XRebel
// To use XRebel in Grails 3.3.x, add to build.gradle bootRun block.
// Then you are able to conditionally enable XRebel by specifying "-Dxrebel=<path_to_xrebel>"
if (System.getProperty('xrebel')){
if (new File(System.getProperty('xrebel')).exists()){
jvmArgs "-javaagent:${System.getProperty('xrebel')}"
} else {
println "XRebel file ${System.getProperty('xrebel')} not found. Ignoring"
}
}
@robertoschwald
robertoschwald / prepare_nextcloud_docker.sh
Last active October 13, 2023 04:55
Configure NextCloud Docker with nginx-proxy, MariaDB, Redis, LetsEncrypt and Cron Support
#!/usr/bin/env bash
# Create Nextcloud host directory structure, .env and docker-compose.yml files
# 2020 robertoschwald
# Consists of the following containers:
# nginx-proxy (frontend proxy)
# nginx-proxy-letsencrypt (LetsEncrypt issuing)
# nextcloud-app (Nextcloud application server)
# nextcloud-cron (Nextcloud cron server. Executes cron.php every few minutes)
@robertoschwald
robertoschwald / mod_jk.spec
Created August 19, 2020 10:43
mod_jk RPM Spec file for CentOS8
%{!?apxs: %{expand: %%define apxs %{_bindir}/apxs}}
%define httpd httpd
Name: mod_jk
Version: 1.2.48
Release: 1%{?org_tag}%{?dist}
Epoch: 0
Summary: Tomcat mod_jk connector for Apache
License: Apache License
@robertoschwald
robertoschwald / grails4_hazelcast_springSession_config_hints.md
Last active May 25, 2021 22:56
Using Grails 4 with Spring-Session, and single-instance Hazelcast for Session-Replication and Hibernate 2nd Level cache

Goals

  • Use Spring-Session-Hazelcast to replicate Http Session between Application Nodes
  • Use Hazelcast Hibernate as Hibernate 2nd Level cache
  • Use only one single Hazelcast instance auto-generated by Spring Boot
  • Support Grails mutable Session objects (Flash messages, etc.)

The problem

  • Spring-Boot automatically configures a 'hazelcastInstance' bean if Hazelcast dependency is found.
  • We can configure hazelcast-hibernate to use an existing HazelcastInstance with hibernate.cache.hazelcast.instance_name config key.
  • Unfortunately, Grails instantiates the hibernateDatastore bean before Spring-Boot generates the hazelcastInstance bean.
@robertoschwald
robertoschwald / borgmatic.spec
Last active July 3, 2022 11:33
Borgmatic rpm .spec for Rocky8 (RHEL8, CentOS8, Alma8)
Name: borgmatic
Version: 1.6.5
Release: 1%{?dist}
Summary: Simple Python wrapper script for borgbackup
License: GPLv3
URL: https://torsion.org/borgmatic
Source0: https://projects.torsion.org/borgmatic-collective/borgmatic/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: borgmatic.service.patch
@robertoschwald
robertoschwald / upgrade_to_bullseye.sh
Last active August 30, 2022 15:24
Upgrade Raspberry from Buster to Bullseye in-place
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ]; then
echo "Please run this script as root"
exit
fi
# Change Buster release-info to oldstable
apt update --allow-releaseinfo-change
@robertoschwald
robertoschwald / build_bareos_packages.sh
Last active November 30, 2023 17:05
Build Bareos deb packages
# Build Bareos Debian Packages, e.g. for Raspberry PI OS / arm64
BAREOS_BUILD_VERSION=23.0.0-pre
BAREOS_BUILD_DATE=`date --rfc-email`
git clone https://github.com/bareos/bareos.git
git checkout tags/WIP/${BAREOS_BUILD_VERSION}
sudo apt install dpkg-dev fakeroot dch
sudo apt build-dep ./bareos
@robertoschwald
robertoschwald / ConfigHowdyBeta.sh
Last active May 2, 2024 18:09 — forked from m1nicrusher/ConfigHowdy.sh
Config Howdy-Beta for Fedora 39 using GNOME
#!/usr/bin/env bash
set -e
# Configure Fedora PAM to use Howdy for facial recognition
# Configured sudo and GDM login.
# SELinux is also configured to allow Howdy to access necessary resources.
# Notes:
# - This script is tested on Fedora 39.
# - This script is for howdy-beta version, which provides pam_howdy.so
# Reference: https://copr.fedorainfracloud.org/coprs/principis/howdy-beta/