Skip to content

Instantly share code, notes, and snippets.

View eeichinger's full-sized avatar

Erich Eichinger eeichinger

View GitHub Profile
@eeichinger
eeichinger / git toolkit
Last active March 29, 2024 06:18
Recursively execute git commands, find unpushed commits, ...
#
# Description:
# Various additional git utility commands
#
# git recursive <command>:
# from the current working folder search recursively for local git repos and run 'git <command>' on each of them.
#
# git recursive-exec <command>:
# from the current working folder search recursively for local git repos and run '<command>' on each of them.
#
@eeichinger
eeichinger / generate_clone_all_bitbucket_repos.sh
Last active March 26, 2024 20:57
script to clone all repositories in a bitbucket server (aka stash) project
# this script uses syntax for bitbucket server.
# For bitbucket cloud see https://confluence.atlassian.com/bitbucket/use-the-bitbucket-cloud-rest-apis-222724129.html
#
# Note: replace username, password and PROJECTNAME with your values
USERNAME=xxxx
PASSWORD=xxxx
PROJECTNAME=xxxxx
# jq syntax helpful links:
@eeichinger
eeichinger / clone-repos-generate.sh
Last active December 27, 2023 10:12
Generate a script to clone all repos within a specific project from bitbucket server and bitbucket cloud
# generate a script ./clone-repos.sh from a list of repos fetched via Bitbucket API
# note: requires 'curl' and 'jq' to be installed
set -e
echo -n '' > clone-repos.sh
chmod +x clone-repos.sh
ONPREM_USER=xxxxx
ONPREM_PASS=......
@eeichinger
eeichinger / readme.md
Last active October 16, 2023 14:26
Pimp my OSX - list of tools & utilities on OSX I can't live without
@eeichinger
eeichinger / jenkins_list_git_tags_and_branches.groovy
Created March 25, 2014 13:35
Groovy script to list git tags and branches using jenkins' Dynamic Choices Parameter plugin
def gettags = ("git ls-remote -t -h ssh://jenkins@<mygitpath>/repo/some.git feature/*").execute()
return gettags.text.readLines()
.collect { it.split()[1].replaceAll('refs/heads/', '') }
.unique()
.findAll { it.startsWith('<some more pattern>') }
@eeichinger
eeichinger / ConcordionSpringJunit4ClassRunner.java
Created May 17, 2012 15:56
Spring Test / Concordion integration - integrate Concordion with Spring's test runner
package testsupport;
import org.concordion.api.ResultSummary;
import org.concordion.internal.FixtureRunner;
import org.junit.runner.Description;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.Statement;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@eeichinger
eeichinger / jenkins-decrypt.groovy
Created October 19, 2016 19:36 — forked from tuxfight3r/jenkins-decrypt.groovy
Decrypting Jenkins Password
#To Decrypt Jenkins Password from credentials.xml
#<username>jenkins</username>
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase>
#go to the jenkins url
http://jenkins-host/script
#In the console paste the script
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J'
@eeichinger
eeichinger / Makefile
Created April 3, 2019 10:12
Makefile 'init' target for setting up a virtual python environment (using pyenv)
# automatically initialise a local python env
# requires:
# - pyenv installed (see https://github.com/pyenv/pyenv)
# - ./requirements.txt to manage dependencies via pip
PYENV_VERSION:="3.7.2"
all: init
.PHONY: clean
# from https://stackoverflow.com/questions/22734401/base64-encode-decode-to-from-files-in-chunks-with-python-2-7
#
# write_base64_file_from_file
# write_file_from_base64_file
# - must run with python 2.7
# - must process data in chunks to limit memory consumption
# - base64 data must be JSON compatible, i.e.
# use base64 "modern" interface,
# not base64.encodestring() which contains linefeeds
#
@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>