Skip to content

Instantly share code, notes, and snippets.

View eeichinger's full-sized avatar

Erich Eichinger eeichinger

View GitHub Profile
@eeichinger
eeichinger / pom.xml
Created May 20, 2015 08:42
A pom template, use for- set file encoding- compile java 8, target java 7 jvm- embed manifests with jenkins build info into jar and war- configure enforcer plugin- define various commonly used libs + versions (slf4j, logback, logstash, spring, spring-cloud, hystrix, rxjava, dropwizard, concordion, wiremock, guava, jolokia)
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>@@GROUPID@@</groupId>
<artifactId>@@ARTIFACTID@@</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<description>
A default pom template - use for
- set file encoding
@eeichinger
eeichinger / pom.xml
Created May 20, 2015 08:34
maven plugins to compile java 1.8 syntax but target jvm 1.7
<!--
compile java 1.8, target java 1.7
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<encoding>utf-8</encoding>
<source>1.8</source>
@eeichinger
eeichinger / CatchOperatorTest.java
Created May 20, 2015 05:56
an rxjava catch-like operator
package myrx;
import org.junit.Test;
import rx.Observable;
import rx.Producer;
import rx.Subscriber;
import rx.exceptions.Exceptions;
import rx.functions.Func1;
import rx.plugins.RxJavaPlugins;
@eeichinger
eeichinger / start_wait.sh
Created April 1, 2015 14:15
Tomcat start & wait until success
#!/bin/sh
# Usage:
# start_wait <modulename> <servername>
# Default vals for args
# http://stackoverflow.com/questions/9332802/how-to-write-a-bash-script-that-takes-optional-input-arguments
TIMEOUT=90
@eeichinger
eeichinger / backup_jenkins.sh
Created January 10, 2015 10:09
Backup complete Jenkins config via ssh, excluding archived binaries
ssh <user>@<server> "tar -cvzf - -C /home/jenkins/ . --exclude 'maven-repositories' --exclude 'jobs/*/builds' --exclude 'backup' --exclude 'workspace' " > jenkins_backup.tar.gz
@eeichinger
eeichinger / wrap.sh
Created January 5, 2015 14:18
Wrap raw AAC files in MP4 container and copy ID3v2 tags to MP4 metadata
#!/bin/bash
# Wrap raw AAC files in MP4 container and copy ID3v2 tags to MP4 metadata. Original files are not touched, new files appear besides them with .m4a extension
# requires MP4Box and kid3 (install via homebrew. You may need to install MP4Box manually from http://gpac.wp.mines-telecom.fr/downloads/gpac-nightly-builds/. Homebrew had troubles installing mp4box. The executable is found inside the osmo4.app, see below)
# kid3 also has problems with full qualified filepaths as well as spaces in the filenames
for fic in Music/**/*.aac
do
echo processing $fic
@eeichinger
eeichinger / svn-tag.sh
Created November 19, 2014 18:03
svn tag command line
svn rm https://svn.example.com/myproject/tags/last-successful-ci/mytag -m "Remove existing Test Tag" --no-auth-cache --non-interactive --username eeichinger --password pass1234
svn copy https://svn.example.com/myproject/trunk@246 https://svn.example.com/myproject/tags/last-successful-ci/mytag -m "Test Tag" --no-auth-cache --non-interactive --username eeichinger --password pass1234
@eeichinger
eeichinger / AllowCORSRequestFilter.java
Last active August 29, 2015 14:09
CORS Request Filter for debugging/testing purposes
package com.example.web;
import com.google.common.base.Strings;
import com.google.common.net.HttpHeaders;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@eeichinger
eeichinger / jetty-pom.xml
Last active April 1, 2019 16:10
Jetty Configuration multiple war contexts and with web.xml override to avoid windows file locking
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sample</groupId>
<artifactId>testwebserver</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
@eeichinger
eeichinger / RunJetty.java
Created October 4, 2014 15:11
Custom Embedded Jetty Runner for easier debugging - run xml free webapps
/**
based on
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-runner</artifactId>
<version>9.2.3.v20140905</version>
</dependency>
*/