Skip to content

Instantly share code, notes, and snippets.


Erich Eichinger eeichinger

View GitHub Profile
eeichinger / Immutable Data Types with Jackson and
Last active Feb 7, 2019
Example tests and notes for making Jackson work with Lombok
View Immutable Data Types with Jackson and

Examples for getting Jackson and Lombok to work together to create immutable data types.

Demonstrates use of:

  • Nullable Types
  • Optional
  • immutable java.util.List
  • immutable array
  • validating custom types on instantiate/unmarshalling
  • use & customize Lombok-@Builder with Jackson
eeichinger / git file change statistics
Created Dec 9, 2013
as someone who regularly gets on site with a client and has to quickly work himself into an existing codebase, I found these tools interesting. I stole them from Greg Young's excellent talk "How to get productive on a project in 24h" at The change rate of modules and files over time is especially intere…
View git file change statistics
# find the modules/folders with highest number of changes
git rev-list --objects --all | awk '$2' | sort -k2 | uniq -cf1 | sort -rn | head
# find the files with the highest number of changes
git rev-list --objects --all | awk '$2' | sort -k2 | uniq -cf1 | sort -rn |
while read frequency sample path
[ "blob" == "$(git cat-file -t $sample)" ] && echo "$frequency\t$path";
eeichinger /
Last active Jun 28, 2018
Apache HttpClient 4.5.x Usage with NTLM Proxy Authentication, ignore SSL Certificate
public void fetch_something() throws Exception {
URI uri = UriBuilder.fromPath(path)
.resolveTemplates(ImmutableMap.<String, Object>builder()
.put("country", VALID_COUNTRY)
.put("language", VALID_LANGUAGE)
eeichinger /
Created Mar 5, 2012
enforce loading spring beans with default-lazy-init=true
public class LazyBeanDefinitionDocumentReader extends DefaultBeanDefinitionDocumentReader {
protected BeanDefinitionParserDelegate createHelper(XmlReaderContext readerContext, Element root, BeanDefinitionParserDelegate parentDelegate) {
root.setAttribute("default-lazy-init", "true");
BeanDefinitionParserDelegate delegate = super.createHelper(readerContext, root, parentDelegate);
return delegate;
eeichinger /
Created Jan 10, 2015
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 / pom.xml
Created May 20, 2015
maven plugins to compile java 1.8 syntax but target jvm 1.7
View pom.xml
compile java 1.8, target java 1.7
eeichinger / winupdatefix.cmd
Created Mar 8, 2012
Windows Update Fix Script
View winupdatefix.cmd
rem windows update fix
rem taken from
ipconfig /flushdns
Cd /d %windir%
del /s *.chk;*.rip;*.tmp;~*.*
msiexec /regserver
sc config msiserver start= auto
net stop msiserver
msiexec /unreg

Keybase proof

I hereby claim:

  • I am eeichinger on github.
  • I am eeichinger ( on keybase.
  • I have a public key ASDxtzTW3lx3A2x-vRF-8yIANoqhSNzFcuSP2Hc6Ok9xuwo

To claim this, I am signing this object:

eeichinger /
Created May 1, 2017
AWS CLI utilities to hook into e.g. ~/.profile
# it's inconvenient to pollute knownhosts with temporary AWS EC2 instances - use aws_ssh instead of ssh to ssh into EC2 instances
alias aws_ssh='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
# This function allows to easily switch between AWS CLI profiles. If necessary, it will assume the given role
# usage:
# set-aws-profile rolename[@accountname]
# "rolename": the profilename as defined in your ~/.aws/config
eeichinger /
Created Apr 19, 2017
Various ways to resolve a script path in bash
#!/usr/bin/env bash
# For my own reference in the future demo's various ways to resolve a script's full qualified path
# Usage: copy this file to /tmp/ and run it from root
# Note: this script uses the 'realpath' utility - to get this on OSX, you need to install 'brew install coreutils'
if [ -z "${doit+x}" ]; then # for if [exists $var] technique, see
scriptfilereal=$(realpath -P "$0")