Skip to content

Instantly share code, notes, and snippets.

Avatar

Erich Eichinger eeichinger

View GitHub Profile
@eeichinger
eeichinger / generate_clone_all_bitbucket_repos.sh
Last active Aug 27, 2021
script to clone all repositories in a bitbucket server (aka stash) project
View generate_clone_all_bitbucket_repos.sh
# 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 / git toolkit
Last active Aug 3, 2021
Recursively execute git commands, find unpushed commits, ...
View git toolkit
#
# 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 / clone-repos-generate.sh
Last active Mar 2, 2021
Generate a script to clone all repos within a specific project from bitbucket server and bitbucket cloud
View clone-repos-generate.sh
# 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 / jenkins_list_git_tags_and_branches.groovy
Created Mar 25, 2014
Groovy script to list git tags and branches using jenkins' Dynamic Choices Parameter plugin
View jenkins_list_git_tags_and_branches.groovy
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 / readme.md
Last active Sep 30, 2020
Pimp my OSX - list of tools & utilities on OSX I can't live without
View readme.md
@eeichinger
eeichinger / ConcordionSpringJunit4ClassRunner.java
Created May 17, 2012
Spring Test / Concordion integration - integrate Concordion with Spring's test runner
View ConcordionSpringJunit4ClassRunner.java
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;
View jenkins-decrypt.groovy
#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 Apr 3, 2019
Makefile 'init' target for setting up a virtual python environment (using pyenv)
View Makefile
# 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
View file_encode_decode_base64.py
# 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 Apr 1, 2019
Jetty Configuration multiple war contexts and with web.xml override to avoid windows file locking
View jetty-pom.xml
<?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>