Skip to content

Instantly share code, notes, and snippets.

View robertoschwald's full-sized avatar

Robert Oschwald robertoschwald

View GitHub Profile
@robertoschwald
robertoschwald / macports_build_bacula_dmg_private.sh
Last active April 16, 2022 17:35
Script to build a standalone Bacula Client MDMG Package on OSX using MacPorts. Tested on OSX 10.11 using XCode 7.1.1 and Bacula 7.0.4
#!/bin/sh
# Script to build MacPorts based OSX Bacula FD Client (7.0.4) in private dir as MDMG installer
# containing all dependencies.
# (c) 2015 Robert Oschwald
# Prerequisites:
# - OSX (10.11 tested)
# - XCODE (7.1.1 and 7.2.0 tested)
# - PackageMaker.app (http://adcdownload.apple.com/Developer_Tools/auxiliary_tools_for_xcode__late_july_2012/xcode44auxtools6938114a.dmg)
@robertoschwald
robertoschwald / GrailsDomainConfiguration.groovy
Created February 19, 2016 13:32
Grails 2.4.x PostgreSQL duplicate primary keys, indexes, unique keys dbm-gorm-diff workaround
/*
* Copyright 2013-2016 symentis GmbH - All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@robertoschwald
robertoschwald / grails-quartz-2.2.1-db-migration.groovy
Last active February 1, 2018 10:28
Grails 3.x Quartz-Plugin 2.0.0 Database-Migration migration file to create the MySQL / MariaDB InnoDB DB tables for Quartz
// Grails database-migration plugin changeLog for Quartz 2.2.1 DB Tables (Grails Quartz-Plugin 2.0.0)
// Add this migration file to the migrations folder, register in changelog.groovy and add to the dbm config in application.yml/roovy:
// grails.plugin.databasemigration.excludeObjects = ['QRTZ_BLOB_TRIGGERS', 'QRTZ_CALENDARS', 'QRTZ_CRON_TRIGGERS', 'QRTZ_FIRED_TRIGGERS', 'QRTZ_JOB_DETAILS', 'QRTZ_LOCKS', 'QRTZ_PAUSED_TRIGGER_GRPS', 'QRTZ_SCHEDULER_STATE', 'QRTZ_SIMPLE_TRIGGERS', 'QRTZ_SIMPROP_TRIGGERS', 'QRTZ_TRIGGERS']
// See http://svn.terracotta.org/svn/quartz/tags/quartz-2.2.1/distribution/src/main/assembly/root/docs/dbTables/tables_mysql_innodb.sql
databaseChangeLog = {
changeSet(author: "r.o. (manual)", id: "1476893806-1") {
sql('''
DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
@robertoschwald
robertoschwald / application.yml
Last active November 15, 2019 00:09
Grails 3.x Quartz-Plugin 2.0.0 application.yml configuration for clustering support
quartz:
autoStartup: true
jdbcStore: true
sheduler:
instanceName: myapp_quartz
instanceId: AUTO
skipUpdateCheck: true
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 5
@robertoschwald
robertoschwald / application.groovy
Last active November 15, 2018 11:11
Grails 3.x Quartz-Plugin 2.0.0 application.groovy example configuration for clustering support
quartz {
autoStartup = true
jdbcStore = true
waitForJobsToCompleteOnShutdown = true
// Allows monitoring in Java Melody (if you have the java melody plugin installed in your grails app)
exposeSchedulerInRepository = true
scheduler {
instanceName = 'my_quartz'
instanceId = 'AUTO'
@robertoschwald
robertoschwald / GitHubEnterprise.ovf
Last active September 13, 2020 07:08
GitHub Enterprise 2.8.7 fixed OVF file for vCenter 6.5
<?xml version="1.0" encoding="UTF-8"?>
<!-- Manually converted to vCenter 6.5 format by roos
Note: You must update the GitHubEnterprise.mf sha1 fingerprint of this file.
This version fixes the OVF import error in vCenter 6.5 ("..ProductInfo not allowed in Envelope..")
-->
<!--Generated by VMware ovftool 3.5.0 (build-1274719), UTC time: 2017-01-26T19:38:58.786729Z-->
<Envelope vmw:buildId="build-1274719" xmlns="http://schemas.dmtf.org/ovf/envelope/1"
xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common"
xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1"
xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"
@robertoschwald
robertoschwald / ApacheEmailValidator.java
Last active August 10, 2017 11:32
Hibernate ApacheEmailValidator. Use instead of @pattern or @Email to let Apache Commons EmailValidator do the validation.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
@robertoschwald
robertoschwald / SampleEntity.java
Last active August 11, 2017 15:04
TABLE_PER_CLASS and MySQL / Galera PK problem possible workaround
// Due to MySQL's lack of sequences, Hibernate 5.x would use TABLE identity if
// setting strategy = @GeneratedValue(strategy = GenerationType.AUTO).
// This currently does not work with Galera Cluster, as it needs a PK
// which is not defined by the default hibernate sequence table "hibernate_sequence",
// so DDL will fail and the application does not work as expected.
// One Trick would be to define our own TableGenerator which holds a PK like below.
// Disadvantages:
// - performance (generally a problem when using GenerationType.TABLE)
// - not the best option for a DB agnostic application, when other DB types support SEQUENCE.
@robertoschwald
robertoschwald / createOSXInstallerIso
Created October 26, 2017 17:00
Create OSX installer ISO file (example for High Sierra)
#!/usr/bin/env bash
# Create OSX Installer ISO.
# 2017 robertoschwald
# https://gist.github.com/robertoschwald/7f9eadf78739128ea1fb7a32c0472e1c
installer_path=/Applications/Install\ macOS\ High\ Sierra.app
installer_mountpoint=/Volumes/Install\ macOS\ High\ Sierra
echo "Creating Install ISO"
@robertoschwald
robertoschwald / install_clamav.sh
Last active July 9, 2021 07:16
Install and configure ClamAV on CentOS7
#!/usr/bin/env bash
# install and configure clamav/freshclam on CentOS7.
# See https://gist.github.com/robertoschwald/b01a2001bb5bb15348a9bfe7ef543027
if ! [ $(id -u) = 0 ]; then
echo "Must run as root."
exit 1
fi